Aller au contenu
Skillpedia
API et serveurs (backend)45k · #6379

ccxt-cli

Ce qu’il fait

Cette skill montre comment utiliser l'outil en ligne de commande ccxt pour appeler les fonctions des plateformes d'échange depuis un terminal, sans écrire de code. Elle s'adresse aux personnes qui veulent un accès rapide aux données ou aux opérations d'une plateforme.

Quand l’utiliser

  • ✓Quand vous voulez consulter le cours d'une cryptomonnaie ou le carnet d'ordres depuis le terminal.
  • ✓Quand vous voulez voir votre solde sur une plateforme ou vos ordres ouverts.
  • ✓Quand vous voulez suivre en direct les cotations ou les carnets d'ordres dans un terminal.

Lien du skill

https://github.com/ccxt/ccxt/blob/master/.claude/skills/ccxt-cli/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/ccxt/ccxt/blob/master/.claude/skills/ccxt-cli/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Pouvez-vous me montrer la cotation actuelle du Bitcoin sur Kraken depuis mon terminal ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Vous saisissez une commande avec le nom de la plateforme et la méthode, par exemple une recherche de cotation. L'outil appelle la plateforme et affiche le résultat.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

CCXT CLI

The CCXT CLI (ccxt-cli on npm) exposes the entire unified CCXT API as a terminal command. Anything you can call in code — fetchTicker, fetchOHLCV, createOrder, fetchBalance, withdraw, exchange-specific implicit methods — you can call as:

ccxt <exchangeId> <methodName> [args...] [options]

It supports 100+ exchanges, REST and WebSocket, public and private endpoints, live terminal dashboards, and interactive OHLCV charts.

Installation

npm install -g ccxt-cli     # installs the `ccxt` command
ccxt --help

One-off use without installing (note -p ccxt-cli — the package name differs from the binary name):

npx -y -p ccxt-cli ccxt kraken fetchTicker BTC/USD

From a clone of the CCXT repository (contributor mode — uses the local source tree instead of the published package):

npm run cli.ts -- kraken fetchTicker BTC/USD    # runs cli/ts/cli.ts against local ts/

Quick start

# Public data — no API keys needed
ccxt kraken fetchTicker BTC/USD
ccxt kraken fetchOrderBook ETH/BTC
ccxt bybit fetchOHLCV BTC/USDT 15m
ccxt okx fetchTrades BTC/USDT

# Private data — needs API keys (see Authentication)
ccxt kraken fetchBalance
ccxt binance fetchOpenOrders BTC/USDT

# Place an order (start with --sandbox and small amounts!)
ccxt binance createOrder BTC/USDT limit buy 0.001 60000 --sandbox

Every run prints the CCXT version, the resolved call (e.g. kraken.fetchTicker ("BTC/USD")), the result, and timing. Use --raw to suppress everything except the JSON result.

Discovering methods and arguments

ccxt --help                 # all options, commands, and the config path for your OS
ccxt methods kraken         # every method the exchange supports (its `has` capabilities)
ccxt explain createOrder    # required/optional arguments for any unified method
ccxt history                # your previously executed commands

ccxt explain <method> output shows the argument order you must follow:

Method: createOrder
Usage:
  binance createOrder <symbol> <type> <side> <amount> [price] [params]
Arguments:
  - symbol       (required) — Market symbol e.g., BTC/USDT
  - type         (required) — e.g., limit or market
  - side         (required) — order side e.g., buy or sell
  - amount       (required)
  - price        (optional) — Price per unit of asset e.g., 26000.50
  - params       (optional) — Extra parameters for the exchange

Argument rules (important)

Arguments are positional and must follow the method's signature order. The CLI auto-converts each argument:

You type The method receives
BTC/USDT string 'BTC/USDT'
0.001, 100 number
undefined undefined (placeholder to skip an optional arg — the call echo displays it as null, which is expected)
true / false / null boolean / null
"2025-05-01T01:23:45Z" milliseconds timestamp (ISO8601 datetimes auto-convert; date-only strings like 2025-05-01 do NOT — include the time part)
'{"recvWindow":5000}' object (JSON must be shell-quoted)
'["BTC/USDT","ETH/USDT"]' array (shell-quoted)

Rule 1 — pad skipped optionals with undefined. To pass limit without since:

ccxt binance fetchOHLCV BTC/USDT 1h undefined 10    # since=undefined, limit=10

Rule 2 — --param key=value appends to the trailing params object. Repeat it for multiple keys. Values are coerced the same way (true, false, null, numbers, strings):

ccxt binance createOrder BTC/USDT market buy 0.01 undefined --param test=true --param clientOrderId=myOrder

Rule 3 — when using --param, explicitly fill ALL earlier optional positionals with undefined. If you leave gaps, the CLI mis-assigns arguments (a known quirk — the params object can end up in the wrong position). Correct:

ccxt bybit fetchOHLCV BTC/USDT 15m undefined undefined --param until=1722161166530   # ✅
ccxt bybit fetchOHLCV BTC/USDT --param until=1722161166530                           # ❌ args get scrambled

Authentication

Private methods (fetchBalance, createOrder, fetchMyTrades, ...) need credentials. Three sources:

1. Environment variables

Pattern: <EXCHANGEID>_<CREDENTIAL> upper-cased. The credential names come from each exchange's requiredCredentials (apiKey, secret, password, uid, walletAddress, privateKey, ...):

export BINANCE_APIKEY=your_api_key
export BINANCE_SECRET=your_s
Questions fréquentes

Comment l'installer ?

La skill indique d'installer le paquet ccxt-cli depuis npm en global, ce qui fournit la commande ccxt.

Ai-je besoin de clés API ?

Les données publiques n'en exigent pas, mais les données privées comme les soldes en nécessitent.

Existe-t-il un moyen sûr de tester les ordres ?

La skill recommande l'option sandbox et de petits montants lors du passage d'ordres.

Détails

Description originale de l’auteur

CCXT command-line interface (ccxt-cli) for interacting with 100+ cryptocurrency exchanges directly from the terminal — no code required. Covers installing the CLI, calling any unified CCXT method (fetchTicker, fetchOHLCV, createOrder, fetchBalance), passing arguments and exchange-specific params, authenticating with API keys, sandbox/testnet mode, streaming live tickers and orderbooks over WebSocket, plotting OHLCV charts, and scripting with raw JSON output. Use when the user wants to query an exchange, test API credentials, place or inspect orders, or debug exchange requests from the command

repo: ccxt/ccxt

Popularité

Étoiles GitHub
45k
Position au classement
#6379
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires