/ccxt-java
CCXT cryptocurrency exchange library for Java developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Java
Claude Code
$ npx -y skills add ccxt/ccxt --skill ccxt-java --agent claude-code
Codex
$ npx skills add ccxt/ccxt --skill ccxt-java -a codex -y
Cursor
$ npx skills add ccxt/ccxt --skill ccxt-java -a cursor -y
Gemini CLI
$ npx skills add ccxt/ccxt --skill ccxt-java -a gemini-cli -y
GitHub Copilot
$ npx skills add ccxt/ccxt --skill ccxt-java -a github-copilot -y
OpenCode
$ npx skills add ccxt/ccxt --skill ccxt-java -a opencode -y
Windsurf
$ npx skills add ccxt/ccxt --skill ccxt-java -a windsurf -y
SKILL.md
ccxt-java.SKILL.mdname: ccxt-java
description: CCXT cryptocurrency exchange library for Java developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Java projects. Use when working with crypto exchanges in Java applications, trading systems, or financial software. Requires Java 21+.
CCXT for Java
A comprehensive guide to using CCXT in Java projects for cryptocurrency exchange integration.
Installation
Via Gradle
// build.gradle
repositories {
mavenCentral()
}
dependencies {
implementation 'io.github.ccxt:ccxt:latest.release'
}Via Maven
<dependency>
<groupId>io.github.ccxt</groupId>
<artifactId>ccxt</artifactId>
<version>LATEST</version>
</dependency>Requirements
- Java 21 or higher (uses virtual threads)
Quick Start
REST API
import io.github.ccxt.exchanges.Binance;
import io.github.ccxt.types.Ticker;
Binance exchange = new Binance();
exchange.loadMarkets(false);
Ticker ticker = exchange.fetchTicker("BTC/USDT");
System.out.println(ticker.last);WebSocket API - Real-time Updates
import io.github.ccxt.exchanges.pro.Binance;
var exchange = new Binance();
exchange.loadMarkets(false);
while (true) {
Ticker ticker = exchange.watchTicker("BTC/USDT"); // typed sync, blocks for one update
System.out.println(ticker.last);
}Architecture: Typed Subclasses
Each exchange has two classes following the Go pattern:
- `BinanceCore` - transpiled untyped class (internal, extends `BinanceApi` extends `Exchange`)
- `Binance` - typed wrapper extending Core with typed overloads (user-facing)
// User-facing typed class (recommended)
Binance exchange = new Binance();
Ticker ticker = exchange.fetchTicker("BTC/USDT"); // returns Ticker
List<Trade> trades = exchange.fetchTrades("BTC/USDT"); // returns List<Trade>
// Exchange-specific implicit API methods are also accessible
Object raw = exchange.publicGetTicker24hr(params).join(); // Binance-specific endpoint
// Properties accessible directly
exchange.apiKey = "...";
exchange.secret = "...";The typed methods use Java method overloading. They coexist safely with untyped methods because Java resolves overloads at compile time: `BinanceCore.java` is compiled without knowledge of `Binance.java`'s typed overloads, so internal calls always bind to untyped varargs.
REST vs WebSocket
| Feature | REST API | WebSocket API | |---------|----------|---------------| | **Use for** | One-time queries, placing orders | Real-time monitoring, live price feeds | | **Import** | `io.github.ccxt.exchanges.Binance` | `io.github.ccxt.exchanges.pro.Binance` | | **Methods** | `fetch*` (fetchTicker, fetchOrderBook) | `watch*` (watchTicker, watchOrderBook) | | **Returns** | Typed objects (Ticker, List\<Trade\>) | `CompletableFuture<Object>` (call `.join()`) | | **Speed** | Slower (HTTP request/response) | Faster (persistent connection) | | **Rate limits** | Strict (1-2 req/sec) | More lenient (continuous stream) | | **Best for** | Trading, account management | Price monitoring, arbitrage detection |
Creating Exchange Instance
REST API
import io.github.ccxt.exchanges.Binance;
import java.util.Map;
import java.util.HashMap;
// Public API (no authentication)
Binance exchange = new Binance();
// Private API (with authentication)
Map<String, Object> config = new HashMap<>();
config.put("apiKey", "YOUR_API_KEY");
config.put("secret", "YOUR_SECRET");
Binance exchange = new Binance(config);WebSocket API
import io.github.ccxt.exchanges.pro.Binance;
// Public WebSocket
var exchange = new Binance();
// Private WebSocket (with authentication)
Map<String, Object> config = new HashMap<>();
config.put("apiKey", "YOUR_API_KEY");
config.put("secret", "YOUR_SECRET");
var exchange = new Binance(config);Dynamic Instantiation (generic, untyped)
import io.github.ccxt.Exchange;
// Returns Exchange type - no typed methods, but works for any exchange
Exchange exchange = Exchange.dynamicallyCreateInstance("binance", config);
Object ticker = exchange.fetchTicker("BTC/USDT").join(); // untyped, returns CompletableFutureCommon REST Operations
Loading Markets
// Load all available trading pairs (typed)
Map<String, MarketInterface> markets = exchange.loadMarkets(false);
// Access market information
MarketInterface btcMarket = markets.get("BTC/USDT");
System.out.println(btcMarket.base); // "BTC"
System.out.println(btcMarket.quote); // "USDT"
System.out.println(btcMarket.active); // trueFetching Ticker
// Single ticker (typed)
Ticker ticker = exchange.fetchTicker("BTC/USDT");
System.out.println(ticker.last); // Last price
System.out.println(ticker.bid); // Best bid
System.out.println(ticker.ask); // Best ask
System.out.println(ticker.baseVolume); // 24h volume
// Async variant
CompletableFuture<Ticker> future = exchange.fetchTickerAsync("BTC/USDT", null);Fetching Order Book
// Full orderbook (typed)
OrderBook orderbook = exchange.fetchOrderBook("BTC/USDT", null, null);
System.out.println(orderbook.bids.get(0)); // [price, amount]
System.out.println(orderbook.asks.get(0)); // [price, amount]
// Limited depth
OrderBook orderbook = exchange.fetchOrderBook("BTC/USDT", 5L, null);Fetching Trades
// Recent public trades (typed)
List<Trade> trades = exchange.fetchTrades("BTC/USDT");
for (Trade t : trades) {
System.out.println(t.datetime + " " + t.side + " " + t.price + " x " + t.amount);
}
// With optional params (pass null to skip)
List<Trade> trades = exchange.fetchTrades("BTC/USDT", null, 20L, null);Fetching OHLCV (Candlesticks)
List<OHLCV> candles = exchange.fetchOHLCV("BTC/USDT", "1h", null, 10L, null);
for (OHLCV c : candles) {
System.outRead more
name: ccxt-java description: CCXT cryptocurrency exchange library for Java developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Java projects. Use when working with crypto exchanges in Java applications, trading systems, or financial software. Requires Java 21+.
CCXT for Java
A comprehensive guide to using CCXT in Java projects for cryptocurrency exchange integration.
Installation
Via Gradle
// build.gradle
repositories {
mavenCentral()
}
dependencies {
implementation 'io.github.ccxt:ccxt:latest.release'
}Via Maven
<dependency>
<groupId>io.github.ccxt</groupId>
<artifactId>ccxt</artifactId>
<version>LATEST</version>
</dependency>Requirements
- Java 21 or higher (uses virtual threads)
Quick Start
REST API
import io.github.ccxt.exchanges.Binance;
import io.github.ccxt.types.Ticker;
Binance exchange = new Binance();
exchange.loadMarkets(false);
Ticker ticker = exchange.fetchTicker("BTC/USDT");
System.out.println(ticker.last);WebSocket API - Real-time Updates
import io.github.ccxt.exchanges.pro.Binance;
var exchange = new Binance();
exchange.loadMarkets(false);
while (true) {
Ticker ticker = exchange.watchTicker("BTC/USDT"); // typed sync, blocks for one update
System.out.println(ticker.last);
}Architecture: Typed Subclasses
Each exchange has two classes following the Go pattern:
- `BinanceCore` - transpiled untyped class (internal, extends `BinanceApi` extends `Exchange`)
- `Binance` - typed wrapper extending Core with typed overloads (user-facing)
// User-facing typed class (recommended)
Binance exchange = new Binance();
Ticker ticker = exchange.fetchTicker("BTC/USDT"); // returns Ticker
List<Trade> trades = exchange.fetchTrades("BTC/USDT"); // returns List<Trade>
// Exchange-specific implicit API methods are also accessible
Object raw = exchange.publicGetTicker24hr(params).join(); // Binance-specific endpoint
// Properties accessible directly
exchange.apiKey = "...";
exchange.secret = "...";The typed methods use Java method overloading. They coexist safely with untyped methods because Java resolves overloads at compile time: `BinanceCore.java` is compiled without knowledge of `Binance.java`'s typed overloads, so internal calls always bind to untyped varargs.
REST vs WebSocket
| Feature | REST API | WebSocket API | |---------|----------|---------------| | **Use for** | One-time queries, placing orders | Real-time monitoring, live price feeds | | **Import** | `io.github.ccxt.exchanges.Binance` | `io.github.ccxt.exchanges.pro.Binance` | | **Methods** | `fetch*` (fetchTicker, fetchOrderBook) | `watch*` (watchTicker, watchOrderBook) | | **Returns** | Typed objects (Ticker, List\<Trade\>) | `CompletableFuture<Object>` (call `.join()`) | | **Speed** | Slower (HTTP request/response) | Faster (persistent connection) | | **Rate limits** | Strict (1-2 req/sec) | More lenient (continuous stream) | | **Best for** | Trading, account management | Price monitoring, arbitrage detection |
Creating Exchange Instance
REST API
import io.github.ccxt.exchanges.Binance;
import java.util.Map;
import java.util.HashMap;
// Public API (no authentication)
Binance exchange = new Binance();
// Private API (with authentication)
Map<String, Object> config = new HashMap<>();
config.put("apiKey", "YOUR_API_KEY");
config.put("secret", "YOUR_SECRET");
Binance exchange = new Binance(config);WebSocket API
import io.github.ccxt.exchanges.pro.Binance;
// Public WebSocket
var exchange = new Binance();
// Private WebSocket (with authentication)
Map<String, Object> config = new HashMap<>();
config.put("apiKey", "YOUR_API_KEY");
config.put("secret", "YOUR_SECRET");
var exchange = new Binance(config);Dynamic Instantiation (generic, untyped)
import io.github.ccxt.Exchange;
// Returns Exchange type - no typed methods, but works for any exchange
Exchange exchange = Exchange.dynamicallyCreateInstance("binance", config);
Object ticker = exchange.fetchTicker("BTC/USDT").join(); // untyped, returns CompletableFutureCommon REST Operations
Loading Markets
// Load all available trading pairs (typed)
Map<String, MarketInterface> markets = exchange.loadMarkets(false);
// Access market information
MarketInterface btcMarket = markets.get("BTC/USDT");
System.out.println(btcMarket.base); // "BTC"
System.out.println(btcMarket.quote); // "USDT"
System.out.println(btcMarket.active); // trueFetching Ticker
// Single ticker (typed)
Ticker ticker = exchange.fetchTicker("BTC/USDT");
System.out.println(ticker.last); // Last price
System.out.println(ticker.bid); // Best bid
System.out.println(ticker.ask); // Best ask
System.out.println(ticker.baseVolume); // 24h volume
// Async variant
CompletableFuture<Ticker> future = exchange.fetchTickerAsync("BTC/USDT", null);Fetching Order Book
// Full orderbook (typed)
OrderBook orderbook = exchange.fetchOrderBook("BTC/USDT", null, null);
System.out.println(orderbook.bids.get(0)); // [price, amount]
System.out.println(orderbook.asks.get(0)); // [price, amount]
// Limited depth
OrderBook orderbook = exchange.fetchOrderBook("BTC/USDT", 5L, null);Fetching Trades
// Recent public trades (typed)
List<Trade> trades = exchange.fetchTrades("BTC/USDT");
for (Trade t : trades) {
System.out.println(t.datetime + " " + t.side + " " + t.price + " x " + t.amount);
}
// With optional params (pass null to skip)
List<Trade> trades = exchange.fetchTrades("BTC/USDT", null, 20L, null);Fetching OHLCV (Candlesticks)
List<OHLCV> candles = exchange.fetchOHLCV("BTC/USDT", "1h", null, 10L, null);
for (OHLCV c : candles) {
System.outA crypto trading API with more than 100 exchanges and prediction markets in JavaScript / TypeScript / Python / C# / PHP / Go / Java / Rust.
Other skills on ccxt.
More skills from other plugins.
3-statement-model
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…
3-statement-model
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…
eli5
Explain a topic like I'm a 5 year old. Use when the user types /eli5 <topic> or asks for a dead-simple picture explainer of how…
Questions about ccxt-java.
- Which coding agents can use ccxt-java?
- ccxt-java installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

