The CCXT CLI is a lightweight command-line tool that enables you to interact directly with any supported cryptocurrency exchange using the CCXT library. It provides a convenient way to perform tasks such as checking balances, placing orders, and fetching market data — all from the terminal, with no need to write custom scripts.
- Interact with any exchange supported by CCXT
- Call any CCXT method directly from the CLI
- Send authenticated requests (using API keys)
- Perform quick actions like fetching balances, trades, tickers, order books, and more
- Plot interactive OHLCV charts
- Render live ticker/orderbook updates from one or more exchanges
You can install the CLI globally with npm.
npm install -g ccxt-cliccxt-demo-new.mp4
ccxt <exchange_id> <methodName> [...args] # if you're not sure about the args, use the `ccxt explain methodName` commandYou can get a quick overview by using the --help flag:
ccxt --help<exchange_id>: The ID of the exchange (e.g.,binance,kraken,coinbasepro)<methodName>: Any method name available in the CCXT API (e.g.,fetchBalance,createOrder,fetchTrades)args: Any required method parameters
To use private methods (e.g., fetchBalance, createOrder), you must provide API credentials. The CLI supports credentials via environment variables or config files.
export BINANCE_APIKEY=your_api_key
export BINANCE_SECRET=your_secretInside $CACHE/ccxt-cli/config.json you can add an object with the exchangeId as the key and apikeys/options inside.
{
"binance": {
"apiKey": "your apiKey here",
"secret": "your secret here",
"options": {
"customOptionKey": "customOptionValue"
}
}
}$CACHE varies from OS to OS but by doing --help you can see which path is being used. You can also use the config command to set a different path for the config file.
You can generate and open interactive candlestick charts with volume in your browser using:
ccxt ohlcv binance BTC/USDT 1h- Uses
fetchOHLCVfrom the exchange's REST API - Automatically generates a self-contained HTML file
🔍 Ideal for visualizing recent price action.
You can stream live ticker updates (websockets) from one or more exchanges:
ccxt ticker binance BTC/USDT
ccxt ticker binance,bybit,okx BTC/USDTRender a live orderbook (websockets) for one or more exchanges:
ccxt orderbook binance BTC/USDT
ccxt orderbook binance,bybit,okx BTC/USDTccxt binance fetchOHLCV BTC/USDT 1h undefined 10 # we don't want to provide since but we want limit so undefined is provided as the placeholder for sinceccxt kraken fetchBalanceccxt binance createOrder BTC/USDT market buy 0.01ccxt coinbasepro fetchMyTrades BTC/USDccxt binance createOrder "BTC/USDT" market buy 0.01 undefined --param test=true --param clientOrderId=myOrderId # undefined is the place holder for priceccxt binance fetchBalance --swapIf you are not sure which arguments should be provided you can always use the explain command.
ccxt explain createOrder
Result:
Method: createOrder
Usage:
binance createOrder <symbol> <type> <side> <amount> [price] [params]
Arguments:
- symbol (required) — Market symbol e.g., BTC/USDT
- type (required) — (no description available)
- side (required) — order side e.g., buy or sell
- amount (required) — (no description available)
- price (optional) — Price per unit of asset e.g., 26000.50
- params (optional) — Extra parameters for the exchange e.g., { "recvWindow": 5000 }
If you don't want to provide a value for an optional argument, you should still provide undefined as the "placeholder".
- CLI supports automatic conversions from ISO8601 datetime to milliseconds, users can specify datetimes in command-line arguments in ISO8601 format in quotes like
"2025-05-01T01:23:45Z"(where a method argument requires milliseconds) - Use
--verboseflag to inspect raw request/response data. - Use
--sandboxto place the request using the testnet/sandbox environment - Always test with small amounts when placing orders.
- Use
ccxt explain createOrderto view the required arguments for createOrder or any other method - Use
--param keyA=valueA keyB=valueB ...to provide theparamsargument. - Arguments must follow the correct order. Use
undefinedto skip optional values
- Full CCXT API Reference: https://docs.ccxt.com
- Supported Exchanges: https://github.com/ccxt/ccxt#supported-cryptocurrency-exchange-markets
We’d love to hear from you! Open an issue or suggestion on GitHub and help us improve the CLI for everyone.
Use this CLI at your own risk. Trading cryptocurrencies involves substantial risk. Always ensure your API keys are protected and never share them.
MIT — © [CCXT]


