Langsung ke konten
Skillpedia
API & server (backend)45k Β· #6379

ccxt-cli

Fungsinya

Skill ini menunjukkan cara memakai alat baris perintah ccxt untuk memanggil fungsi bursa dari terminal, tanpa menulis kode. Skill ini ditujukan untuk orang yang ingin akses cepat ke data atau tindakan bursa.

Kapan dipakai

  • βœ“Saat Anda ingin memeriksa harga kripto atau buku order dari terminal.
  • βœ“Saat Anda ingin melihat saldo bursa atau order yang masih terbuka.
  • βœ“Saat Anda ingin memantau ticker atau buku order secara langsung di terminal.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/ccxt/ccxt/blob/master/.claude/skills/ccxt-cli/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTampilkan ticker Bitcoin saat ini di Kraken dari terminal saya.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Anda mengetik perintah dengan nama bursa dan metodenya, misalnya pencarian ticker. Alat memanggil bursa dan mencetak hasilnya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum

Bagaimana cara memasangnya?

Skill menyebutkan untuk memasang paket ccxt-cli dari npm secara global, yang menyediakan perintah ccxt.

Apakah saya memerlukan API key?

Data publik tidak memerlukan key, tetapi data pribadi seperti saldo memerlukan API key.

Apakah ada cara aman untuk menguji order?

Skill merekomendasikan opsi sandbox dan jumlah kecil saat memasang order.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
45k
Peringkat
#6379
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa