LinuxCommandLibrary

ccxt

cryptocurrency exchange trading CLI

TLDR

Fetch the order book for a trading pair

$ ccxt [binance] fetchOrderBook [BTC/USDT]
copy
Fetch recent trades for a market
$ ccxt [okx] fetchTrades [ETH/USDT]
copy
Fetch all tickers in table format
$ ccxt [bitget] fetchTickers --table
copy
Fetch account balance (requires API keys)
$ ccxt [bybit] fetchBalance
copy
Display available markets on an exchange
$ ccxt [gate] markets
copy
Create a limit order (requires API keys)
$ ccxt [binance] createOrder [BTC/USDT] limit buy [0.001] [50000]
copy
Use sandbox mode for testing
$ ccxt [okx] fetchTicker [BTC/USDT] --sandbox
copy
Get help on a method
$ ccxt explain createOrder
copy

SYNOPSIS

ccxt exchangeid [method] [arguments...] [OPTIONS_]

DESCRIPTION

CCXT (CryptoCurrency eXchange Trading) CLI is a command-line interface for interacting with over 100 cryptocurrency exchanges using the CCXT library. It allows fetching market data, checking balances, placing orders, and more without writing code.
The CLI supports both public APIs (no authentication needed) and private APIs (requiring API keys). Credentials can be provided via environment variables (e.g., BINANCEAPIKEY, BINANCESECRET) or a keys.local.json configuration file.
Output is JSON by default and can be piped to tools like jq for processing. The --table option provides human-readable formatted output.

PARAMETERS

--table

Format output as a readable table instead of JSON.
--raw
Output raw JSON without formatting.
--sandbox
Use the exchange's sandbox/testnet environment.

CONFIGURATION

keys.local.json

Stores API keys and secrets for exchange authentication. Located in the working directory.

COMMANDS

exchangeid_

The exchange to connect to (e.g., binance, okx, bybit, kraken, coinbase).
exchangeid_ markets
List all available markets on the exchange.
exchangeid_ currencies
Show available currencies and their properties.
exchangeid **fetchTicker** symbol_
Fetch current ticker data for a trading pair.
exchangeid **fetchOrderBook** symbol_
Fetch the order book for a trading pair.
exchangeid **fetchTrades** symbol_
Fetch recent trades for a market.
exchangeid **fetchOHLCV** symbol timeframe_
Fetch candlestick/OHLCV data.
exchangeid_ fetchBalance
Fetch account balance (requires authentication).
exchangeid **createOrder** symbol type side amount [price_]
Create a new order (requires authentication).
explain method
Show required arguments for a method.

CAVEATS

The CLI executes commands immediately without confirmation. Confusing amounts with prices can cause loss of funds. CCXT is non-custodian software—it does not hold funds but provides direct API access to exchanges. Always test with sandbox mode or small amounts first. Rate limits and API restrictions vary by exchange.

HISTORY

CCXT was created to provide a unified API across cryptocurrency exchanges, abstracting away differences between exchange APIs. The project started around 2017 and has grown to support over 100 exchanges. It is available as a library for JavaScript, TypeScript, Python, C#, PHP, and Go, with the CLI providing command-line access to the same functionality.

SEE ALSO

curl(1), jq(1), node(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community