Files
2025-10-03 15:28:16 +08:00

304 lines
11 KiB
Markdown

<style>ul { margin-bottom: -10px; }</style>
# [<-](Examples?id=javascript)
# CCXT JavaScript Examples
These examples might require the following super-useful high-quality Node.js modules by [xpl](https://github.com/xpl):
- [ansicolor](https://github.com/xpl/ansicolor): A quality JavaScript library for the ANSI color/style management ([ansicolor @ npm](https://npmjs.com/package/ansicolor))
- [as-table](https://github.com/xpl/as-table): A simple function that prints objects as ASCII tables ([as-table @ npm](https://npmjs.com/package/as-table))
- [ololog](https://github.com/xpl/ololog): Platform-agnostic logging with blackjack and hookers ([ololog @ npm](https://npmjs.com/package/ololog))
All of the modules above are installed with the ccxt library devDependencies by npm automatically.
To run the ccxt JavaScript examples from any folder type in console:
```shell
node path/to/example.js # substitute for actual filename here
```
- [Advanced Error Handling](./examples/js/advanced-error-handling.md)
- [Aggregate Orderbook](./examples/js/aggregate-orderbook.md)
- [Apex Example](./examples/js/apex-example.md)
- [Arbitrage Pairs](./examples/js/arbitrage-pairs.md)
- [Basic Chart](./examples/js/basic-chart.md)
- [Basic Orderbook Polling](./examples/js/basic-orderbook-polling.md)
- [Bcc Vs Bch](./examples/js/bcc-vs-bch.md)
- [Benchmark](./examples/js/benchmark.md)
- [Binance Fetch All Deposits](./examples/js/binance-fetch-all-deposits.md)
- [Binance Fetch Ohlcv Many Symbols Async Await](./examples/js/binance-fetch-ohlcv-many-symbols-async-await.md)
- [Binance Fetch Ohlcv Many Symbols Promise Then Callbacks](./examples/js/binance-fetch-ohlcv-many-symbols-promise-then-callbacks.md)
- [Binance Fetchticker Delivery Vs Future](./examples/js/binance-fetchTicker-delivery-vs-future.md)
- [Binance Futures Transfer From Sub Account To Master](./examples/js/binance-futures-transfer-from-sub-account-to-master.md)
- [Binance Margin Stop Order](./examples/js/binance-margin-stop-order.md)
- [Binance Server Time](./examples/js/binance-server-time.md)
- [Binance Universal Transfer](./examples/js/binance-universal-transfer.md)
- [Bitfinex Fetch Trades](./examples/js/bitfinex-fetch-trades.md)
- [Bitfinex2 Fetch Trades](./examples/js/bitfinex2-fetch-trades.md)
- [Bitmex Browser Cors Proxy](./examples/js/bitmex-browser-cors-proxy.md)
- [Bitpanda Fetchmytrades Reduce](./examples/js/bitpanda-fetchMyTrades-reduce.md)
- [Bitrue Fetch Balance](./examples/js/bitrue-fetch-balance.md)
- [Bitstamp Private Api](./examples/js/bitstamp-private-api.md)
- [Bitstamp Public Api](./examples/js/bitstamp-public-api.md)
- [Bittrex Balance](./examples/js/bittrex-balance.md)
- [Bittrex Fetch Closed Orders History](./examples/js/bittrex-fetch-closed-orders-history.md)
- [Blockchaincom Withdrawal](./examples/js/blockchaincom-withdrawal.md)
- [Build Ohlcv Bars](./examples/js/build-ohlcv-bars.md)
- [Builtin Rate Limiting Rest Poller](./examples/js/builtin-rate-limiting-rest-poller.md)
- [Bybit Trailing](./examples/js/bybit-trailing.md)
- [Bybit Updated](./examples/js/bybit-updated.md)
- [Coinbase Fetch All Balances](./examples/js/coinbase-fetch-all-balances.md)
- [Coinex Fetch All Deposit Addresses Using Fetchdepositaddress](./examples/js/coinex-fetch-all-deposit-addresses-using-fetchDepositAddress.md)
- [Coinex Futures](./examples/js/coinex-futures.md)
- [Coinone Fetch Tickers](./examples/js/coinone-fetch-tickers.md)
- [Coinone Markets](./examples/js/coinone-markets.md)
- [Compare Two Exchanges Capabilities](./examples/js/compare-two-exchanges-capabilities.md)
- [Cors Proxy](./examples/js/cors-proxy.md)
- [Create Order Handle Errors](./examples/js/create-order-handle-errors.md)
- [Create Order Position With Takeprofit Stoploss](./examples/js/create-order-position-with-takeprofit-stoploss.md)
- [Create Order With Retry](./examples/js/create-order-with-retry.md)
- [Create Order Ws Example](./examples/js/create-order-ws-example.md)
- [Create Orders Example](./examples/js/create-orders-example.md)
- [Create Trailing Amount Order](./examples/js/create-trailing-amount-order.md)
- [Create Trailing Percent Order](./examples/js/create-trailing-percent-order.md)
- [Credentials](./examples/js/credentials.md)
- [Custom Proxy Agent For Js](./examples/js/custom-proxy-agent-for-js.md)
- [Custom Proxy Url](./examples/js/custom-proxy-url.md)
- [Delta Maintenance Margin Rate Max Leverage](./examples/js/delta-maintenance-margin-rate-max-leverage.md)
- [Env Variables](./examples/js/env-variables.md)
- [Error Handling](./examples/js/error-handling.md)
- [Exchange Capabilities](./examples/js/exchange-capabilities.md)
- [Exchanges By Volume](./examples/js/exchanges-by-volume.md)
- [Exchanges](./examples/js/exchanges.md)
- [Fetch All Balances](./examples/js/fetch-all-balances.md)
- [Fetch All Tickers To Files 2](./examples/js/fetch-all-tickers-to-files-2.md)
- [Fetch All Tickers To Files](./examples/js/fetch-all-tickers-to-files.md)
- [Fetch Balance](./examples/js/fetch-balance.md)
- [Fetch Create Deposit Address](./examples/js/fetch-create-deposit-address.md)
- [Fetch First Ohlcv Timestamp](./examples/js/fetch-first-ohlcv-timestamp.md)
- [Fetch From Many Exchanges Simultaneously](./examples/js/fetch-from-many-exchanges-simultaneously.md)
- [Fetch Funding Rate History](./examples/js/fetch-funding-rate-history.md)
- [📂 Fetch Futures](https://github.com/ccxt/ccxt/tree/master/./examples/js/fetch-futures)
- [Fetch Ohlcv From To Mark Index Premium](./examples/js/fetch-ohlcv-from-to-mark-index-premium.md)
- [Fetch Ohlcv Many Exchanges Continuosly](./examples/js/fetch-ohlcv-many-exchanges-continuosly.md)
- [Fetch Ohlcv](./examples/js/fetch-ohlcv.md)
- [Fetch Okex Futures](./examples/js/fetch-okex-futures.md)
- [Fetch Orders](./examples/js/fetch-orders.md)
- [Fetch Ticker From Multiple Exchanges](./examples/js/fetch-ticker-from-multiple-exchanges.md)
- [Fetch Ticker Where Available](./examples/js/fetch-ticker-where-available.md)
- [📂 Fetch Tickers](https://github.com/ccxt/ccxt/tree/master/./examples/js/fetch-tickers)
- [Gateio Create Batch Order](./examples/js/gateio-create-batch-order.md)
- [Gateio Futures](./examples/js/gateio-futures.md)
- [Gateio Open Close Contract](./examples/js/gateio-open-close-contract.md)
- [Gateio Swaps](./examples/js/gateio-swaps.md)
- [Gdax Fetch Trades Pagination](./examples/js/gdax-fetch-trades-pagination.md)
- [Hibachi Example](./examples/js/hibachi-example.md)
- [Hitbtc2 Withdraw](./examples/js/hitbtc2-withdraw.md)
- [How To Import One Exchange Esm](./examples/js/how-to-import-one-exchange-esm.md)
- [Huobi Futures](./examples/js/huobi-futures.md)
- [Huobi Open Close Contract](./examples/js/huobi-open-close-contract.md)
- [Huobi Swaps](./examples/js/huobi-swaps.md)
- [Huobipro Market Buy Sell Fetch Trading Limits](./examples/js/huobipro-market-buy-sell-fetch-trading-limits.md)
- [Hybridcjsexample](./examples/js/hybridCJSExample.md)
- [Hybridesmexample](./examples/js/hybridESMExample.md)
- [Idex Fetch Balance](./examples/js/idex-fetch-balance.md)
- [Instantiate All At Once](./examples/js/instantiate-all-at-once.md)
- [Instantiate All From Json](./examples/js/instantiate-all-from-json.md)
- [Kraken Create And Close Position](./examples/js/kraken-create-and-close-position.md)
- [Kraken Fetch Order Trades](./examples/js/kraken-fetch-order-trades.md)
- [Kraken Margin Trading](./examples/js/kraken-margin-trading.md)
- [Kucoin Rate Limit](./examples/js/kucoin-rate-limit.md)
- [Latoken Example](./examples/js/latoken-example.md)
- [Live Orderbook](./examples/js/live-orderbook.md)
- [Live Ticker](./examples/js/live-ticker.md)
- [Live Tickers](./examples/js/live-tickers.md)
- [Load All Contracts](./examples/js/load-all-contracts.md)
- [Load All Symbols At Once](./examples/js/load-all-symbols-at-once.md)
- [Load All Tickers At Once](./examples/js/load-all-tickers-at-once.md)
- [Load Markets To Files](./examples/js/load-markets-to-files.md)
- [Looping Over All Symbols Of Specific Exchanges](./examples/js/looping-over-all-symbols-of-specific-exchanges.md)
- [Looping Over Specific Symbols Of All Exchanges](./examples/js/looping-over-specific-symbols-of-all-exchanges.md)
- [Margin Loan Borrow Buy Sell Repay](./examples/js/margin-loan-borrow-buy-sell-repay.md)
- [Market Status And Currency Status](./examples/js/market-status-and-currency-status.md)
- [Ohlcv Console Chart](./examples/js/ohlcv-console-chart.md)
- [Okex Fetch Closed Orders Archive](./examples/js/okex-fetch-closed-orders-archive.md)
- [Okex Transfer](./examples/js/okex-transfer.md)
- [Okx Poll Fetch My Trades](./examples/js/okx-poll-fetch-my-trades.md)
- [Okx Poll Rate Limit](./examples/js/okx-poll-rate-limit.md)
- [Order Book Extra Level Depth Param](./examples/js/order-book-extra-level-depth-param.md)
- [Phemex Create Order Position With Takeprofit Stoploss](./examples/js/phemex-create-order-position-with-takeprofit-stoploss.md)
- [Poll Ohlcv](./examples/js/poll-ohlcv.md)
- [Poloniex Fetch Order Books](./examples/js/poloniex-fetch-order-books.md)
- [Poloniex Limits Amount Min](./examples/js/poloniex-limits-amount-min.md)
- [Proxy Round Robin](./examples/js/proxy-round-robin.md)
- [Proxy Usage](./examples/js/proxy-usage.md)
- [Sample Local Proxy Server With Cors](./examples/js/sample-local-proxy-server-with-cors.md)
- [Search All Exchanges](./examples/js/search-all-exchanges.md)
- [Shared Load Markets](./examples/js/shared-load-markets.md)
- [Sort Swap Markets By Hourly Price Change](./examples/js/sort-swap-markets-by-hourly-price-change.md)
- [Symbols](./examples/js/symbols.md)
- [Theocean](./examples/js/theocean.md)
- [Tickers](./examples/js/tickers.md)
- [Validate Paginated Data](./examples/js/validate-paginated-data.md)
- [Watch Ohlcv For Symbols](./examples/js/watch-OHLCV-For-Symbols.md)
- [Watch Ohlcv](./examples/js/watch-OHLCV.md)
- [Watch Orderbook For Symbols](./examples/js/watch-OrderBook-For-Symbols.md)
- [Watch Trades For Symbols](./examples/js/watch-Trades-For-Symbols.md)
- [Watch Tickers](./examples/js/watch-tickers.md)
- [Watchohlcvforsymbols](./examples/js/watchOHLCVForSymbols.md)
- [Watchorderbookforsymbols](./examples/js/watchOrderBookForSymbols.md)
- [Watchpositions Many Exchanges Continuosly.d](./examples/js/watchPositions-many-exchanges-continuosly.d.md)
- [Watchpositions Many Exchanges Continuosly.d.ts](./examples/js/watchPositions-many-exchanges-continuosly.d.ts.md)
- [Watchpositions Many Exchanges Continuosly](./examples/js/watchPositions-many-exchanges-continuosly.md)
- [Watchpositions.d](./examples/js/watchPositions.d.md)
- [Watchpositions.d.ts](./examples/js/watchPositions.d.ts.md)
- [Watchpositions](./examples/js/watchPositions.md)
- [Watchpositionsforsymbols.d](./examples/js/watchPositionsForSymbols.d.md)
- [Watchpositionsforsymbols.d.ts](./examples/js/watchPositionsForSymbols.d.ts.md)
- [Watchpositionsforsymbols](./examples/js/watchPositionsForSymbols.md)
- [Watchtradesforsymbols](./examples/js/watchTradesForSymbols.md)
- [Withdraw From One Exchange To Another](./examples/js/withdraw-from-one-exchange-to-another.md)