Home
Softono
c

ccxt

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
5

Software by ccxt

ccxt
Open Source

ccxt

# CCXT – CryptoCurrency eXchange Trading Library [![NPM Downloads](https://img.shields.io/npm/dy/ccxt.svg)](https://www.npmjs.com/package/ccxt) [![npm](https://img.shields.io/npm/v/ccxt.svg)](https://npmjs.com/package/ccxt) [![PyPI](https://img.shields.io/pypi/v/ccxt.svg)](https://pypi.python.org/pypi/ccxt) [![NuGet version](https://img.shields.io/nuget/v/ccxt)](https://www.nuget.org/packages/ccxt) [![GoDoc](https://pkg.go.dev/badge/github.com/ccxt/ccxt/go/v4?utm_source=godoc)](https://godoc.org/github.com/ccxt/ccxt/go/v4) [![Mvn](https://badges.mvnrepository.com/badge/io.github.ccxt/ccxt/badge.svg?label=Mvn)](https://mvnrepository.com/artifact/io.github.ccxt/ccxt) [![Discord](https://img.shields.io/discord/690203284119617602?logo=discord&logoColor=white)](https://discord.gg/ccxt) [![Supported Exchanges](https://img.shields.io/badge/exchanges-110-blue.svg)](https://github.com/ccxt/ccxt/wiki/Exchange-Markets) [![Follow CCXT at x.com](https://img.shields.io/twitter/follow/ccxt_official.svg?style=social&label=CCXT)](https://x.com/ccxt_official) A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go / Java. ### [Install](#install) · [Usage](#usage) · [Manual](https://github.com/ccxt/ccxt/wiki) · [FAQ](https://github.com/ccxt/ccxt/wiki/FAQ) · [Examples](https://github.com/ccxt/ccxt/tree/master/examples) · [Contributing](https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md) · [Disclaimer](#disclaimer) · [Social](#social) The **CCXT** library is used to connect and trade with cryptocurrency exchanges and payment processing services worldwide. It provides quick access to market data for storage, analysis, visualization, indicator development, algorithmic trading, strategy backtesting, bot programming, and related software engineering. It is intended to be used by **coders, developers, technically-skilled traders, data-scientists and financial analysts** for building trading algorithms. Current feature list: - support for many cryptocurrency exchanges — more coming soon - fully implemented public and private APIs - optional normalized data for cross-exchange analytics and arbitrage - an out of the box unified API that is extremely easy to integrate - works in Node 10.4+, Python 3, PHP 8.1+, netstandard2.0/2.1, Go 1.20+, Java 21+ and web browsers ## See Also - <sub>[![Freqtrade](https://user-images.githubusercontent.com/1294454/114340585-8e35fa80-9b60-11eb-860f-4379125e2db6.png)](https://www.freqtrade.io)</sub> **[Freqtrade](https://www.freqtrade.io)** – leading opensource cryptocurrency algorithmic trading software! - <sub>[![OctoBot](https://user-images.githubusercontent.com/1294454/132113722-007fc092-7530-4b41-b929-b8ed380b7b2e.png)](https://www.octobot.online)</sub> **[OctoBot](https://www.octobot.online)** – cryptocurrency trading bot with an advanced web interface. - <sub>[![TokenBot](https://user-images.githubusercontent.com/1294454/152720975-0522b803-70f0-4f18-a305-3c99b37cd990.png)](https://tokenbot.com/?utm_source=github&utm_medium=ccxt&utm_campaign=algodevs)</sub> **[TokenBot](https://tokenbot.com/?utm_source=github&utm_medium=ccxt&utm_campaign=algodevs)** – discover and copy the best algorithmic traders in the world. ## Certified Cryptocurrency Exchanges |logo |id |name |ver |type |certified |pro |discount | |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|-----------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------:|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [![binance](https://github.com/user-attachments/assets/e9419b93-ccb0-46aa-9bff-c883f096274b)](https://accounts.binance.com/register?ref=CCXTCOM) | binance | [Binance](https://accounts.binance.com/register?ref=CCXTCOM) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://developers.binance.com/en) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with Binance using CCXT's referral link for a 10% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d10%25&color=orange)](https://accounts.binance.com/register?ref=CCXTCOM) | | [![binanceusdm](https://github.com/user-attachments/assets/871cbea7-eebb-4b28-b260-c1c91df0487a)](https://accounts.binance.com/register?ref=CCXTCOM) | binanceusdm | [Binance USDⓈ-M](https://accounts.binance.com/register?ref=CCXTCOM) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://binance-docs.github.io/apidocs/futures/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with Binance USDⓈ-M using CCXT's referral link for a 10% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d10%25&color=orange)](https://accounts.binance.com/register?ref=CCXTCOM) | | [![binancecoinm](https://github.com/user-attachments/assets/387cfc4e-5f33-48cd-8f5c-cd4854dabf0c)](https://accounts.binance.com/register?ref=CCXTCOM) | binancecoinm | [Binance COIN-M](https://accounts.binance.com/register?ref=CCXTCOM) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://binance-docs.github.io/apidocs/delivery/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with Binance COIN-M using CCXT's referral link for a 10% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d10%25&color=orange)](https://accounts.binance.com/register?ref=CCXTCOM) | | [![bybit](https://github.com/user-attachments/assets/97a5d0b3-de10-423d-90e1-6620960025ed)](https://www.bybit.com/invite?ref=XDK12WP) | bybit | [Bybit](https://www.bybit.com/invite?ref=XDK12WP) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://bybit-exchange.github.io/docs/inverse/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | | [![okx](https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg)](https://www.okx.com/join/CCXTCOM) | okx | [OKX](https://www.okx.com/join/CCXTCOM) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://www.okx.com/docs-v5/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with OKX using CCXT's referral link for a 20% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d20%25&color=orange)](https://www.okx.com/join/CCXTCOM) | | [![gate](https://github.com/user-attachments/assets/64f988c5-07b6-4652-b5c1-679a6bf67c85)](https://www.gate.com/share/CCXTGATE) | gate | [Gate](https://www.gate.com/share/CCXTGATE) | [![API Version 4](https://img.shields.io/badge/4-lightgray)](https://www.gate.com/docs/developers/apiv4/en) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with Gate using CCXT's referral link for a 20% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d20%25&color=orange)](https://www.gate.com/share/CCXTGATE) | | [![kucoin](https://user-images.githubusercontent.com/51840849/87295558-132aaf80-c50e-11ea-9801-a2fb0c57c799.jpg)](https://www.kucoin.com/ucenter/signup?rcode=E5wkqe) | kucoin | [KuCoin](https://www.kucoin.com/ucenter/signup?rcode=E5wkqe) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.kucoin.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | | [![kucoinfutures](https://user-images.githubusercontent.com/1294454/147508995-9e35030a-d046-43a1-a006-6fabd981b554.jpg)](https://futures.kucoin.com/?rcode=E5wkqe) | kucoinfutures | [KuCoin Futures](https://futures.kucoin.com/?rcode=E5wkqe) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.kucoin.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | | [![bitget](https://github.com/user-attachments/assets/fbaa10cc-a277-441d-a5b7-997dd9a87658)](https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j) | bitget | [Bitget](https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://www.bitget.com/api-doc/common/intro) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | | [![hyperliquid](https://github.com/ccxt/ccxt/assets/43336371/b371bc6c-4a8c-489f-87f4-20a913dd8d4b)](https://app.hyperliquid.xyz/) | hyperliquid | [Hyperliquid](https://app.hyperliquid.xyz/) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | | [![bitmex](https://github.com/user-attachments/assets/c78425ab-78d5-49d6-bd14-db7734798f04)](https://www.bitmex.com/app/register/NZTR1q) | bitmex | [BitMEX](https://www.bitmex.com/app/register/NZTR1q) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://www.bitmex.com/app/apiOverview) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with BitMEX using CCXT's referral link for a 10% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d10%25&color=orange)](https://www.bitmex.com/app/register/NZTR1q) | | [![bingx](https://github-production-user-asset-6210df.s3.amazonaws.com/1294454/253675376-6983b72e-4999-4549-b177-33b374c195e3.jpg)](https://bingx.com/invite/OHETOM) | bingx | [BingX](https://bingx.com/invite/OHETOM) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://bingx-api.github.io/docs/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | | [![htx](https://user-images.githubusercontent.com/1294454/76137448-22748a80-604e-11ea-8069-6e389271911d.jpg)](https://www.htx.com/invite/en-us/1h?invite_code=6rmm2223) | htx | [HTX](https://www.htx.com/invite/en-us/1h?invite_code=6rmm2223) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://huobiapi.github.io/docs/spot/v1/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with HTX using CCXT's referral link for a 15% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d15%25&color=orange)](https://www.htx.com/invite/en-us/1h?invite_code=6rmm2223) | | [![mexc](https://user-images.githubusercontent.com/1294454/137283979-8b2a818d-8633-461b-bfca-de89e8c446b2.jpg)](https://www.mexc.com/register?inviteCode=mexc-1FQ1GNu1) | mexc | [MEXC Global](https://www.mexc.com/register?inviteCode=mexc-1FQ1GNu1) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://mexcdevelop.github.io/apidocs/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | | [![bitmart](https://github.com/user-attachments/assets/0623e9c4-f50e-48c9-82bd-65c3908c3a14)](http://www.bitmart.com/?r=rQCFLh) | bitmart | [BitMart](http://www.bitmart.com/?r=rQCFLh) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://developer-pro.bitmart.com/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with BitMart using CCXT's referral link for a 30% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d30%25&color=orange)](http://www.bitmart.com/?r=rQCFLh) | | [![cryptocom](https://user-images.githubusercontent.com/1294454/147792121-38ed5e36-c229-48d6-b49a-48d05fc19ed4.jpeg)](https://crypto.com/exch/kdacthrnxt) | cryptocom | [Crypto.com](https://crypto.com/exch/kdacthrnxt) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with Crypto.com using CCXT's referral link for a 75% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d75%25&color=orange)](https://crypto.com/exch/kdacthrnxt) | | [![coinex](https://user-images.githubusercontent.com/51840849/87182089-1e05fa00-c2ec-11ea-8da9-cc73b45abbbc.jpg)](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.coinex.com/api/v2) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | | [![hashkey](https://github.com/user-attachments/assets/6dd6127b-cc19-4a13-9b29-a98d81f80e98)](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | hashkey | [HashKey Global](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://hashkeyglobal-apidoc.readme.io/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | | [![woo](https://user-images.githubusercontent.com/1294454/150730761-1a00e5e0-d28c-480f-9e65-089ce3e6ef3b.jpg)](https://woox.io/register?ref=DIJT0CNL) | woo | [WOO X](https://woox.io/register?ref=DIJT0CNL) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.woox.io/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with WOO X using CCXT's referral link for a 35% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d35%25&color=orange)](https://woox.io/register?ref=DIJT0CNL) | | [![woofipro](https://github.com/user-attachments/assets/9ba21b8a-a9c7-4770-b7f1-ce3bcbde68c1)](https://dex.woo.org/en/trade?ref=CCXT) | woofipro | [WOOFI PRO](https://dex.woo.org/en/trade?ref=CCXT) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://orderly.network/docs/build-on-omnichain/building-on-evm) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | [![Sign up with WOOFI PRO using CCXT's referral link for a 5% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d5%25&color=orange)](https://dex.woo.org/en/trade?ref=CCXT) | ## Supported Cryptocurrency Exchanges <!--- init list -->The CCXT library currently supports the following 108 cryptocurrency exchange markets and trading APIs: |logo |id |name |ver |type |certified |pro | |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|---------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------:|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| | [![aftermath](https://github.com/user-attachments/assets/70e5ae86-2f3a-4755-976b-aedb9d3c2807)](undefined) | aftermath | [AftermathFinance](undefined) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](undefined) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![alpaca](https://github.com/user-attachments/assets/e9476df8-a450-4c3e-ab9a-1a7794219e1b)](https://alpaca.markets) | alpaca | [Alpaca](https://alpaca.markets) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://alpaca.markets/docs/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![apex](https://github.com/user-attachments/assets/fef8f2f7-4265-46aa-965e-33a91881cb00)](https://omni.apex.exchange/trade) | apex | [Apex](https://omni.apex.exchange/trade) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://api-docs.pro.apex.exchange) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![arkham](https://github.com/user-attachments/assets/5cefdcfb-2c10-445b-835c-fa21317bf5ac)](https://arkm.com/register?ref=ccxt) | arkham | [ARKHAM](https://arkm.com/register?ref=ccxt) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://arkm.com/limits-api) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![ascendex](https://github.com/user-attachments/assets/55bab6b9-d4ca-42a8-a0e6-fac81ae557f1)](https://ascendex.com/en-us/register?inviteCode=EL6BXBQM) | ascendex | [AscendEX](https://ascendex.com/en-us/register?inviteCode=EL6BXBQM) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://ascendex.github.io/ascendex-pro-api/#ascendex-pro-api-documentation) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![aster](https://github.com/user-attachments/assets/4982201b-73cd-4d7a-8907-e69e239e9609)](https://www.asterdex.com/en/referral/aA1c2B) | aster | [Aster](https://www.asterdex.com/en/referral/aA1c2B) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://github.com/asterdex/api-docs) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![backpack](https://github.com/user-attachments/assets/cc04c278-679f-4554-9f72-930dd632b80f)](https://backpack.exchange/join/ccxt) | backpack | [Backpack](https://backpack.exchange/join/ccxt) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.backpack.exchange/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bequant](https://github.com/user-attachments/assets/0583ef1f-29fe-4b7c-8189-63565a0e2867)](https://bequant.io/referral/dd104e3bee7634ec) | bequant | [Bequant](https://bequant.io/referral/dd104e3bee7634ec) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://api.bequant.io/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bigone](https://github.com/user-attachments/assets/4e5cfd53-98cc-4b90-92cd-0d7b512653d1)](https://b1.run/users/new?code=D3LLBVFT) | bigone | [BigONE](https://b1.run/users/new?code=D3LLBVFT) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://open.big.one/docs/api.html) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![binance](https://github.com/user-attachments/assets/e9419b93-ccb0-46aa-9bff-c883f096274b)](https://accounts.binance.com/register?ref=CCXTCOM) | binance | [Binance](https://accounts.binance.com/register?ref=CCXTCOM) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://developers.binance.com/en) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![binancecoinm](https://github.com/user-attachments/assets/387cfc4e-5f33-48cd-8f5c-cd4854dabf0c)](https://accounts.binance.com/register?ref=CCXTCOM) | binancecoinm | [Binance COIN-M](https://accounts.binance.com/register?ref=CCXTCOM) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://binance-docs.github.io/apidocs/delivery/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![binanceus](https://github.com/user-attachments/assets/a9667919-b632-4d52-a832-df89f8a35e8c)](https://www.binance.us/?ref=35005074) | binanceus | [Binance US](https://www.binance.us/?ref=35005074) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://github.com/binance-us/binance-official-api-docs) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![binanceusdm](https://github.com/user-attachments/assets/871cbea7-eebb-4b28-b260-c1c91df0487a)](https://accounts.binance.com/register?ref=CCXTCOM) | binanceusdm | [Binance USDⓈ-M](https://accounts.binance.com/register?ref=CCXTCOM) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://binance-docs.github.io/apidocs/futures/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bingx](https://github-production-user-asset-6210df.s3.amazonaws.com/1294454/253675376-6983b72e-4999-4549-b177-33b374c195e3.jpg)](https://bingx.com/invite/OHETOM) | bingx | [BingX](https://bingx.com/invite/OHETOM) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://bingx-api.github.io/docs/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bit2c](https://github.com/user-attachments/assets/db0bce50-6842-4c09-a1d5-0c87d22118aa)](https://bit2c.co.il/Aff/63bfed10-e359-420c-ab5a-ad368dab0baf) | bit2c | [Bit2C](https://bit2c.co.il/Aff/63bfed10-e359-420c-ab5a-ad368dab0baf) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://www.bit2c.co.il/home/api) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![bitbank](https://github.com/user-attachments/assets/9d616de0-8a88-4468-8e38-d269acab0348)](https://bitbank.cc/) | bitbank | [bitbank](https://bitbank.cc/) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.bitbank.cc/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![bitbns](https://github.com/user-attachments/assets/a5b9a562-cdd8-4bea-9fa7-fd24c1dad3d9)](https://ref.bitbns.com/1090961) | bitbns | [Bitbns](https://ref.bitbns.com/1090961) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://bitbns.com/trade/#/api-trading/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![bitfinex](https://github.com/user-attachments/assets/4a8e947f-ab46-481a-a8ae-8b20e9b03178)](https://www.bitfinex.com) | bitfinex | [Bitfinex](https://www.bitfinex.com) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.bitfinex.com/v2/docs/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bitflyer](https://github.com/user-attachments/assets/d0217747-e54d-4533-8416-0d553dca74bb)](https://bitflyer.com) | bitflyer | [bitFlyer](https://bitflyer.com) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://lightning.bitflyer.com/docs?lang=en) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![bitget](https://github.com/user-attachments/assets/fbaa10cc-a277-441d-a5b7-997dd9a87658)](https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j) | bitget | [Bitget](https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://www.bitget.com/api-doc/common/intro) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bithumb](https://github.com/user-attachments/assets/c9e0eefb-4777-46b9-8f09-9d7f7c4af82d)](https://www.bithumb.com) | bithumb | [Bithumb](https://www.bithumb.com) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://apidocs.bithumb.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bitmart](https://github.com/user-attachments/assets/0623e9c4-f50e-48c9-82bd-65c3908c3a14)](http://www.bitmart.com/?r=rQCFLh) | bitmart | [BitMart](http://www.bitmart.com/?r=rQCFLh) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://developer-pro.bitmart.com/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bitmex](https://github.com/user-attachments/assets/c78425ab-78d5-49d6-bd14-db7734798f04)](https://www.bitmex.com/app/register/NZTR1q) | bitmex | [BitMEX](https://www.bitmex.com/app/register/NZTR1q) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://www.bitmex.com/app/apiOverview) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bitopro](https://github.com/user-attachments/assets/affc6337-b95a-44bf-aacd-04f9722364f6)](https://www.bitopro.com) | bitopro | [BitoPro](https://www.bitopro.com) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://github.com/bitoex/bitopro-offical-api-docs/blob/master/v3-1/rest-1/rest.md) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bitrue](https://github.com/user-attachments/assets/67abe346-1273-461a-bd7c-42fa32907c8e)](https://www.bitrue.com/affiliate/landing?cn=600000&inviteCode=EZWETQE) | bitrue | [Bitrue](https://www.bitrue.com/affiliate/landing?cn=600000&inviteCode=EZWETQE) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://github.com/Bitrue-exchange/bitrue-official-api-docs) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bitso](https://github.com/user-attachments/assets/178c8e56-9054-4107-b192-5e5053d4f975)](https://bitso.com/?ref=itej) | bitso | [Bitso](https://bitso.com/?ref=itej) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://bitso.com/api_info) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![bitstamp](https://github.com/user-attachments/assets/d5480572-1fee-43cb-b900-d38c522d0024)](https://www.bitstamp.net) | bitstamp | [Bitstamp](https://www.bitstamp.net) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://www.bitstamp.net/api) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bitteam](https://github.com/user-attachments/assets/b41b5e0d-98e5-4bd3-8a6e-aeb230a4a135)](https://bit.team/auth/sign-up?ref=bitboy2023) | bitteam | [BIT.TEAM](https://bit.team/auth/sign-up?ref=bitboy2023) | [![API Version 2.0.6](https://img.shields.io/badge/2.0.6-lightgray)](https://bit.team/trade/api/documentation) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![bittrade](https://user-images.githubusercontent.com/1294454/85734211-85755480-b705-11ea-8b35-0b7f1db33a2f.jpg)](https://www.bittrade.co.jp/register/?invite_code=znnq3) | bittrade | [BitTrade](https://www.bittrade.co.jp/register/?invite_code=znnq3) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://api-doc.bittrade.co.jp) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bitvavo](https://github.com/user-attachments/assets/d213155c-8c71-4701-9bd5-45351febc2a8)](https://bitvavo.com/?a=24F34952F7) | bitvavo | [Bitvavo](https://bitvavo.com/?a=24F34952F7) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.bitvavo.com/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![blockchaincom](https://github.com/user-attachments/assets/975e3054-3399-4363-bcee-ec3c6d63d4e8)](https://blockchain.com) | blockchaincom | [Blockchain.com](https://blockchain.com) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://api.blockchain.com/v3) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![blofin](https://github.com/user-attachments/assets/518cdf80-f05d-4821-a3e3-d48ceb41d73b)](https://blofin.com/register?referral_code=f79EsS) | blofin | [BloFin](https://blofin.com/register?referral_code=f79EsS) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://blofin.com/docs) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![btcbox](https://github.com/user-attachments/assets/1e2cb499-8d0f-4f8f-9464-3c015cfbc76b)](https://www.btcbox.co.jp/) | btcbox | [BtcBox](https://www.btcbox.co.jp/) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://blog.btcbox.jp/en/archives/8762) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![btcmarkets](https://github.com/user-attachments/assets/8c8d6907-3873-4cc4-ad20-e22fba28247e)](https://btcmarkets.net) | btcmarkets | [BTC Markets](https://btcmarkets.net) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://api.btcmarkets.net/doc/v3) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![btcturk](https://github.com/user-attachments/assets/10e0a238-9f60-4b06-9dda-edfc7602f1d6)](https://www.btcturk.com) | btcturk | [BTCTurk](https://www.btcturk.com) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://github.com/BTCTrader/broker-api-docs) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![bullish](https://github.com/user-attachments/assets/68f0686b-84f0-4da9-a751-f7089af3a9ed)](https://bullish.com/) | bullish | [Bullish](https://bullish.com/) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://api.exchange.bullish.com/docs/api/rest/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bybit](https://github.com/user-attachments/assets/97a5d0b3-de10-423d-90e1-6620960025ed)](https://www.bybit.com/invite?ref=XDK12WP) | bybit | [Bybit](https://www.bybit.com/invite?ref=XDK12WP) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://bybit-exchange.github.io/docs/inverse/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bybiteu](https://github.com/user-attachments/assets/97a5d0b3-de10-423d-90e1-6620960025ed)](https://www.bybit.com/invite?ref=XDK12WP) | bybiteu | [Bybit EU](https://www.bybit.com/invite?ref=XDK12WP) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://bybit-exchange.github.io/docs/inverse/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![bydfi](https://github.com/user-attachments/assets/bfffb73d-29bd-465d-b75b-98e210491769)](https://partner.bydfi.com/j/DilWutCI) | bydfi | [BYDFi](https://partner.bydfi.com/j/DilWutCI) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://developers.bydfi.com/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![cex](https://user-images.githubusercontent.com/1294454/27766442-8ddc33b0-5ed8-11e7-8b98-f786aef0f3c9.jpg)](https://cex.io/r/0/up105393824/0/) | cex | [CEX.IO](https://cex.io/r/0/up105393824/0/) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://trade.cex.io/docs/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![coinbase](https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg)](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | coinbase | [Coinbase Advanced](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.cdp.coinbase.com/coinbase-app/introduction/welcome) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![coinbaseexchange](https://github.com/ccxt/ccxt/assets/43336371/34a65553-88aa-4a38-a714-064bd228b97e)](https://coinbase.com/) | coinbaseexchange | [Coinbase Exchange](https://coinbase.com/) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://docs.cloud.coinbase.com/exchange/docs/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![coinbaseinternational](https://github.com/ccxt/ccxt/assets/43336371/866ae638-6ab5-4ebf-ab2c-cdcce9545625)](https://international.coinbase.com) | coinbaseinternational | [Coinbase International](https://international.coinbase.com) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.cloud.coinbase.com/intx/docs) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![coincheck](https://user-images.githubusercontent.com/51840849/87182088-1d6d6380-c2ec-11ea-9c64-8ab9f9b289f5.jpg)](https://coincheck.com) | coincheck | [coincheck](https://coincheck.com) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://coincheck.com/documents/exchange/api) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![coinex](https://user-images.githubusercontent.com/51840849/87182089-1e05fa00-c2ec-11ea-8da9-cc73b45abbbc.jpg)](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.coinex.com/api/v2) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![coinmate](https://user-images.githubusercontent.com/51840849/87460806-1c9f3f00-c616-11ea-8c46-a77018a8f3f4.jpg)](https://coinmate.io?referral=YTFkM1RsOWFObVpmY1ZjMGREQmpTRnBsWjJJNVp3PT0) | coinmate | [CoinMate](https://coinmate.io?referral=YTFkM1RsOWFObVpmY1ZjMGREQmpTRnBsWjJJNVp3PT0) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://coinmate.docs.apiary.io) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![coinmetro](https://github.com/ccxt/ccxt/assets/43336371/e86f87ec-6ba3-4410-962b-f7988c5db539)](https://go.coinmetro.com/?ref=crypto24) | coinmetro | [Coinmetro](https://go.coinmetro.com/?ref=crypto24) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://documenter.getpostman.com/view/3653795/SVfWN6KS) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![coinone](https://user-images.githubusercontent.com/1294454/38003300-adc12fba-323f-11e8-8525-725f53c4a659.jpg)](https://coinone.co.kr) | coinone | [CoinOne](https://coinone.co.kr) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://doc.coinone.co.kr) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![coinsph](https://user-images.githubusercontent.com/1294454/225719995-48ab2026-4ddb-496c-9da7-0d7566617c9b.jpg)](https://www.coins.ph/en-ph/register?invite_code=1371062463303277512&broker=9001) | coinsph | [Coins.ph](https://www.coins.ph/en-ph/register?invite_code=1371062463303277512&broker=9001) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://coins-docs.github.io/rest-api) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![coinspot](https://user-images.githubusercontent.com/1294454/28208429-3cacdf9a-6896-11e7-854e-4c79a772a30f.jpg)](https://www.coinspot.com.au/register?code=PJURCU) | coinspot | [CoinSpot](https://www.coinspot.com.au/register?code=PJURCU) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://www.coinspot.com.au/api) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![cryptocom](https://user-images.githubusercontent.com/1294454/147792121-38ed5e36-c229-48d6-b49a-48d05fc19ed4.jpeg)](https://crypto.com/exch/kdacthrnxt) | cryptocom | [Crypto.com](https://crypto.com/exch/kdacthrnxt) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![cryptomus](https://github.com/user-attachments/assets/8e0b1c48-7c01-4177-9224-f1b01d89d7e7)](https://app.cryptomus.com/signup/?ref=JRP4yj) | cryptomus | [Cryptomus](https://app.cryptomus.com/signup/?ref=JRP4yj) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://doc.cryptomus.com/personal) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![deepcoin](https://github.com/user-attachments/assets/ddf3e178-c3b6-409d-8f9f-af8b7cf80454)](https://s.deepcoin.com/UzkyODgy) | deepcoin | [DeepCoin](https://s.deepcoin.com/UzkyODgy) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://www.deepcoin.com/docs) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![delta](https://user-images.githubusercontent.com/1294454/99450025-3be60a00-2931-11eb-9302-f4fd8d8589aa.jpg)](https://www.delta.exchange/app/signup/?code=IULYNB) | delta | [Delta Exchange](https://www.delta.exchange/app/signup/?code=IULYNB) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.delta.exchange) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![deribit](https://user-images.githubusercontent.com/1294454/41933112-9e2dd65a-798b-11e8-8440-5bab2959fcb8.jpg)](https://www.deribit.com/reg-1189.4038) | deribit | [Deribit](https://www.deribit.com/reg-1189.4038) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.deribit.com/v2) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![derive](https://github.com/user-attachments/assets/f835b95f-033a-43dd-b6bb-24e698fc498c)](https://www.derive.xyz/invite/3VB0B) | derive | [derive](https://www.derive.xyz/invite/3VB0B) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.derive.xyz/docs/) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![digifinex](https://user-images.githubusercontent.com/51840849/87443315-01283a00-c5fe-11ea-8628-c2a0feaf07ac.jpg)](https://www.digifinex.com/en-ww/from/DhOzBg?channelCode=ljaUPp) | digifinex | [DigiFinex](https://www.digifinex.com/en-ww/from/DhOzBg?channelCode=ljaUPp) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://docs.digifinex.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![dydx](https://github.com/user-attachments/assets/617ea0c1-f05a-4d26-9fcb-a0d1d4091ae1)](dydx.trade?ref=ccxt) | dydx | [dYdX](dydx.trade?ref=ccxt) | [![API Version 4](https://img.shields.io/badge/4-lightgray)](https://docs.dydx.xyz) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![exmo](https://user-images.githubusercontent.com/1294454/27766491-1b0ea956-5eda-11e7-9225-40d67b481b8d.jpg)](https://exmo.me/?ref=131685) | exmo | [EXMO](https://exmo.me/?ref=131685) | [![API Version 1.1](https://img.shields.io/badge/1.1-lightgray)](https://exmo.me/en/api_doc?ref=131685) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![extended](https://github.com/user-attachments/assets/309d44db-2a50-4529-a27f-8f4492aec299)](https://app.{hostname}) | extended | [Extended](https://app.{hostname}) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://api.docs.{hostname}) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![fmfwio](https://user-images.githubusercontent.com/1294454/159177712-b685b40c-5269-4cea-ac83-f7894c49525d.jpg)](https://fmfw.io/referral/da948b21d6c92d69) | fmfwio | [FMFW.io](https://fmfw.io/referral/da948b21d6c92d69) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://api.fmfw.io/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![foxbit](https://github.com/user-attachments/assets/1f8faca2-ae2f-4222-b33e-5671e7d873dd)](https://app.foxbit.com.br) | foxbit | [Foxbit](https://app.foxbit.com.br) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.foxbit.com.br) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![gate](https://github.com/user-attachments/assets/64f988c5-07b6-4652-b5c1-679a6bf67c85)](https://www.gate.com/share/CCXTGATE) | gate | [Gate](https://www.gate.com/share/CCXTGATE) | [![API Version 4](https://img.shields.io/badge/4-lightgray)](https://www.gate.com/docs/developers/apiv4/en) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![gemini](https://user-images.githubusercontent.com/1294454/27816857-ce7be644-6096-11e7-82d6-3c257263229c.jpg)](https://gemini.com/) | gemini | [Gemini](https://gemini.com/) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.gemini.com/rest-api) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![grvt](https://github.com/user-attachments/assets/7a2e8108-29f6-45d1-822d-48eb1c8cbbe6)](https://grvt.io/?ref=WBLS9D1) | grvt | [GRVT](https://grvt.io/?ref=WBLS9D1) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://api-docs.grvt.io/) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![hashkey](https://github.com/user-attachments/assets/6dd6127b-cc19-4a13-9b29-a98d81f80e98)](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | hashkey | [HashKey Global](https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://hashkeyglobal-apidoc.readme.io/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![hibachi](https://github.com/user-attachments/assets/7301bbb1-4f27-4167-8a55-75f74b14e973)](hibachi.xyz/r/ZBL2YFWIHU) | hibachi | [Hibachi](hibachi.xyz/r/ZBL2YFWIHU) | [![API Version *](https://img.shields.io/badge/*-lightgray)](undefined) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | | | [![hitbtc](https://user-images.githubusercontent.com/1294454/27766555-8eaec20e-5edc-11e7-9c5b-6dc69fc42f5e.jpg)](https://hitbtc.com/?ref_id=5a5d39a65d466) | hitbtc | [HitBTC](https://hitbtc.com/?ref_id=5a5d39a65d466) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://api.hitbtc.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![hollaex](https://user-images.githubusercontent.com/1294454/75841031-ca375180-5ddd-11ea-8417-b975674c23cb.jpg)](https://pro.hollaex.com/signup?affiliation_code=QSWA6G) | hollaex | [HollaEx](https://pro.hollaex.com/signup?affiliation_code=QSWA6G) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://apidocs.hollaex.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![htx](https://user-images.githubusercontent.com/1294454/76137448-22748a80-604e-11ea-8069-6e389271911d.jpg)](https://www.htx.com/invite/en-us/1h?invite_code=6rmm2223) | htx | [HTX](https://www.htx.com/invite/en-us/1h?invite_code=6rmm2223) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://huobiapi.github.io/docs/spot/v1/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![hyperliquid](https://github.com/ccxt/ccxt/assets/43336371/b371bc6c-4a8c-489f-87f4-20a913dd8d4b)](https://app.hyperliquid.xyz/) | hyperliquid | [Hyperliquid](https://app.hyperliquid.xyz/) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![independentreserve](https://user-images.githubusercontent.com/51840849/87182090-1e9e9080-c2ec-11ea-8e49-563db9a38f37.jpg)](https://www.independentreserve.com) | independentreserve | [Independent Reserve](https://www.independentreserve.com) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://www.independentreserve.com/API) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![indodax](https://user-images.githubusercontent.com/51840849/87070508-9358c880-c221-11ea-8dc5-5391afbbb422.jpg)](https://indodax.com/ref/testbitcoincoid/1) | indodax | [INDODAX](https://indodax.com/ref/testbitcoincoid/1) | [![API Version 2.0](https://img.shields.io/badge/2.0-lightgray)](https://github.com/btcid/indodax-official-api-docs) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![kraken](https://user-images.githubusercontent.com/51840849/76173629-fc67fb00-61b1-11ea-84fe-f2de582f58a3.jpg)](https://www.kraken.com) | kraken | [Kraken](https://www.kraken.com) | [![API Version 0](https://img.shields.io/badge/0-lightgray)](https://docs.kraken.com/rest/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![krakenfutures](https://user-images.githubusercontent.com/24300605/81436764-b22fd580-9172-11ea-9703-742783e6376d.jpg)](https://futures.kraken.com/) | krakenfutures | [Kraken Futures](https://futures.kraken.com/) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://docs.kraken.com/api/docs/futures-api/trading/market-data/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![kucoin](https://user-images.githubusercontent.com/51840849/87295558-132aaf80-c50e-11ea-9801-a2fb0c57c799.jpg)](https://www.kucoin.com/ucenter/signup?rcode=E5wkqe) | kucoin | [KuCoin](https://www.kucoin.com/ucenter/signup?rcode=E5wkqe) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.kucoin.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![kucoinfutures](https://user-images.githubusercontent.com/1294454/147508995-9e35030a-d046-43a1-a006-6fabd981b554.jpg)](https://futures.kucoin.com/?rcode=E5wkqe) | kucoinfutures | [KuCoin Futures](https://futures.kucoin.com/?rcode=E5wkqe) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.kucoin.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![latoken](https://user-images.githubusercontent.com/1294454/61511972-24c39f00-aa01-11e9-9f7c-471f1d6e5214.jpg)](https://latoken.com/invite?r=mvgp2djk) | latoken | [Latoken](https://latoken.com/invite?r=mvgp2djk) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://api.latoken.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![lbank](https://user-images.githubusercontent.com/1294454/38063602-9605e28a-3302-11e8-81be-64b1e53c4cfb.jpg)](https://www.lbank.com/login/?icode=7QCY) | lbank | [LBank](https://www.lbank.com/login/?icode=7QCY) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://www.lbank.com/en-US/docs/index.html) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![lighter](https://github.com/user-attachments/assets/ff1aaf96-bffb-4545-a750-5eba716e75d0)](app.lighter.xyz/?referral=715955W9) | lighter | [Lighter](app.lighter.xyz/?referral=715955W9) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://apidocs.lighter.xyz/) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![luno](https://user-images.githubusercontent.com/1294454/27766607-8c1a69d8-5ede-11e7-930c-540b5eb9be24.jpg)](https://www.luno.com/invite/44893A) | luno | [luno](https://www.luno.com/invite/44893A) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://www.luno.com/en/api) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![mercado](https://user-images.githubusercontent.com/1294454/27837060-e7c58714-60ea-11e7-9192-f05e86adb83f.jpg)](https://www.mercadobitcoin.com.br) | mercado | [Mercado Bitcoin](https://www.mercadobitcoin.com.br) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://www.mercadobitcoin.com.br/api-doc) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![mexc](https://user-images.githubusercontent.com/1294454/137283979-8b2a818d-8633-461b-bfca-de89e8c446b2.jpg)](https://www.mexc.com/register?inviteCode=mexc-1FQ1GNu1) | mexc | [MEXC Global](https://www.mexc.com/register?inviteCode=mexc-1FQ1GNu1) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://mexcdevelop.github.io/apidocs/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![modetrade](https://github.com/user-attachments/assets/cec2b7f1-3b2b-4502-971b-447ee1937d6b)](https://trade.mode.network?ref=MODETRADE) | modetrade | [Mode Trade](https://trade.mode.network?ref=MODETRADE) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](undefined) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![myokx](https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg)](https://www.my.okx.com/join/CCXT2023) | myokx | [MyOKX (EEA)](https://www.my.okx.com/join/CCXT2023) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://my.okx.com/docs-v5/en/#overview) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![ndax](https://user-images.githubusercontent.com/1294454/108623144-67a3ef00-744e-11eb-8140-75c6b851e945.jpg)](https://one.ndax.io/bfQiSL) | ndax | [NDAX](https://one.ndax.io/bfQiSL) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://apidoc.ndax.io/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![novadax](https://user-images.githubusercontent.com/1294454/92337550-2b085500-f0b3-11ea-98e7-5794fb07dd3b.jpg)](https://www.novadax.com.br/?s=ccxt) | novadax | [NovaDAX](https://www.novadax.com.br/?s=ccxt) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://doc.novadax.com/pt-BR/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![okx](https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg)](https://www.okx.com/join/CCXTCOM) | okx | [OKX](https://www.okx.com/join/CCXTCOM) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://www.okx.com/docs-v5/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![okxus](https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg)](https://www.app.okx.com/join/CCXT2023) | okxus | [OKX (US)](https://www.app.okx.com/join/CCXT2023) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://app.okx.com/docs-v5/en/#overview) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![onetrading](https://github.com/ccxt/ccxt/assets/43336371/bdbc26fd-02f2-4ca7-9f1e-17333690bb1c)](https://onetrading.com/) | onetrading | [One Trading](https://onetrading.com/) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.onetrading.com) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![p2b](https://github.com/ccxt/ccxt/assets/43336371/8da13a80-1f0a-49be-bb90-ff8b25164755)](https://p2pb2b.com?referral=ee784c53) | p2b | [p2b](https://p2pb2b.com?referral=ee784c53) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![pacifica](https://github.com/user-attachments/assets/f795515a-828e-4a04-8fca-bf19fcf17ea4)](https://app.pacifica.fi?referral=ccxt) | pacifica | [Pacifica](https://app.pacifica.fi?referral=ccxt) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.pacifica.fi/api-documentation/api/rest-api) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![paradex](https://github.com/user-attachments/assets/84628770-784e-4ec4-a759-ec2fbb2244ea)](https://app.paradex.trade/r/ccxt24) | paradex | [Paradex](https://app.paradex.trade/r/ccxt24) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.api.testnet.paradex.trade/) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![paymium](https://user-images.githubusercontent.com/51840849/87153930-f0f02200-c2c0-11ea-9c0a-40337375ae89.jpg)](https://www.paymium.com/page/sign-up?referral=eDAzPoRQFMvaAB8sf-qj) | paymium | [Paymium](https://www.paymium.com/page/sign-up?referral=eDAzPoRQFMvaAB8sf-qj) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://github.com/Paymium/api-documentation) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![phemex](https://user-images.githubusercontent.com/1294454/85225056-221eb600-b3d7-11ea-930d-564d2690e3f6.jpg)](https://phemex.com/register?referralCode=EDNVJ) | phemex | [Phemex](https://phemex.com/register?referralCode=EDNVJ) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://phemex-docs.github.io/#overview) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![poloniex](https://user-images.githubusercontent.com/1294454/27766817-e9456312-5ee6-11e7-9b3c-b628ca5626a5.jpg)](https://poloniex.com/signup?c=UBFZJRPJ) | poloniex | [Poloniex](https://poloniex.com/signup?c=UBFZJRPJ) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://api-docs.poloniex.com/spot/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![tokocrypto](https://user-images.githubusercontent.com/1294454/183870484-d3398d0c-f6a1-4cce-91b8-d58792308716.jpg)](https://tokocrypto.com) | tokocrypto | [Tokocrypto](https://tokocrypto.com) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://www.tokocrypto.com/apidocs/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![toobit](https://github.com/user-attachments/assets/0c7a97d5-182c-492e-b921-23540c868e0e)](https://www.toobit.com/en-US/r?i=IFFPy0) | toobit | [Toobit](https://www.toobit.com/en-US/r?i=IFFPy0) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://toobit-docs.github.io/apidocs/spot/v1/en/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![upbit](https://user-images.githubusercontent.com/1294454/49245610-eeaabe00-f423-11e8-9cba-4b0aed794799.jpg)](https://upbit.com) | upbit | [Upbit](https://upbit.com) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.upbit.com/kr) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![wavesexchange](https://user-images.githubusercontent.com/1294454/84547058-5fb27d80-ad0b-11ea-8711-78ac8b3c7f31.jpg)](https://wx.network) | wavesexchange | [Waves.Exchange](https://wx.network) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://docs.wx.network) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | | | [![weex](https://github.com/user-attachments/assets/ccbadb2d-5035-403d-898f-dce831bdc936)](https://www.weex.com/register?vipCode=qfyh) | weex | [Weex](https://www.weex.com/register?vipCode=qfyh) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://www.weex.com/api-doc) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![whitebit](https://user-images.githubusercontent.com/1294454/66732963-8eb7dd00-ee66-11e9-849b-10d9282bb9e0.jpg)](https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963) | whitebit | [WhiteBit](https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963) | [![API Version 4](https://img.shields.io/badge/4-lightgray)](https://github.com/whitebit-exchange/api-docs) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![woo](https://user-images.githubusercontent.com/1294454/150730761-1a00e5e0-d28c-480f-9e65-089ce3e6ef3b.jpg)](https://woox.io/register?ref=DIJT0CNL) | woo | [WOO X](https://woox.io/register?ref=DIJT0CNL) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.woox.io/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![woofipro](https://github.com/user-attachments/assets/9ba21b8a-a9c7-4770-b7f1-ce3bcbde68c1)](https://dex.woo.org/en/trade?ref=CCXT) | woofipro | [WOOFI PRO](https://dex.woo.org/en/trade?ref=CCXT) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://orderly.network/docs/build-on-omnichain/building-on-evm) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![xt](https://user-images.githubusercontent.com/14319357/232636712-466df2fc-560a-4ca4-aab2-b1d954a58e24.jpg)](https://www.xt.com/en/accounts/register?ref=9PTM9VW) | xt | [XT](https://www.xt.com/en/accounts/register?ref=9PTM9VW) | [![API Version 4](https://img.shields.io/badge/4-lightgray)](https://doc.xt.com/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![yobit](https://user-images.githubusercontent.com/1294454/27766910-cdcbfdae-5eea-11e7-9859-03fea873272d.jpg)](https://www.yobit.net) | yobit | [YoBit](https://www.yobit.net) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://www.yobit.net/en/api/) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![zaif](https://user-images.githubusercontent.com/1294454/27766927-39ca2ada-5eeb-11e7-972f-1b4199518ca6.jpg)](https://zaif.jp) | zaif | [Zaif](https://zaif.jp) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://techbureau-api-document.readthedocs.io/ja/latest/index.html) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | | [![zebpay](https://github.com/user-attachments/assets/8094e7be-55a7-46f4-a087-0ca31b48ecad)](https://www.zebpay.com) | zebpay | [Zebpay](https://www.zebpay.com) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://github.com/zebpay/zebpay-api-references) | ![CEX – Centralized EXchange](https://img.shields.io/badge/CEX-green.svg "CEX – Centralized EXchange") | | | <!--- end list --> The list above is updated frequently, new crypto markets, exchanges, bug fixes, and API endpoints are introduced on a regular basis. See the [Manual](https://github.com/ccxt/ccxt/wiki/) for more details. If you can't find a cryptocurrency exchange in the list above and want it to be added, post a link to it by opening an issue here on GitHub or send us an email. The library is under [MIT license](https://github.com/ccxt/ccxt/blob/master/LICENSE.txt), that means it's absolutely free for any developer to build commercial and opensource software on top of it, but use it at your own risk with no warranties, as is. ### Builder Code Exchanges <!--- init builder codes list ---> |logo |id |name |ver |type |certified |pro | |------------------------------------------------------------------------------------------------------------------------------------------|-------------|------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------:|-------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| | [![aster](https://github.com/user-attachments/assets/4982201b-73cd-4d7a-8907-e69e239e9609)](https://www.asterdex.com/en/referral/aA1c2B) | aster | [Aster](https://www.asterdex.com/en/referral/aA1c2B) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://github.com/asterdex/api-docs) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![extended](https://github.com/user-attachments/assets/309d44db-2a50-4529-a27f-8f4492aec299)](https://app.{hostname}) | extended | [Extended](https://app.{hostname}) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://api.docs.{hostname}) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![grvt](https://github.com/user-attachments/assets/7a2e8108-29f6-45d1-822d-48eb1c8cbbe6)](https://grvt.io/?ref=WBLS9D1) | grvt | [GRVT](https://grvt.io/?ref=WBLS9D1) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://api-docs.grvt.io/) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![hyperliquid](https://github.com/ccxt/ccxt/assets/43336371/b371bc6c-4a8c-489f-87f4-20a913dd8d4b)](https://app.hyperliquid.xyz/) | hyperliquid | [Hyperliquid](https://app.hyperliquid.xyz/) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![lighter](https://github.com/user-attachments/assets/ff1aaf96-bffb-4545-a750-5eba716e75d0)](app.lighter.xyz/?referral=715955W9) | lighter | [Lighter](app.lighter.xyz/?referral=715955W9) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://apidocs.lighter.xyz/) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | | [![pacifica](https://github.com/user-attachments/assets/f795515a-828e-4a04-8fca-bf19fcf17ea4)](https://app.pacifica.fi?referral=ccxt) | pacifica | [Pacifica](https://app.pacifica.fi?referral=ccxt) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.pacifica.fi/api-documentation/api/rest-api) | ![DEX - Distributed EXchange](https://img.shields.io/badge/DEX-blue.svg "DEX - Distributed EXchange") | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://docs.ccxt.com/ccxt.pro.manual) | <!--- end list --> CCXT participates in builder programs with the exchanges listed above, which means that in order to support the CCXT project users pay a small fee (1 bps) on top of the exchanges' fees when using the exchanges' API through CCXT. This is optional and can be disabled by setting `exchange.options['builderFee'] = False`. For all other exchanges no additional fee is charged and in some cases you receive discounts or special conditions by using CCXT. --- ## Install The easiest way to install the CCXT library is to use a package manager: - [ccxt in **NPM**](https://www.npmjs.com/package/ccxt) (JavaScript / Node v7.6+) - [ccxt in **PyPI**](https://pypi.python.org/pypi/ccxt) (Python 3.7.0+) - [ccxt in **Packagist/Composer**](https://packagist.org/packages/ccxt/ccxt) (PHP 8.1+) - [ccxt in **Nuget**](https://www.nuget.org/packages/ccxt) (netstandard 2.0) - [ccxt in **GO**](https://pkg.go.dev/github.com/ccxt/ccxt/go/v4) - [ccxt in **Java**](https://central.sonatype.com/artifact/io.github.ccxt/ccxt) (Java 21+, Gradle) This library is shipped as an all-in-one module implementation with minimalistic dependencies and requirements: - [js/](https://github.com/ccxt/ccxt/blob/master/js/) in JavaScript - [python/](https://github.com/ccxt/ccxt/blob/master/python/) in Python (generated from TS) - [php/](https://github.com/ccxt/ccxt/blob/master/php/) in PHP (generated from TS) - [cs/](https://github.com/ccxt/ccxt/blob/master/cs/) in C# (generated from TS) - [go/](https://github.com/ccxt/ccxt/blob/master/go/) in Go (generated from TS) - [java/](https://github.com/ccxt/ccxt/blob/master/java/) in Java (generated from TS) You can also clone it into your project directory from [ccxt GitHub repository](https://github.com/ccxt/ccxt): ```shell git clone https://github.com/ccxt/ccxt.git # including 1GB of commit history # or git clone https://github.com/ccxt/ccxt.git --depth 1 # avoid downloading 1GB of commit history ``` ### JavaScript (NPM) JavaScript version of CCXT works in both Node and web browsers. Requires ES6 and `async/await` syntax support (Node 7.6.0+). When compiling with Webpack and Babel, make sure it is [not excluded](https://github.com/ccxt/ccxt/issues/225#issuecomment-331905178) in your `babel-loader` config. [ccxt in **NPM**](https://www.npmjs.com/package/ccxt) ```shell npm install ccxt ``` ```JavaScript //cjs var ccxt = require ('ccxt') console.log (ccxt.exchanges) // print all available exchanges ``` ```Javascript //esm import {version, exchanges} from 'ccxt'; console.log(version, Object.keys(exchanges)); ``` ### JavaScript (for use with the `<script>` tag): All-in-one browser bundle (dependencies included), served from a CDN of your choice: * jsDelivr: https://cdn.jsdelivr.net/npm/[email protected]/dist/ccxt.browser.min.js * unpkg: https://unpkg.com/[email protected]/dist/ccxt.browser.min.js CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers. ```HTML <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ccxt.browser.min.js"></script> ``` Creates a global `ccxt` object: ```JavaScript console.log (ccxt.exchanges) // print all available exchanges ``` ### Python [ccxt in **PyPI**](https://pypi.python.org/pypi/ccxt) ```shell pip install ccxt ``` ```Python import ccxt print(ccxt.exchanges) # print a list of all available exchange classes ``` The library supports concurrent asynchronous mode with asyncio and async/await in Python 3.7.0+ ```Python import ccxt.async_support as ccxt # link against the asynchronous version of ccxt ``` #### orjson support CCXT also supports `orjson` for parsing JSON since it is much faster than the builtin library. This is especially important when using websockets because some exchanges return big messages that need to be parsed and dispatched as quickly as possible. However, `orjson` is not enabled by default because it is not supported by every python interpreter. If you want to opt-in, you just need to install it (`pip install orjson`) on your local environment. CCXT will detect the installion and pick it up automatically. #### ECDSA Support Some exchanges, such as Hyperliquid, Binance, and Paradex use **ECDSA** for request signing. By default, CCXT includes a pure Python ECDSA implementation that ensures compatibility across all environments. However, this implementation may not meet the performance requirements of latency-sensitive applications. To address this, CCXT also supports the Coincurve library, which dramatically reduces signing time from approximately 45 ms to under 0.05 ms. For optimal performance, we recommend installing Coincurve via: ``` pip install coincurve ``` Once installed, CCXT will automatically detect and use it. ### PHP [ccxt in PHP with **Packagist/Composer**](https://packagist.org/packages/ccxt/ccxt) (PHP 8.1+) It requires common PHP modules: - cURL - mbstring (using UTF-8 is highly recommended) - PCRE - iconv - gmp ```PHP include "ccxt.php"; var_dump (\ccxt\Exchange::$exchanges); // print a list of all available exchange classes ``` The library supports concurrent asynchronous mode using tools from [ReactPHP](https://reactphp.org/) in PHP 8.1+. Read the [Manual](https://github.com/ccxt/ccxt/wiki/) for more details. ### .net/C# [ccxt in C# with **Nuget**](https://www.nuget.org/packages/ccxt) (netstandard 2.0 and netstandard 2.1) ```c# using ccxt; Console.WriteLine(ccxt.Exchanges) // check this later ``` ### Go [ccxt in GO with **PKG**](https://pkg.go.dev/github.com/ccxt/ccxt/go/v4) ```shell go install github.com/ccxt/ccxt/go/v4@latest ``` ```Go import "ccxt" fmt.Println(ccxt.Exchanges) ``` ### Java Java version of CCXT requires Java 21+ and uses Gradle as its build system. Add the CCXT library as a local dependency in your `build.gradle.kts`: ```kotlin dependencies { implementation("io.github.ccxt:ccxt:4.5.52") } ``` Or clone and build from source: ```shell git clone https://github.com/ccxt/ccxt.git --depth 1 cd ccxt/java ./gradlew :lib:build ``` ```Java import io.github.ccxt.exchanges.Binance; import io.github.ccxt.types.Ticker; Binance exchange = new Binance(); exchange.loadMarkets(false); Ticker ticker = exchange.fetchTicker("BTC/USDT"); System.out.println(ticker.symbol + " " + ticker.last); ``` Each exchange has its own typed subclass with strongly-typed return values. Every typed method ships both a blocking sync and a non-blocking `CompletableFuture`-returning async overload — pick the idiom that fits your call site: ```Java // Sync — blocks until the response arrives Ticker ticker = exchange.fetchTicker("BTC/USDT"); // Async — returns immediately, completes when the response arrives CompletableFuture<Ticker> future = exchange.fetchTickerAsync("BTC/USDT", null); future.thenAccept(t -> System.out.println(t.last)); ``` WebSocket support is available via the pro exchange classes, with the same sync/async symmetry — `watchTicker` blocks for one update; `watchTickerAsync` returns a `CompletableFuture<Ticker>` you can compose: ```Java import io.github.ccxt.exchanges.pro.Binance; var exchange = new Binance(); exchange.loadMarkets(false); // Sync — blocks for one update Ticker tick = exchange.watchTicker("BTC/USDT"); // Async — returns a typed CompletableFuture (composable with allOf, anyOf, etc.) CompletableFuture<Ticker> future = exchange.watchTickerAsync("BTC/USDT", null); ``` See [java/examples/](https://github.com/ccxt/ccxt/tree/master/java/examples) for more usage examples. ### Docker You can get CCXT installed in a container along with all the supported languages and dependencies. This may be useful if you want to contribute to CCXT (e.g. run the build scripts and tests — please see the [Contributing](https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md) document for the details on that). Using `docker-compose` (in the cloned CCXT repository): ```shell docker-compose run --rm ccxt ``` You don't need the Docker image if you're not going to develop CCXT. If you just want to use CCXT – just install it as a regular package into your project. --- ## AI Assistant Support CCXT provides language-specific skills for AI coding assistants (Claude Code, Cursor, Copilot, Windsurf, Codex, and 30+ others): ```bash npx skills add ccxt/ccxt ``` See [AI Skills documentation](https://github.com/ccxt/ccxt/wiki/AI-Skills) and [llms.txt](https://raw.githubusercontent.com/ccxt/ccxt/master/llms.txt) for more details. --- ## Usage ### Intro The CCXT library consists of a public part and a private part. Anyone can use the public part immediately after installation. Public APIs provide unrestricted access to public information for all exchange markets without the need to register a user account or have an API key. Public APIs include the following: - market data - instruments/trading pairs - price feeds (exchange rates) - order books - trade history - tickers - OHLC(V) for charting - other public endpoints In order to trade with private APIs you need to obtain API keys from an exchange's website. It usually means signing up to the exchange and creating API keys for your account. Some exchanges require personal info or identification. Sometimes verification may be necessary as well. In this case you will need to register yourself, this library will not create accounts or API keys for you. Some exchanges expose API endpoints for registering an account, but most exchanges don't. You will have to sign up and create API keys on their websites. Private APIs allow the following: - manage personal account info - query account balances - trade by making market and limit orders - deposit and withdraw fiat and crypto funds - query personal orders - get ledger history - transfer funds between accounts - use merchant services This library implements full public and private REST and WebSocket APIs for all exchanges in TypeScript, JavaScript, PHP and Python. The CCXT library supports both camelcase notation (preferred in TypeScript and JavaScript) and underscore notation (preferred in Python and PHP), therefore all methods can be called in either notation or coding style in any language. ```JavaScript // both of these notations work in JavaScript/Python/PHP exchange.methodName () // camelcase pseudocode exchange.method_name () // underscore pseudocode ``` Read the [Manual](https://github.com/ccxt/ccxt/wiki/) and see [examples](https://github.com/ccxt/ccxt/tree/master/examples) for more details. ### JavaScript **CCXT now supports ESM and CJS modules** #### CJS ```JavaScript // cjs example 'use strict'; const ccxt = require ('ccxt'); (async function () { let kraken = new ccxt.kraken () let bitfinex = new ccxt.bitfinex ({ verbose: true }) let huobipro = new ccxt.huobipro () let okcoinusd = new ccxt.okcoin ({ apiKey: 'YOUR_PUBLIC_API_KEY', secret: 'YOUR_SECRET_PRIVATE_KEY', }) const exchangeId = 'binance' , exchangeClass = ccxt[exchangeId] , exchange = new exchangeClass ({ 'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_SECRET', }) console.log (kraken.id, await kraken.loadMarkets ()) console.log (bitfinex.id, await bitfinex.loadMarkets ()) console.log (huobipro.id, await huobipro.loadMarkets ()) console.log (kraken.id, await kraken.fetchOrderBook (kraken.symbols[0])) console.log (bitfinex.id, await bitfinex.fetchTicker ('BTC/USD')) console.log (huobipro.id, await huobipro.fetchTrades ('ETH/USDT')) console.log (okcoinusd.id, await okcoinusd.fetchBalance ()) // sell 1 BTC/USD for market price, sell a bitcoin for dollars immediately console.log (okcoinusd.id, await okcoinusd.createMarketSellOrder ('BTC/USD', 1)) // buy 1 BTC/USD for $2500, you pay $2500 and receive ฿1 when the order is closed console.log (okcoinusd.id, await okcoinusd.createLimitBuyOrder ('BTC/USD', 1, 2500.00)) // pass/redefine custom exchange-specific order params: type, amount, price or whatever // use a custom order type bitfinex.createLimitSellOrder ('BTC/USD', 1, 10, { 'type': 'trailing-stop' }) }) (); ``` #### ESM ```Javascript //esm example import {version, binance} from 'ccxt'; console.log(version); const exchange = new binance(); const ticker = await exchange.fetchTicker('BTC/USDT'); console.log(ticker); ``` ### Python ```Python # coding=utf-8 import ccxt hitbtc = ccxt.hitbtc({'verbose': True}) bitmex = ccxt.bitmex() huobipro = ccxt.huobipro() exmo = ccxt.exmo({ 'apiKey': 'YOUR_PUBLIC_API_KEY', 'secret': 'YOUR_SECRET_PRIVATE_KEY', }) kraken = ccxt.kraken({ 'apiKey': 'YOUR_PUBLIC_API_KEY', 'secret': 'YOUR_SECRET_PRIVATE_KEY', }) exchange_id = 'binance' exchange_class = getattr(ccxt, exchange_id) exchange = exchange_class({ 'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_SECRET', }) hitbtc_markets = hitbtc.load_markets() print(hitbtc.id, hitbtc_markets) print(bitmex.id, bitmex.load_markets()) print(huobipro.id, huobipro.load_markets()) print(hitbtc.fetch_order_book(hitbtc.symbols[0])) print(bitmex.fetch_ticker('BTC/USD')) print(huobipro.fetch_trades('LTC/USDT')) print(exmo.fetch_balance()) # sell one ฿ for market price and receive $ right now print(exmo.id, exmo.create_market_sell_order('BTC/USD', 1)) # limit buy BTC/EUR, you pay €2500 and receive ฿1 when the order is closed print(exmo.id, exmo.create_limit_buy_order('BTC/EUR', 1, 2500.00)) # pass/redefine custom exchange-specific order params: type, amount, price, flags, etc... kraken.create_market_buy_order('BTC/USD', 1, {'trading_agreement': 'agree'}) ``` ### PHP ```PHP include 'ccxt.php'; $poloniex = new \ccxt\poloniex (); $bittrex = new \ccxt\bittrex (array ('verbose' => true)); $quoinex = new \ccxt\quoinex (); $zaif = new \ccxt\zaif (array ( 'apiKey' => 'YOUR_PUBLIC_API_KEY', 'secret' => 'YOUR_SECRET_PRIVATE_KEY', )); $hitbtc = new \ccxt\hitbtc (array ( 'apiKey' => 'YOUR_PUBLIC_API_KEY', 'secret' => 'YOUR_SECRET_PRIVATE_KEY', )); $exchange_id = 'binance'; $exchange_class = "\\ccxt\\$exchange_id"; $exchange = new $exchange_class (array ( 'apiKey' => 'YOUR_API_KEY', 'secret' => 'YOUR_SECRET', )); $poloniex_markets = $poloniex->load_markets (); var_dump ($poloniex_markets); var_dump ($bittrex->load_markets ()); var_dump ($quoinex->load_markets ()); var_dump ($poloniex->fetch_order_book ($poloniex->symbols[0])); var_dump ($bittrex->fetch_trades ('BTC/USD')); var_dump ($quoinex->fetch_ticker ('ETH/EUR')); var_dump ($zaif->fetch_ticker ('BTC/JPY')); var_dump ($zaif->fetch_balance ()); // sell 1 BTC/JPY for market price, you pay ¥ and receive ฿ immediately var_dump ($zaif->id, $zaif->create_market_sell_order ('BTC/JPY', 1)); // buy BTC/JPY, you receive ฿1 for ¥285000 when the order closes var_dump ($zaif->id, $zaif->create_limit_buy_order ('BTC/JPY', 1, 285000)); // set a custom user-defined id to your order $hitbtc->create_order ('BTC/USD', 'limit', 'buy', 1, 3000, array ('clientOrderId' => '123')); ``` ### .net/C# ```C# using ccxt; // importing ccxt namespace Project; class Project { public async static Task CreateOrder() { var exchange = new Binance(); exchange.apiKey = "my api key"; exchange.secret = "my secret"; // always use the capitalized method (CreateOrder instead of createOrder) var order = await exchange.CreateOrder("BTC/USDT", "limit", "buy", 1, 50); Console.WriteLine("Placed Order, order id: " + order.id); } } ``` ### Go ```Go package main import ( "github.com/ccxt/ccxt/go/v4/go" "fmt" ) func main() { exchange := ccxt.NewBinance(map[string]interface{}{ "apiKey": "MY KEY", "secret": "MY SECRET", }) orderParams := map[string]interface{}{ "clientOrderId": "myOrderId68768678", } exchange.LoadMarkets() order, err := exchange.CreateOrder("BTC/USDT", "limit", "buy", 0.001, ccxt.WithCreateOrderPrice(6000), ccxt.WithCreateOrderParams(orderParams)) if err != nil { if ccxtError, ok := err.(*ccxt.Error); ok { if ccxtError.Type == "InvalidOrder" { fmt.Println("Invalid order") } else { fmt.Println("Some other error") } } } else { fmt.Println(*order.Id) } // fetching OHLCV ohlcv, err := exchange.FetchOHLCV("BTC/USDT", ccxt.WithFetchOHLCVTimeframe("5m"), ccxt.WithFetchOHLCVLimit(100)) if err != nil { fmt.Println("Error: ", err) } else { fmt.Println("Got OHLCV!") } } ``` #### Optional parameters Unlike Javascript/Python/PHP/C# Go does not support "traditional" optional parameters like `function a(optional = false)`. However, the CCXT language and structure have some methods with optional params, and since the Go language is transpiled from the Typescript source, we had to find a way of representing them. We have decided to "go" (pun intended) with Option structs and the `WithX` methods. For example, this function `FetchMyTrades` supports 4 different "optional" parameters, symbol, since, limit, and params. ```Golang func (this *Binance) FetchMyTrades(options ...FetchMyTradesOptions) ([]Trade, error) ``` And we can provide them by doing ```Golang trades, error := exchange.FetchMyTrades(ccxt.withFetchMyTradesSymbol("BTC/USDT"), ccxt.WithFetchOHLCVLimit(5), ccxt.WithFetchMyTradesParams(orderParams)) ``` Lastly, just because the signature dictates that some argument like `symbol` is optional, it will depend from exchange to exchange and you might need to provide it to avoid getting a `SymbolRequired` error. You can check different examples in the `examples/go` folder. ### Java ```Java import io.github.ccxt.exchanges.Kraken; import io.github.ccxt.exchanges.Bitfinex; import io.github.ccxt.exchanges.Binance; import io.github.ccxt.types.*; import java.util.HashMap; import java.util.Map; public class Example { public static void main(String[] args) { // Create exchange instances Kraken kraken = new Kraken(); Bitfinex bitfinex = new Bitfinex(); Map<String, Object> config = new HashMap<>(); config.put("apiKey", "YOUR_API_KEY"); config.put("secret", "YOUR_SECRET"); Binance binance = new Binance(config); // Load markets kraken.loadMarkets(false); binance.loadMarkets(false); // Public API OrderBook orderBook = kraken.fetchOrderBook("BTC/USDT"); Ticker ticker = bitfinex.fetchTicker("BTC/USD"); System.out.println(ticker.symbol + " last=" + ticker.last); // Fetch OHLCV var candles = binance.fetchOHLCV("BTC/USDT", "1h", null, 10L, null); System.out.println("Got " + candles.size() + " candles"); // Private API (requires API keys) Balances balance = binance.fetchBalance(); System.out.println("BTC free: " + balance.free.get("BTC")); // Place a limit buy order Order order = binance.createLimitBuyOrder("BTC/USDT", 0.001, 50000.0); System.out.println("Order id: " + order.id + " status: " + order.status); // Cancel it binance.cancelOrder(order.id, "BTC/USDT", null); } } ``` #### Async All methods are also available as async variants returning `CompletableFuture`: ```Java import java.util.concurrent.CompletableFuture; // Fire multiple requests concurrently CompletableFuture<Ticker> btc = binance.fetchTickerAsync("BTC/USDT", null); CompletableFuture<Ticker> eth = binance.fetchTickerAsync("ETH/USDT", null); CompletableFuture.allOf(btc, eth).join(); System.out.println("BTC: " + btc.get().last + " ETH: " + eth.get().last); ``` #### Error handling Typed sync methods throw the underlying ccxt error directly — no `CompletionException` unwrap needed. Catch exceptions in standard JDK order (most-specific first), like you would with any other Java library: ```Java import io.github.ccxt.errors.*; import io.github.ccxt.exchanges.Binance; import io.github.ccxt.types.Order; Binance binance = new Binance(Map.of("apiKey", "...", "secret", "...")); try { Order order = binance.createOrder("BTC/USDT", "limit", "buy", 0.001, 50000.0); } catch (InsufficientFunds e) { // user error — show balance, don't retry } catch (InvalidOrder e) { // covers OrderNotFound, DuplicateOrderId, … // user error — fix params } catch (AuthenticationError e) { // covers PermissionDenied, AccountSuspended // refresh credentials } catch (RateLimitExceeded | DDoSProtection e) { // multi-catch (Java 7+) Thread.sleep(30_000); } catch (NetworkError e) { // RequestTimeout, ExchangeNotAvailable, … Thread.sleep(2_000); // transient — retry } catch (ExchangeError e) { // any other exchange-side error // exchange refused } catch (BaseError e) { // ccxt catch-all // unknown ccxt error } ``` For async methods, `CompletableFuture` wraps thrown errors in `CompletionException` (JDK behaviour). Use `Helpers.unwrap()` inside `.exceptionally(...)` to peel the wrap and pattern-match the real cause: ```Java import io.github.ccxt.Helpers; binance.createOrderAsync("BTC/USDT", "limit", "buy", 0.001, 50000.0) .thenAccept(order -> log.info("placed " + order.id)) .exceptionally(throwable -> { Throwable cause = Helpers.unwrap(throwable); return switch (cause) { case InsufficientFunds e -> { notifyUser(e); yield null; } case AuthenticationError e -> { refreshCreds(); yield null; } case RateLimitExceeded e -> { scheduleRetry(); yield null; } case NetworkError e -> { scheduleRetry(); yield null; } case BaseError e -> { log.error("ccxt", e); yield null; } default -> throw new java.util.concurrent.CompletionException(cause); }; }); ``` The full hierarchy lives under `io.github.ccxt.errors` — see the [Error Handling section of the Manual](https://github.com/ccxt/ccxt/wiki/Manual#error-handling) for the complete tree (NetworkError vs ExchangeError, retry-safe vs user-error categories, etc.). #### WebSocket WebSocket support is available via the pro exchange classes: ```Java import io.github.ccxt.Exchange; import io.github.ccxt.exchanges.pro.Binance; import java.util.concurrent.TimeUnit; Exchange exchange = new Binance(); exchange.loadMarkets().join(); // Stream live ticker updates for (int i = 0; i < 10; i++) { Object ticker = exchange.watchTicker("BTC/USDT").get(30, TimeUnit.SECONDS); System.out.println(ticker); } ``` You can check different examples in the `java/examples` folder. ## Rate limiting Crypto exchanges enforce rate limits to protect their infrastructure, ensure fair usage across all clients, and prevent abuse that could degrade performance or availability for other users. That means you can't make an unlimited amount of requests to the exchange, there is a rate that needs to be respected. By default, CCXT uses a **leaky bucket** rate limiter to control the pace of outgoing requests. A leaky bucket rate limiter works by queueing requests and releasing them at a steady, fixed rate. Bursts of requests are smoothed out over time rather than executed immediately. However, if the user provides a `rateLimiterAlgorithm': 'rollingWindow'` option, ccxt switches from the leaky bucket model to a **window-based rate** limiter. A window-based limiter enforces a maximum number of requests within a fixed time window (for example, N requests per X milliseconds). Once the limit is reached, further requests are delayed until the current window expires. By default CCXT assumes a 60s window but the window size can be customized by providing `rollingWindowSize: X0000` ms. Example: ```Python exchange = ccxt.binance({ 'rateLimiterAlgorithm': 'rollingWindow', # switching to rolling window algorithm 'rollingWindowSize': 5000 # if binance allows X requests per 5 seconds, those requests can be fired in a burst at any time during this window }) ``` ## CCXT CLI Read the documentation for more information and details: [docs](https://github.com/ccxt/ccxt/tree/master/cli/README.md) CCXT also provides a command-line interface (CLI) that enables direct interaction with any supported exchange from the terminal. You can quickly check balances, place orders, or fetch trade data - all of that without the need to write or execute custom code and without the overhead of building an entire application from scratch. This is especially useful for simple or time-sensitive tasks (shell scripting, testing and debugging among other things). ### Installation The CLI is available as a npm package and can be installed by doing ``` npm i ccxt-cli -g ``` ### Usage You can use the `--help` option to view a general overview of how the CLI works. The tool allows you to invoke any CCXT method by specifying the exchange id, the methodName, and any required arguments. Examples: ``` ccxt binance createOrder BTC/USDT market buy 0.1 // places an order ``` If 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 } ``` You can easily provide API keys by setting them as environment varibales eg: `BINANCE_APIKEY="XXXX"` or adding them to the config file located at `$CACHE/config.json` ## Contributing Please read the [CONTRIBUTING](https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md) document before making changes that you would like adopted in the code. Also, read the [Manual](https://github.com/ccxt/ccxt/wiki) for more details. ## Support Developer Team We are investing a significant amount of time into the development of this library. If CCXT made your life easier and you want to help us improve it further, or if you want to speed up development of new features and exchanges, please support us with a tip. We appreciate all contributions! ### Sponsors Support this project by becoming a sponsor. [[Become a sponsor](https://opencollective.com/ccxt#sponsor)] <a href="https://opencollective.com/ccxt/tiers/sponsor/0/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/sponsor/1/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/sponsor/2/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/sponsor/3/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/sponsor/4/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/sponsor/5/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/sponsor/6/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/sponsor/7/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/sponsor/8/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/sponsor/9/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/sponsor/9/avatar.svg"></a> ### Supporters Support this project by becoming a supporter. Your avatar will show up here with a link to your website. [[Become a supporter](https://opencollective.com/ccxt#supporter)] <a href="https://opencollective.com/ccxt/tiers/supporter/0/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/0/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/supporter/1/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/1/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/supporter/2/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/2/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/supporter/3/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/3/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/supporter/4/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/4/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/supporter/5/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/5/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/supporter/6/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/6/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/supporter/7/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/7/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/supporter/8/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/8/avatar.svg"></a> <a href="https://opencollective.com/ccxt/tiers/supporter/9/website" target="_blank"><img src="https://opencollective.com/ccxt/tiers/supporter/9/avatar.svg"></a> ### Backers Thank you to all our backers! [[Become a backer](https://opencollective.com/ccxt#backer)] <a href="https://opencollective.com/ccxt#backers" target="_blank"><img src="https://opencollective.com/ccxt/tiers/backer.svg?width=890"></a> Thank you! ## Social - <sub>[![Twitter](https://img.shields.io/twitter/follow/ccxt_official?style=social)](https://twitter.com/ccxt_official)</sub> Follow us on Twitter - <sub>[![Medium](https://img.shields.io/badge/read-our%20blog-black?logo=medium)](https://medium.com/@ccxt)</sub> Read our blog on Medium - <sub>[![Discord](https://img.shields.io/discord/690203284119617602?logo=discord&logoColor=white)](https://discord.gg/dhzSKYU)</sub> Join our Discord - <sub>[![Telegram Announcements](https://img.shields.io/badge/CCXT-Channel-blue?logo=telegram)](https://t.me/ccxt_announcements)</sub> CCXT Channel on Telegram (important announcements) - <sub>[![Telegram Chat](https://img.shields.io/badge/CCXT-Chat-blue?logo=telegram)](https://t.me/ccxt_chat)</sub> CCXT Chat on Telegram (technical support) ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=ccxt/ccxt&type=Date)](https://star-history.com/#ccxt/ccxt&Date) ## Disclaimer CCXT is not a service nor a server. CCXT is a software. **CCXT is a free open source non-custodian API broker software under MIT license**. - **Non-custodian** means CCXT is not an intermediary in trading, it does not hold traders' money at any point in time, traders install CCXT and use CCXT to talk to exchanges directly. - **MIT license** means CCXT can be used for any purpose, but use at your own risk without any warranties. - **API broker** means CCXT is funded with rebates from exchanges' API broker programs and it is an official API broker with many exchanges, all rebates and related fees are handled by the exchanges solely in accordance with exchanges' respective terms and conditions established by each partner exchange. - **Free software** means CCXT is free to use and has no hidden fees, with CCXT traders pay the same trading fees they would pay to the exchanges directly. - **Open source** means anyone is allowed to use it, to look inside the code and to change everything, including other brokers. *CCXT has joined Hyperliquid’s Builder Codes program (see announcement) and may also utilize its referral code, which offers users a 4% fee discount on their first 25 million in trading volume.* ## Contact Us For business inquiries: [email protected]

Crypto & Blockchain API Tools
42.9K Github Stars
node-binance-api
Open Source

node-binance-api

<!-- [![Binance Community API](https://cdn.discordapp.com/attachments/569865969120575519/718166995354255370/binance-api-black.png)](https://dev.binance.vision/) --> <!-- ![Last Commit](https://badgen.net/github/last-commit/jaggedsoft/node-binance-api?scale=2&label=🟣%20Updated&labelColor=black&color=448AFF&cache=9999) --> <!-- [![npm downloads](https://img.shields.io/npm/dt/node-binance-api.svg?maxAge=7200)](https://www.npmjs.com/package/node-binance-api) [![Build Status](https://travis-ci.org/jaggedsoft/node-binance-api.svg?branch=master&style=flat-square)](https://travis-ci.org/jaggedsoft/node-binance-api) [![Coverage Status](https://coveralls.io/repos/github/jaggedsoft/node-binance-api/badge.svg?branch=master&style=flat-square)](https://coveralls.io/github/jaggedsoft/node-binance-api) [![CodeCov](https://codecov.io/gh/jaggedsoft/node-binance-api/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/github/jaggedsoft/node-binance-api/) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/996757cec66542c0a64fca2b4cf8a936)](https://www.codacy.com/app/jaggedsoft/node-binance-api?utm_source=github.com&utm_medium=referral&utm_content=jaggedsoft/node-binance-api&utm_campaign=Badge_Coverage) [![Codacy Grade](https://api.codacy.com/project/badge/Grade/996757cec66542c0a64fca2b4cf8a936)](https://www.codacy.com/app/jaggedsoft/node-binance-api) https://img.shields.io/npm/dm/node-binance-api.svg?labelColor=blueviolet) https://badgen.net/npm/dm/node-binance-api?labelColor=7C4DFF&color=green&scale=2&label=Downloads&icon=bitcoin 🟣 Used by 727 https://badgen.net/github/dependents-repo/jaggedsoft/node-binance-api?labelColor=blue&color=purple&label=Used%20by&icon=github 🧪 Releases 87 https://badgen.net/github/releases/jaggedsoft/node-binance-api?scale=2&icon=github&labelColor=purple&color=green&label=%F0%9F%A7%AA%20Release 🎈💡 Merged PRs 79 https://badgen.net/github/merged-prs/jaggedsoft/node-binance-api ⭐ Stars 630 https://badgen.net/github/stars/jaggedsoft/node-binance-api?scale=2&label=%E2%AD%90Stars&labelColor=black&color=purple ✅ship Commits 568 https://badgen.net/github/commits/micromatch/micromatch?label=%E2%9C%A8Commits&labelColor=black&color=red ⚡ Updated about 16 hours ago https://badgen.net/github/last-commit/jaggedsoft/node-binance-api?scale=2&icon=bitcoin-lightning&label=Updated&labelColor=black&color=448AFF 👀👁 Watchers 48 https://badgen.net/github/watchers/jaggedsoft/node-binance-api color=blueviolet 🔵q --> <!-- [![Latest Version](https://img.shields.io/github/release/jaggedsoft/node-binance-api.svg?style=flat-square&labelColor=blueviolet&label=release)](https://github.com/jaggedsoft/node-binance-api/releases) [![GitHub last commit](https://img.shields.io/github/last-commit/jaggedsoft/node-binance-api.svg?maxAge=2400&labelColor=333&label=🟣%20updated)](#) [![Monthly Downloads](https://img.shields.io/npm/dm/node-binance-api.svg?labelColor=29B6F6&color=3D5AFE&label=downloads&logo=bitcoin-lightning)](https://npm-stat.com/charts.html?package=node-binance-api&from=2017-07-01&to=2020-07-01) --> # Node Binance API [![telegram](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/nodebinanceapi) [![Yearly Downloads](https://img.shields.io/npm/dy/node-binance-api.svg)](https://www.npmjs.com/package/node-binance-api) [![CCXT on X](https://img.shields.io/twitter/follow/ccxt_official.svg?style=social)](https://x.com/ccxt_official) This project is designed to help you make your own projects that interact with the [Binance API](https://github.com/binance-exchange/binance-official-api-docs). You can stream candlestick chart data, market depth, or use other advanced features such as setting stop losses and iceberg orders. This project seeks to have complete API coverage including WebSockets. <b><p align="center"> <a href="#binance-futures-api" style="color:#f9c513">Futures API</a> &amp; <a href="#futures-websocket-streams" style="color:#f9c513">Streams</a> • <a href="#binance-api-spot-trading" style="color:#282828">Spot Trading API</a> &amp; <a href="#websockets-implementation" style="color:#282828">Streams</a> • <a href="#binance-margin-api">Margin API</a> • <a href="#binance-lending-api">Lending API</a><br/> <a href="https://github.com/jaggedsoft/node-binance-api/tree/master/examples">Examples</a> • <a href="#troubleshooting">Troubleshooting</a> • <a href="https://github.com/jaggedsoft/node-binance-api/releases">Changelog</a> • <a href="https://t.me/binance_api_english">Support</a> </p></b> #### Installation ``` npm install node-binance-api ``` [![NPM](https://nodei.co/npm/node-binance-api.png?compact=false)](https://npmjs.org/package/node-binance-api) <!-- [![npm install node-binance-api](https://nodei.co/npm/node-binance-api.png?mini=true)](https://npmjs.org/package/node-binance-api) --> #### Community Telegram Chat https://t.me/nodebinanceapi **This project is powered by** <a href="https://github.com/ccxt/ccxt"><img src="https://avatars.githubusercontent.com/u/31901609" width=4% height=4%></a> Actively maintained, typed, and safe SDK for the Binance REST APIs and Websockets. Supports ESM and CJS out of the box. ### Features - Spot, Margin, Futures and Delivery API (including the new algoOrder service) - Demo trading support - Testnet support (deprecated) - Proxy support (REST and WS, including the new WS-API) - Customizable HTTP headers - Customizable request parameters - RSA/ECDSA support - Portfolio Margin API *\*soon*\* - Websocket handling with automatic reconnection - RecvWindow and automatic timestamps generation - Ability to call any endpoint, even if not supported directly by the library - Overridable hostnames (.us, .jp, etc) - Verbose mode to debug http requests/responses ### Upgrading to v1.0.0+ **We highly advise you to update from 0.0.X but minor adjustments might be needed.** The library was fully refactored to use a modern and typed JavaScript/Typescript version, using the built-in await/async syntax and unifying some methods' signatures. Some important changes include the removal of callbacks as parameters of REST methods, adaptation of signatures to directly receive some important request values (symbol, orderId, ...), among others. #### Getting started (ESM) ```javascript import Binance from 'node-binance-api'; async function run() { const exchange = new Binance(); const res = await exchange.futuresTime(); console.log( res ); } ``` #### Getting started (CJS) ```javascript const Binance = require('node-binance-api'); const binance = new Binance({ APIKEY: '<key>', APISECRET: '<secret>', test: true, // if you want to use the sandbox/testnet }); ``` # Binance Futures API #### Futures Prices ```js console.info( await binance.futuresPrices() ); ``` #### Futures Account Balances & Positions ```js console.info( await binance.futuresAccount() ); ``` #### Futures Balances ```js console.info( await binance.futuresBalance() ); ``` #### Futures Limit Buy ```js console.info( await binance.futuresBuy( 'LIMIT', 'BTCUSDT', 0.1, 8222 ) ); ``` #### Futures Limit Sell ```js console.info( await binance.futuresSell( 'LIMIT', 'BTCUSDT', 0.5, 11111 ) ); ``` #### Futures Market Buy ```js console.info( await binance.futuresMarketBuy( 'BNBUSDT', 5 ) ); ``` #### Futures Market Sell ```js console.info( await binance.futuresMarketSell( 'TRXUSDT', 1 ) ); ``` #### Futures Place Multiple Orders ```js let orders = [ { symbol:"BTCUSDT", side: "BUY", type: "MARKET", quantity: "0.01", }, { symbol:"BNBUSDT", side: "SELL", type: "MARKET", quantity: "0.5", } ] console.info( await binance.futuresMultipleOrders(orders) ); ``` #### Futures Market Orders: Get the fill price using newOrderRespType ```js console.info( await binance.futuresMarketBuy( 'BNBUSDT', amount, { newOrderRespType: 'RESULT' } ) ); ``` #### Futures reduceOnly Order Example ```js if ( side == 'LONG' ) order = await binance.futuresMarketSell( obj.symbol, amount, {reduceOnly: true} ) else order = await binance.futuresMarketBuy( obj.symbol, amount, {reduceOnly: true} ) ``` #### Get Futures Positions ```js console.info( await binance.futuresPositionRisk() ); ``` <details> <summary>View Example</summary> ```js let position_data = await binance.futuresPositionRisk(), markets = Object.keys( position_data ); for ( let market of markets ) { let obj = position_data[market], size = Number( obj.positionAmt ); if ( size == 0 ) continue; console.info( `${leverage}x\t${market}\t${obj.unRealizedProfit}` ); //console.info( obj ); //positionAmt entryPrice markPrice unRealizedProfit liquidationPrice leverage marginType isolatedMargin isAutoAddMargin maxNotionalValue } ``` </details> #### Adjust Leverage (1-125x) ```js console.info( await binance.futuresLeverage( 'ETHUSDT', 50 ) ); ``` #### Adjust Margin Type (ISOLATED, CROSSED) ```js console.info( await binance.futuresMarginType( 'BTCUSDT', 'ISOLATED' ) ); ``` #### Adjust Position Margin ```js // Type: 1: Add postion margin,2: Reduce postion margin console.info( await binance.futuresPositionMargin( "TRXUSDT", amount, type ) ); ``` ```js console.info( await binance.futuresTime() ); console.info( await binance.futuresExchangeInfo() ); console.info( await binance.futuresCandles( "TRXUSDT", "1m" ) ); console.info( await binance.futuresDepth( "ADAUSDT" ) ); console.info( await binance.futuresQuote() ); console.info( await binance.futuresQuote( "BCHUSDT" ) ); console.info( await binance.futuresDaily() ); console.info( await binance.futuresOpenInterest( "BTCUSDT" ) ); console.info( await binance.futuresMarkPrice() ); console.info( await binance.futuresMarkPrice( "ETHUSDT" ) ); console.info( await binance.futuresTrades( "LTCUSDT" ) ); console.info( await binance.futuresAggTrades( "XTZUSDT" ) ); console.info( await binance.futuresLiquidationOrders() ); console.info( await binance.futuresFundingRate() ); console.info( await binance.futuresHistoricalTrades( "XMRUSDT" ) ); console.info( await binance.futuresLeverageBracket( "LINKUSDT" ) ); console.info( await binance.futuresIncome() ); console.info( await binance.futuresCancelAll( "BTCUSDT" ) ); console.info( await binance.futuresCancel( "BTCUSDT", "1025137386" ) ); console.info( await binance.futuresCountdownCancelAll( "BTCUSDT", 45000 ) ); console.info( await binance.futuresOrderStatus( "BTCUSDT", "1025137386") ); console.info( await binance.futuresOpenOrders() ); console.info( await binance.futuresOpenOrders( "BTCUSDT" ) ); console.info( await binance.futuresAllOrders() ); console.info( await binance.futuresAllOrders( "BTCUSDT" ) ); console.info( await binance.futuresUserTrades( "BTCUSDT" ) ); console.info( await binance.futuresGetDataStream() ); console.info( await binance.futuresPositionMarginHistory( "TRXUSDT" ) ); console.info( await binance.futuresPublicRequest( 'v1/time' ) ); console.info( await binance.spotPublicRequest( 'v1/time')); // call any method by providing the path console.info( await binance.privateFuturesRequest('v3/account')); // custom futures private call // Batch orders, remaining WebSocket streams, and better documentation will be come later ``` ### Proxy support In some specific cases using a proxy is required, for example: - Exchange is not available in your location - You need to make a large amount of requests without getting blocked - ... This package supports the following proxy types, `httpsProxy`, `proxyUrl` and `socksProxy` #### httpsProxy To set a real http(s) proxy for your scripts, you need to have an access to a remote http or https proxy, so calls will be made directly to the target exchange, tunneled through your proxy server: ```Js client.httpsProxy = 'http://1.2.3.4:8080/'; ``` #### proxyUrl This property prepends an url to API requests. It might be useful for simple redirection or bypassing CORS browser restriction. ```Js client.proxyUrl = 'YOUR_PROXY_URL'; ``` #### socksProxy Tou can also use socks proxy with the following format: ```Js client.socksProxy = 'socks5://1.2.3.4:8080/'; ``` #### Futures Historical Bulk Data Download API ##### Get Download ID ```js console.info( await binance.futuresHistDataId( "BTCUSDT", { startTime: new Date().getTime() - 24 * 60 * 60 * 1000, endTime: new Date().getTime(), dataType: 'T_TRADE' } ) ) ``` ##### Get Download Link ```js console.info( await binance.futuresDownloadLink(7343) ) ``` # Futures WebSocket Streams #### Futures miniTicker stream for all symbols ```js binance.futuresMiniTickerStream( miniTicker => { console.info( miniTicker ); } ); ``` #### Futures miniTicker stream for a symbol ```js binance.futuresMiniTickerStream( 'BTCUSDT', console.log ); ``` #### Futures bookTicker stream for all symbols ```js binance.futuresBookTickerStream( console.log ); ``` #### Futures bookTicker stream for a symbol ```js binance.futuresBookTickerStream( 'BTCUSDT', console.log ); ``` #### Futures prevDay ticker stream for all symbols ```js binance.futuresTickerStream( console.log ); ``` #### Futures prevDay ticker stream for a symbol ```js binance.futuresTickerStream( 'BTCUSDT', console.log ); ``` #### Futures mark price stream for all symbols ```js binance.futuresMarkPriceStream( console.log ); ``` #### Futures mark price stream for a symbol ```js binance.futuresMarkPriceStream( 'BTCUSDT', console.log ); ``` #### Futures aggregate trade stream for a symbol ```js binance.futuresAggTradeStream( 'BTCUSDT', console.log ); ``` #### Futures complete chart cache ```js binance.futuresChart( 'BTCUSDT', '1m', console.log ); ``` #### Futures Liquidation Stream for all symbols ```js binance.futuresLiquidationStream( console.log ); ``` #### Futures Liquidation Stream for a symbol ```js binance.futuresLiquidationStream( 'BTCUSDT', console.log ); ``` #### Connect to a custom endpoint. Easier shortcut functions will come later ```js binance.futuresSubscribe( 'btcusdt@kline_4h', console.log ); ``` #### Terminate an existing socket ```js binance.futuresTerminate( 'btcusdt@kline_4h' ); ``` #### Return active sockets and subscriptions ```js console.log( binance.futuresSubscriptions() ); ``` # Delivery API (Futures w/Expiration Date) ``` deliveryBuy deliverySell deliveryMarketBuy deliveryMarketSell deliveryPrices deliveryDaily deliveryOpenInterest deliveryExchangeInfo deliveryOpenOrders deliveryAllOrders deliveryCandles deliveryIndexKlines deliveryContinuousKlines deliveryMarkPriceKlines deliveryMarkPrice deliveryHistoricalTrades deliveryTrades deliveryAggTrades deliveryUserTrades deliveryLiquidationOrders deliveryPositionRisk deliveryLeverage deliveryMarginType deliveryPositionMargin deliveryPositionMarginHistory deliveryIncome deliveryBalance deliveryAccount deliveryDepth deliveryQuote deliveryLeverageBracket deliveryOrderStatus deliveryCancel deliveryCancelAll deliveryCountdownCancelAll deliveryOrder deliveryGetDataStream deliveryCloseDataStream deliveryKeepDataStream deliveryPing deliveryTime deliveryOrder ``` # Binance API (Spot Trading) #### Getting latest price of all symbols ```javascript let ticker = await binance.prices(); console.info(`Price of BNB: ${ticker.BNBUSDT}`); ``` #### Getting latest price of a symbol ```js binance.prices('BNBBTC', (error, ticker) => { console.info("Price of BNB: ", ticker.BNBBTC); }); ``` <details> <summary>View Response</summary> ```js { ETHBTC: '0.07003500', LTCBTC: '0.01176700', BNBBTC: '0.00035735', NEOBTC: '0.00809500', QTUMETH: '0.03851200', EOSETH: '0.00189600', SNTETH: '0.00008595', BNTETH: '0.00738800', BCCBTC: '0.08104000', GASBTC: '0.00629800', BNBETH: '0.00509495', BTMETH: '0.00018900', HCCBTC: '0.00000180', BTCUSDT: '4464.44000000', ETHUSDT: '312.89000000', HSRBTC: '0.00289000', OAXETH: '0.00180000', DNTETH: '0.00014190', MCOETH: '0.02358300', ICNETH: '0.00557000', ELCBTC: '0.00000053', MCOBTC: '0.00166900', WTCBTC: '0.00184138', WTCETH: '0.02601700', LLTBTC: '0.00001669', LRCBTC: '0.00001100', LRCETH: '0.00016311', QTUMBTC: '0.00271600', YOYOBTC: '0.00000481', OMGBTC: '0.00187800', OMGETH: '0.02677400', ZRXBTC: '0.00004319', ZRXETH: '0.00060800', STRATBTC: '0.00087800', STRATETH: '0.01218800', SNGLSBTC: '0.00003649', SNGLSETH: '0.00051280', BQXBTC: '0.00013150', BQXETH: '0.00184240', KNCBTC: '0.00038969', KNCETH: '0.00550320', FUNBTC: '0.00000573', FUNETH: '0.00008433', SNMBTC: '0.00003176', SNMETH: '0.00047119', NEOETH: '0.11500200', IOTABTC: '0.00012136', IOTAETH: '0.00171001', LINKBTC: '0.00010646', LINKETH: '0.00150999', XVGBTC: '0.00000145', XVGETH: '0.00002059', CTRBTC: '0.00025532', CTRETH: '0.00375180', SALTBTC: '0.00080100', SALTETH: '0.01140000', MDABTC: '0.00057002', MDAETH: '0.00819490' } //Price of BNB: 0.00035735 ``` </details> #### Getting list of current balances ```javascript binance.balance((error, balances) => { if ( error ) return console.error(error); console.info("balances()", balances); console.info("ETH balance: ", balances.ETH.available); }); // If you have problems with this function, // see Troubleshooting at the bottom of this page. ``` <details> <summary>View Response</summary> ```js { BTC: { available: '0.77206464', onOrder: '0.00177975' }, LTC: { available: '0.00000000', onOrder: '0.00000000' }, ETH: { available: '1.14109900', onOrder: '0.00000000' }, BNC: { available: '0.00000000', onOrder: '0.00000000' }, ICO: { available: '0.00000000', onOrder: '0.00000000' }, NEO: { available: '0.00000000', onOrder: '0.00000000' }, BNB: { available: '41.33761879', onOrder: '0.00000000' }, QTUM: { available: '0.00000000', onOrder: '0.00000000' }, EOS: { available: '0.00000000', onOrder: '0.00000000' }, SNT: { available: '0.00000000', onOrder: '0.00000000' }, BNT: { available: '0.00000000', onOrder: '0.00000000' }, GAS: { available: '0.00000000', onOrder: '0.00000000' }, BCC: { available: '0.00000000', onOrder: '0.00000000' }, BTM: { available: '0.00000000', onOrder: '0.00000000' }, USDT: { available: '0.00000000', onOrder: '0.00000000' }, HCC: { available: '0.00000000', onOrder: '0.00000000' }, HSR: { available: '0.00000000', onOrder: '0.00000000' }, OAX: { available: '0.00000000', onOrder: '0.00000000' }, DNT: { available: '0.00000000', onOrder: '0.00000000' }, MCO: { available: '0.00000000', onOrder: '0.00000000' }, ICN: { available: '0.00000000', onOrder: '0.00000000' }, ELC: { available: '0.00000000', onOrder: '0.00000000' }, PAY: { available: '0.00000000', onOrder: '0.00000000' }, ZRX: { available: '0.00000000', onOrder: '0.00000000' }, OMG: { available: '0.00000000', onOrder: '0.00000000' }, WTC: { available: '0.00000000', onOrder: '0.00000000' }, LRX: { available: '0.00000000', onOrder: '0.00000000' }, YOYO: { available: '0.00000000', onOrder: '0.00000000' }, LRC: { available: '0.00000000', onOrder: '0.00000000' }, LLT: { available: '0.00000000', onOrder: '0.00000000' }, TRX: { available: '0.00000000', onOrder: '0.00000000' }, FID: { available: '0.00000000', onOrder: '0.00000000' }, SNGLS: { available: '0.00000000', onOrder: '0.00000000' }, STRAT: { available: '0.00000000', onOrder: '0.00000000' }, BQX: { available: '0.00000000', onOrder: '0.00000000' }, FUN: { available: '0.00000000', onOrder: '0.00000000' }, KNC: { available: '0.00000000', onOrder: '0.00000000' }, CDT: { available: '0.00000000', onOrder: '0.00000000' }, XVG: { available: '0.00000000', onOrder: '0.00000000' }, IOTA: { available: '0.00000000', onOrder: '0.00000000' }, SNM: { available: '0.76352833', onOrder: '0.00000000' }, LINK: { available: '0.00000000', onOrder: '0.00000000' }, CVC: { available: '0.00000000', onOrder: '0.00000000' }, TNT: { available: '0.00000000', onOrder: '0.00000000' }, REP: { available: '0.00000000', onOrder: '0.00000000' }, CTR: { available: '0.00000000', onOrder: '0.00000000' }, MDA: { available: '0.00000000', onOrder: '0.00000000' }, MTL: { available: '0.00000000', onOrder: '0.00000000' }, SALT: { available: '0.00000000', onOrder: '0.00000000' }, NULS: { available: '0.00000000', onOrder: '0.00000000' } } //ETH balance: 1.14109900 ``` </details> #### Getting bid/ask prices for a symbol ```js binance.bookTickers('BNBBTC', (error, ticker) => { console.info("bookTickers", ticker); }); ``` <details> <summary>View Response</summary> ```js { "symbol": "BNBBTC", "bidPrice": "4.00000000", "bidQty": "431.00000000", "askPrice": "4.00000200", "askQty": "9.00000000" } // from: https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#symbol-order-book-ticker ``` </details> #### Getting bid/ask prices for all symbols ```js binance.bookTickers((error, ticker) => { console.info("bookTickers()", ticker); console.info("Price of BNB: ", ticker.BNBBTC); }); ``` <details> <summary>View Response</summary> ```js { ETHBTC: { bid: '0.06201000', bids: '1.28200000', ask: '0.06201300', asks: '0.34200000' }, LTCBTC: { bid: '0.01042000', bids: '41.45000000', ask: '0.01048700', asks: '16.81000000' }, BNBBTC: { bid: '0.00028754', bids: '727.00000000', ask: '0.00028755', asks: '400.00000000' }, NEOBTC: { bid: '0.00601800', bids: '16.82000000', ask: '0.00603700', asks: '73.43000000' }, QTUMETH: { bid: '0.04062900', bids: '1.30000000', ask: '0.04075300', asks: '0.58000000' }, EOSETH: { bid: '0.00191400', bids: '202.53000000', ask: '0.00192500', asks: '26.08000000' }, SNTETH: { bid: '0.00007610', bids: '403.00000000', ask: '0.00007638', asks: '19850.00000000' }, BNTETH: { bid: '0.00736800', bids: '7.82000000', ask: '0.00745900', asks: '177.32000000' }, BCCBTC: { bid: '0.06862000', bids: '1.56100000', ask: '0.06893600', asks: '0.81100000' }, GASBTC: { bid: '0.00451700', bids: '44.00000000', ask: '0.00489700', asks: '44.95000000' }, BNBETH: { bid: '0.00462592', bids: '32.00000000', ask: '0.00467982', asks: '57.00000000' }, BTMETH: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, HCCBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, BTCUSDT: { bid: '4786.01000000', bids: '0.58627700', ask: '4796.10000000', asks: '0.28486400' }, ETHUSDT: { bid: '297.01000000', bids: '7.17846000', ask: '297.90000000', asks: '0.30742000' }, HSRBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, OAXETH: { bid: '0.00156200', bids: '96.00000000', ask: '0.00169900', asks: '552.90000000' }, DNTETH: { bid: '0.00011782', bids: '1273.00000000', ask: '0.00012045', asks: '238.00000000' }, MCOETH: { bid: '0.02651200', bids: '0.94000000', ask: '0.02681200', asks: '8.59000000' }, ICNETH: { bid: '0.00484600', bids: '448.76000000', ask: '0.00490000', asks: '0.01000000' }, ELCBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, MCOBTC: { bid: '0.00164600', bids: '1.00000000', ask: '0.00164700', asks: '12.11000000' }, WTCBTC: { bid: '0.00132101', bids: '124.00000000', ask: '0.00133200', asks: '98.00000000' }, WTCETH: { bid: '0.02130000', bids: '784.35000000', ask: '0.02140800', asks: '10.70000000' }, LLTBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, LRCBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, LRCETH: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, QTUMBTC: { bid: '0.00252800', bids: '123.48000000', ask: '0.00253200', asks: '10.50000000' }, YOYOBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, OMGBTC: { bid: '0.00164900', bids: '25.94000000', ask: '0.00166400', asks: '0.90000000' }, OMGETH: { bid: '0.02660000', bids: '9.86000000', ask: '0.02698200', asks: '43.21000000' }, ZRXBTC: { bid: '0.00003936', bids: '117.00000000', ask: '0.00003982', asks: '8596.00000000' }, ZRXETH: { bid: '0.00062801', bids: '239.00000000', ask: '0.00063595', asks: '2446.00000000' }, STRATBTC: { bid: '0.00070600', bids: '43.43000000', ask: '0.00070900', asks: '15.00000000' }, STRATETH: { bid: '0.01092100', bids: '9.00000000', ask: '0.01162700', asks: '47.90000000' }, SNGLSBTC: { bid: '0.00003162', bids: '366.00000000', ask: '0.00003183', asks: '308.00000000' }, SNGLSETH: { bid: '0.00050064', bids: '300.00000000', ask: '0.00051543', asks: '64.00000000' }, BQXBTC: { bid: '0.00013334', bids: '13.00000000', ask: '0.00013889', asks: '1224.00000000' }, BQXETH: { bid: '0.00200740', bids: '990.00000000', ask: '0.00228890', asks: '80.00000000' }, KNCBTC: { bid: '0.00029509', bids: '300.00000000', ask: '0.00029842', asks: '4.00000000' }, KNCETH: { bid: '0.00481840', bids: '411.00000000', ask: '0.00484440', asks: '10.00000000' }, FUNBTC: { bid: '0.00000461', bids: '217.00000000', ask: '0.00000465', asks: '16668.00000000' }, FUNETH: { bid: '0.00007486', bids: '2004.00000000', ask: '0.00007617', asks: '1419.00000000' }, SNMBTC: { bid: '0.00002462', bids: '6922.00000000', ask: '0.00002495', asks: '404.00000000' }, SNMETH: { bid: '0.00040181', bids: '373.00000000', ask: '0.00043404', asks: '9281.00000000' }, NEOETH: { bid: '0.09610400', bids: '8.02000000', ask: '0.09891100', asks: '5.00000000' }, IOTABTC: { bid: '0.00009674', bids: '206.00000000', ask: '0.00009721', asks: '269.00000000' }, IOTAETH: { bid: '0.00155061', bids: '1231.00000000', ask: '0.00158100', asks: '22.00000000' }, LINKBTC: { bid: '0.00007670', bids: '2278.00000000', ask: '0.00007697', asks: '8000.00000000' }, LINKETH: { bid: '0.00123000', bids: '3492.00000000', ask: '0.00123999', asks: '4000.00000000' }, XVGBTC: { bid: '0.00000111', bids: '47758.00000000', ask: '0.00000113', asks: '215443.00000000' }, XVGETH: { bid: '0.00001801', bids: '8329.00000000', ask: '0.00001842', asks: '85146.00000000' }, CTRBTC: { bid: '0.00019801', bids: '650.00000000', ask: '0.00021103', asks: '49.00000000' }, CTRETH: { bid: '0.00320200', bids: '538.00000000', ask: '0.00351990', asks: '2081.00000000' }, SALTBTC: { bid: '0.00063900', bids: '57.13000000', ask: '0.00064000', asks: '96.48000000' }, SALTETH: { bid: '0.01030200', bids: '728.27000000', ask: '0.01038900', asks: '0.04000000' }, MDABTC: { bid: '0.00039031', bids: '282.00000000', ask: '0.00039994', asks: '540.00000000' }, MDAETH: { bid: '0.00635500', bids: '432.00000000', ask: '0.00641990', asks: '185.00000000' }, MTLBTC: { bid: '0.00145500', bids: '45.00000000', ask: '0.00145600', asks: '42.12000000' }, MTLETH: { bid: '0.02300100', bids: '96.10000000', ask: '0.02477400', asks: '131.90000000' }, SUBBTC: { bid: '0.00003250', bids: '4474.00000000', ask: '0.00003380', asks: '3878.00000000' }, SUBETH: { bid: '0.00053000', bids: '740.00000000', ask: '0.00053501', asks: '580.00000000' } } /* Price of BNB: { bid: '0.00028754', bids: '727.00000000', ask: '0.00028755', asks: '400.00000000' } */ ``` </details> #### Get all bid/ask prices ```javascript binance.bookTickers((error, ticker) => { console.info("bookTickers", ticker); }); ``` <details> <summary>View Response</summary> ```js { ETHBTC: { bid: '0.06187700', bids: '0.64000000', ask: '0.06188300', asks: '6.79700000' }, LTCBTC: { bid: '0.01036000', bids: '14.96000000', ask: '0.01037000', asks: '0.60000000' }, BNBBTC: { bid: '0.00028226', bids: '802.00000000', ask: '0.00028268', asks: '584.00000000' }, NEOBTC: { bid: '0.00595600', bids: '33.00000000', ask: '0.00595900', asks: '37.00000000' }, QTUMETH: { bid: '0.03958000', bids: '1.42000000', ask: '0.04024300', asks: '7.46000000' }, EOSETH: { bid: '0.00192600', bids: '29.31000000', ask: '0.00193500', asks: '418.91000000' }, SNTETH: { bid: '0.00007607', bids: '8864.00000000', ask: '0.00007682', asks: '1311.00000000' }, BNTETH: { bid: '0.00740200', bids: '1.36000000', ask: '0.00746800', asks: '419.86000000' }, BCCBTC: { bid: '0.06786500', bids: '0.18600000', ask: '0.06835400', asks: '0.72600000' }, GASBTC: { bid: '0.00435500', bids: '332.73000000', ask: '0.00435600', asks: '18.31000000' }, BNBETH: { bid: '0.00456443', bids: '4.00000000', ask: '0.00461795', asks: '192.00000000' }, BTMETH: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, HCCBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, BTCUSDT: { bid: '4801.05000000', bids: '0.82289400', ask: '4812.00000000', asks: '1.04753200' }, ETHUSDT: { bid: '296.32000000', bids: '3.24294000', ask: '297.81000000', asks: '17.69901000' }, HSRBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, OAXETH: { bid: '0.00154500', bids: '422.64000000', ask: '0.00169200', asks: '159.94000000' }, DNTETH: { bid: '0.00012059', bids: '434.00000000', ask: '0.00012100', asks: '8311.00000000' }, MCOETH: { bid: '0.02566000', bids: '5.85000000', ask: '0.02651200', asks: '4.37000000' }, ICNETH: { bid: '0.00489000', bids: '232.97000000', ask: '0.00500000', asks: '0.01000000' }, ELCBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, MCOBTC: { bid: '0.00162700', bids: '2.87000000', ask: '0.00163800', asks: '0.70000000' }, WTCBTC: { bid: '0.00129604', bids: '600.00000000', ask: '0.00131600', asks: '1.00000000' }, WTCETH: { bid: '0.02080000', bids: '30.00000000', ask: '0.02097600', asks: '24.00000000' }, LLTBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, LRCBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, LRCETH: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, QTUMBTC: { bid: '0.00245100', bids: '43.11000000', ask: '0.00248500', asks: '74.96000000' }, YOYOBTC: { bid: '0.00000000', bids: '0.00000000', ask: '0.00000000', asks: '0.00000000' }, OMGBTC: { bid: '0.00160700', bids: '300.00000000', ask: '0.00161300', asks: '36.05000000' }, OMGETH: { bid: '0.02597100', bids: '4.92000000', ask: '0.02633200', asks: '19.00000000' }, ZRXBTC: { bid: '0.00003852', bids: '9.00000000', ask: '0.00003912', asks: '103.00000000' }, ZRXETH: { bid: '0.00062997', bids: '645.00000000', ask: '0.00062998', asks: '5376.00000000' }, STRATBTC: { bid: '0.00069200', bids: '50.50000000', ask: '0.00070000', asks: '6.54000000' }, STRATETH: { bid: '0.01080400', bids: '5.00000000', ask: '0.01200000', asks: '5.88000000' }, SNGLSBTC: { bid: '0.00003121', bids: '726.00000000', ask: '0.00003161', asks: '153.00000000' }, SNGLSETH: { bid: '0.00046686', bids: '4782.00000000', ask: '0.00051906', asks: '32.00000000' }, BQXBTC: { bid: '0.00011512', bids: '87.00000000', ask: '0.00011840', asks: '133.00000000' }, BQXETH: { bid: '0.00183080', bids: '1051.00000000', ask: '0.00195000', asks: '626.00000000' }, KNCBTC: { bid: '0.00027859', bids: '7.00000000', ask: '0.00028462', asks: '35.00000000' }, KNCETH: { bid: '0.00452830', bids: '13.00000000', ask: '0.00454970', asks: '35.00000000' }, FUNBTC: { bid: '0.00000464', bids: '753.00000000', ask: '0.00000465', asks: '13924.00000000' }, FUNETH: { bid: '0.00007126', bids: '44131.00000000', ask: '0.00007617', asks: '1419.00000000' }, SNMBTC: { bid: '0.00002489', bids: '564.00000000', ask: '0.00002559', asks: '2553.00000000' }, SNMETH: { bid: '0.00040060', bids: '374.00000000', ask: '0.00041494', asks: '7624.00000000' }, NEOETH: { bid: '0.09604700', bids: '22.05000000', ask: '0.09800000', asks: '0.31000000' }, IOTABTC: { bid: '0.00009515', bids: '3.00000000', ask: '0.00009529', asks: '147.00000000' }, IOTAETH: { bid: '0.00150002', bids: '4311.00000000', ask: '0.00155216', asks: '7.00000000' }, LINKBTC: { bid: '0.00007601', bids: '4337.00000000', ask: '0.00007630', asks: '525.00000000' }, LINKETH: { bid: '0.00121903', bids: '3784.00000000', ask: '0.00122965', asks: '200.00000000' }, XVGBTC: { bid: '0.00000113', bids: '470101.00000000', ask: '0.00000114', asks: '147728.00000000' }, XVGETH: { bid: '0.00001813', bids: '8274.00000000', ask: '0.00001843', asks: '8320.00000000' }, CTRBTC: { bid: '0.00020202', bids: '625.00000000', ask: '0.00020649', asks: '1143.00000000' }, CTRETH: { bid: '0.00330510', bids: '387.00000000', ask: '0.00339330', asks: '436.00000000' }, SALTBTC: { bid: '0.00063500', bids: '76.00000000', ask: '0.00064300', asks: '437.54000000' }, SALTETH: { bid: '0.01014200', bids: '202.79000000', ask: '0.01122600', asks: '1.36000000' }, MDABTC: { bid: '0.00038061', bids: '8.00000000', ask: '0.00041300', asks: '1772.00000000' }, MDAETH: { bid: '0.00655000', bids: '547.00000000', ask: '0.00660830', asks: '8814.00000000' }, MTLBTC: { bid: '0.00140600', bids: '0.11000000', ask: '0.00143800', asks: '12.00000000' }, MTLETH: { bid: '0.02300000', bids: '1166.86000000', ask: '0.02489500', asks: '13.98000000' }, SUBBTC: { bid: '0.00003580', bids: '7617.00000000', ask: '0.00003619', asks: '1052.00000000' }, SUBETH: { bid: '0.00056500', bids: '3649.00000000', ask: '0.00059988', asks: '3649.00000000' } } ``` </details> #### Get market depth for a symbol ```javascript binance.depth("BNBBTC", (error, depth, symbol) => { console.info(symbol+" market depth", depth); }); ``` <details> <summary>View Response</summary> ```js market depth for BNBBTC { bids: { '0.00022997': '49.00000000', '0.00022867': '11.00000000', '0.00022865': '1149.00000000', '0.00022810': '20.00000000', '0.00022800': '1000.00000000', '0.00022777': '1350.00000000', '0.00022774': '96.00000000', '0.00022765': '5.00000000', '0.00022741': '12.00000000', '0.00022705': '1372.00000000', '0.00022700': '402.00000000', '0.00022514': '756.00000000', '0.00022513': '761.00000000', '0.00022502': '2244.00000000', '0.00022501': '2190.00000000', '0.00022500': '5069.00000000', '0.00022419': '1871.00000000', '0.00022418': '1667.00000000', '0.00022167': '1889.00000000', '0.00022162': '1014.00000000', '0.00022112': '13563.00000000', '0.00022078': '4056.00000000', '0.00022000': '8060.00000000', '0.00021963': '13563.00000000', '0.00021850': '52.00000000', '0.00021800': '1282.00000000', '0.00021710': '102.00000000', '0.00021680': '100.00000000', '0.00021652': '29.00000000', '0.00021641': '154.00000000', '0.00021500': '1491.00000000', '0.00021471': '977.00000000', '0.00021405': '478.00000000', '0.00021400': '11.00000000', '0.00021314': '686.00000000', '0.00021219': '1089.00000000', '0.00021200': '767.00000000', '0.00021100': '5000.00000000', '0.00021011': '50.00000000', '0.00021000': '3468.00000000', '0.00020900': '169.00000000', '0.00020843': '90.00000000', '0.00020811': '200.00000000', '0.00020702': '50.00000000', '0.00020691': '283.00000000', '0.00020600': '3703.00000000', '0.00020500': '107.00000000', '0.00020450': '6363.00000000', '0.00020250': '301.00000000', '0.00020222': '200.00000000', '0.00020200': '123.00000000', '0.00020137': '50.00000000', '0.00020122': '727.00000000', '0.00020100': '6400.00000000', '0.00020088': '10.00000000', '0.00020020': '793.00000000', '0.00020010': '500.00000000', '0.00020009': '44.00000000', '0.00020001': '20020.00000000', '0.00020000': '45269.00000000', '0.00019990': '270.00000000', '0.00019880': '2117.00000000', '0.00019800': '1200.00000000', '0.00019783': '50.00000000', '0.00019702': '300.00000000', '0.00019686': '10.00000000', '0.00019600': '1025.00000000', '0.00019595': '139.00000000', '0.00019501': '3227.00000000', '0.00019500': '3832.00000000', '0.00019488': '82.00000000', '0.00019400': '1853.00000000', '0.00019293': '10.00000000', '0.00019289': '30.00000000', '0.00019234': '1999.00000000', '0.00019200': '4765.00000000', '0.00019190': '6.00000000', '0.00019100': '4353.00000000', '0.00019073': '12.00000000', '0.00019058': '28.00000000', '0.00019050': '718.00000000', '0.00019001': '20.00000000', '0.00019000': '39478.00000000', '0.00018907': '10.00000000', '0.00018888': '10045.00000000', '0.00018880': '15.00000000', '0.00018800': '3528.00000000', '0.00018700': '328.00000000', '0.00018600': '1000.00000000', '0.00018598': '2187.00000000', '0.00018538': '1383.00000000', '0.00018529': '10.00000000', '0.00018500': '1512.00000000', '0.00018253': '30.00000000', '0.00018200': '3000.00000000', '0.00018158': '10.00000000', '0.00018106': '250.00000000', '0.00018100': '4577.00000000', '0.00018011': '500.00000000', '0.00018000': '29832.00000000' }, asks: { '0.00022999': '32.00000000', '0.00023086': '583.00000000', '0.00023095': '1154.00000000', '0.00023119': '781.00000000', '0.00023120': '3401.00000000', '0.00023180': '4889.00000000', '0.00023185': '83.00000000', '0.00023211': '750.00000000', '0.00023339': '9273.00000000', '0.00023340': '474.00000000', '0.00023440': '500.00000000', '0.00023450': '1433.00000000', '0.00023500': '1480.00000000', '0.00023573': '87.00000000', '0.00023580': '518.00000000', '0.00023999': '863.00000000', '0.00024000': '275.00000000', '0.00024100': '60.00000000', '0.00024119': '3736.00000000', '0.00024180': '989.00000000', '0.00024350': '1285.00000000', '0.00024399': '500.00000000', '0.00024400': '2964.00000000', '0.00024419': '500.00000000', '0.00024500': '4499.00000000', '0.00024580': '542.00000000', '0.00024584': '6.00000000', '0.00024700': '250.00000000', '0.00024789': '2938.00000000', '0.00024790': '5535.00000000', '0.00024800': '499.00000000', '0.00024892': '2000.00000000', '0.00024920': '652.00000000', '0.00024972': '9242.00000000', '0.00024999': '1262.00000000', '0.00025000': '3739.00000000', '0.00025078': '250.00000000', '0.00025348': '1000.00000000', '0.00025499': '220.00000000', '0.00025500': '6029.00000000', '0.00025518': '10.00000000', '0.00025698': '17.00000000', '0.00025700': '250.00000000', '0.00025800': '265.00000000', '0.00025925': '20.00000000', '0.00025984': '1048.00000000', '0.00025985': '1048.00000000', '0.00025987': '1165.00000000', '0.00025990': '465.00000000', '0.00025994': '571.00000000', '0.00025995': '390.00000000', '0.00026000': '5033.00000000', '0.00026028': '10.00000000', '0.00026280': '40.00000000', '0.00026300': '13.00000000', '0.00026348': '50.00000000', '0.00026500': '38.00000000', '0.00026548': '10.00000000', '0.00026594': '51.00000000', '0.00026666': '15000.00000000', '0.00026700': '500.00000000', '0.00026800': '27.00000000', '0.00026900': '1000.00000000', '0.00026929': '50.00000000', '0.00026990': '270.00000000', '0.00027000': '8750.00000000', '0.00027199': '50.00000000', '0.00027300': '351.00000000', '0.00027429': '50.00000000', '0.00027480': '270.00000000', '0.00027500': '38.00000000', '0.00027690': '242.00000000', '0.00027700': '500.00000000', '0.00027789': '1317.00000000', '0.00027906': '1457.00000000', '0.00027912': '98.00000000', '0.00027949': '50.00000000', '0.00027950': '2000.00000000', '0.00027977': '96.00000000', '0.00027980': '1031.00000000', '0.00028000': '782.00000000', '0.00028300': '25.00000000', '0.00028500': '48.00000000', '0.00028590': '364.00000000', '0.00028680': '50.00000000', '0.00028699': '50.00000000', '0.00028700': '1600.00000000', '0.00028800': '3509.00000000', '0.00028890': '175.00000000', '0.00028900': '11474.00000000', '0.00028999': '10000.00000000', '0.00029000': '623.00000000', '0.00029100': '303.00000000', '0.00029141': '456.00000000', '0.00029200': '9999.00000000', '0.00029234': '104.00000000', '0.00029300': '200.00000000', '0.00029358': '325.00000000', '0.00029399': '153.00000000', '0.00029428': '100.00000000' } } ``` </details> #### Placing a LIMIT order ```javascript let quantity = 1, price = 0.069; binance.buy("ETHBTC", quantity, price); binance.sell("ETHBTC", quantity, price); ``` #### Placing a MARKET order ```javascript // These orders will be executed at current market price. let quantity = 1; binance.marketBuy("BNBBTC", quantity); binance.marketSell("ETHBTC", quantity); ``` #### LIMIT order with callback ```javascript let quantity = 5, price = 0.00402030; binance.buy("BNBETH", quantity, price, {type:'LIMIT'}, (error, response) => { console.info("Limit Buy response", response); console.info("order id: " + response.orderId); }); ``` <details> <summary>View Response</summary> ``` Limit Buy response { symbol: 'BNBETH', orderId: 4480717, clientOrderId: 'te38xGILZUXrPZHnTQPH6h', transactTime: 1509049732437, price: '0.00402030', origQty: '5.00000000', executedQty: '5.00000000', status: 'FILLED', timeInForce: 'GTC', type: 'LIMIT', side: 'BUY' } //order id: 4480717 ``` </details> #### Chaining orders together ```js let quantity = 1; binance.marketBuy("BNBBTC", quantity, (error, response) => { console.info("Market Buy response", response); console.info("order id: " + response.orderId); // Now you can limit sell with a stop loss, etc. }); ``` <details> <summary>View Response</summary> ``` Market Buy response { symbol: 'BNBETH', orderId: 4480553, clientOrderId: 'rCGiCG08PGy7AwvbrG5d83', transactTime: 1509049376261, price: '0.00000000', origQty: '1.00000000', executedQty: '1.00000000', status: 'FILLED', timeInForce: 'GTC', type: 'MARKET', side: 'BUY' } //order id: 4480553 ``` </details> #### Placing a STOP LOSS order ```javascript // When the stop is reached, a stop order becomes a market order // Note: You must also pass one of these type parameters: // STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT let type = "STOP_LOSS"; let quantity = 1; let price = 0.069; let stopPrice = 0.068; binance.sell("ETHBTC", quantity, price, {stopPrice: stopPrice, type: type}); ``` #### Placing an ICEBERG order ```javascript // Iceberg orders are intended to conceal the order quantity. let quantity = 1; let price = 0.069; binance.sell("ETHBTC", quantity, price, {icebergQty: 10}); ``` #### Cancel an order ```javascript binance.cancel("ETHBTC", orderid, (error, response, symbol) => { console.info(symbol+" cancel response:", response); }); ``` #### Cancel all open orders ```js console.info( await binance.cancelAll("XMRBTC") ); ``` #### Get open orders for a symbol ```javascript binance.openOrders("ETHBTC", (error, openOrders, symbol) => { console.info("openOrders("+symbol+")", openOrders); }); ``` #### Get list of all open orders ```javascript binance.openOrders(false, (error, openOrders) => { console.info("openOrders()", openOrders); }); ``` #### Check an order's status ```javascript let orderid = "7610385"; binance.orderStatus("ETHBTC", orderid, (error, orderStatus, symbol) => { console.info(symbol+" order status:", orderStatus); }); ``` #### Get your Trade History ```javascript binance.trades("SNMBTC", (error, trades, symbol) => { console.info(symbol+" trade history", trades); }); ``` <details> <summary>View Response</summary> ```js [ { id: 9572, orderId: 47884, price: '0.00003701', qty: '1467.00000000', commission: '0.06774660', commissionAsset: 'BNB', time: 1507062500456, isBuyer: true, isMaker: true, isBestMatch: true }, { id: 9575, orderId: 47884, price: '0.00003701', qty: '735.00000000', commission: '0.03394257', commissionAsset: 'BNB', time: 1507062502528, isBuyer: true, isMaker: true, isBestMatch: true } } ] ``` </details> #### Get all account orders; active, canceled, or filled. ```javascript binance.allOrders("ETHBTC", (error, orders, symbol) => { console.info(symbol+" orders:", orders); }); ``` #### Get dust log ```javascript binance.dustLog((error, dustlog) => { console.info(dustlog); }) ``` #### Get 24hr ticker price change statistics for all symbols ```javascript binance.prevDay(false, (error, prevDay) => { // console.info(prevDay); // view all data for ( let obj of prevDay ) { let symbol = obj.symbol; console.info(symbol+" volume:"+obj.volume+" change: "+obj.priceChangePercent+"%"); } }); ``` #### Get 24hr ticker price change statistics for a symbol ```javascript binance.prevDay("BNBBTC", (error, prevDay, symbol) => { console.info(symbol+" previous day:", prevDay); console.info("BNB change since yesterday: "+prevDay.priceChangePercent+"%") }); ``` #### Get Kline/candlestick data for a symbol You can use the optional API parameters for getting historical candlesticks, these are useful if you want to import data from earlier back in time. Optional parameters: limit (max/default 500), startTime, endTime. ```javascript // Intervals: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M binance.candlesticks("BNBBTC", "5m", (error, ticks, symbol) => { console.info("candlesticks()", ticks); let last_tick = ticks[ticks.length - 1]; let [time, open, high, low, close, volume, closeTime, assetVolume, trades, buyBaseVolume, buyAssetVolume, ignored] = last_tick; console.info(symbol+" last close: "+close); }, {limit: 500, endTime: 1514764800000}); ``` # WebSockets Implementation #### Get Complete WebSocket Chart Cache This function pulls existing chart data before connecting to the WebSocket, and provides you realtime synchronized chart information including the most recent 500 candles. ```javascript binance.websockets.chart("BNBBTC", "1m", (symbol, interval, chart) => { let tick = binance.last(chart); const last = chart[tick].close; console.info(chart); // Optionally convert 'chart' object to array: // let ohlc = binance.ohlc(chart); // console.info(symbol, ohlc); console.info(symbol+" last price: "+last) }); ``` <details> <summary>View Response</summary> ``` { '1517557800000': { open: '0.00100090', high: '0.00100650', low: '0.00099810', close: '0.00100370', volume: '1161.52000000' }, '1517557860000': { open: '0.00100360', high: '0.00101010', low: '0.00100000', close: '0.00100310', volume: '1977.68000000' }, '1517557920000': { open: '0.00100100', high: '0.00101130', low: '0.00100080', close: '0.00100670', volume: '2002.00000000' }, '1517557980000': { open: '0.00100660', high: '0.00101400', low: '0.00100200', close: '0.00100640', volume: '3896.40000000' }, '1517558040000': { open: '0.00100630', high: '0.00101390', low: '0.00100350', close: '0.00100470', volume: '1675.48000000' }, '1517558100000': { open: '0.00100860', high: '0.00101450', low: '0.00100100', close: '0.00100270', volume: '1918.46000000' }, '1517558160000': { open: '0.00100460', high: '0.00101480', low: '0.00100310', close: '0.00100670', volume: '2464.12000000' }, '1517558220000': { open: '0.00100510', high: '0.00100660', low: '0.00100110', close: '0.00100250', volume: '1484.59000000' } } // (..many more entries not shown) ///BNBBTC last price: 0.00100250 ``` </details> #### Get Candlestick Updates via WebSocket ```javascript // Periods: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M binance.websockets.candlesticks(['BNBBTC'], "1m", (candlesticks) => { let { e:eventType, E:eventTime, s:symbol, k:ticks } = candlesticks; let { o:open, h:high, l:low, c:close, v:volume, n:trades, i:interval, x:isFinal, q:quoteVolume, V:buyVolume, Q:quoteBuyVolume } = ticks; console.info(symbol+" "+interval+" candlestick update"); console.info("open: "+open); console.info("high: "+high); console.info("low: "+low); console.info("close: "+close); console.info("volume: "+volume); console.info("isFinal: "+isFinal); }); ``` #### Get Trade Updates via WebSocket ```javascript binance.websockets.trades(['BNBBTC', 'ETHBTC'], (trades) => { let {e:eventType, E:eventTime, s:symbol, p:price, q:quantity, m:maker, a:tradeId} = trades; console.info(symbol+" trade update. price: "+price+", quantity: "+quantity+", maker: "+maker); }); ``` #### Get miniTicker via WebSocket ```js binance.websockets.miniTicker(markets => { console.info(markets); }); ``` <details> <summary>View Response</summary> ``` ICXBNB: { close: '0.34803000', open: '0.34249000', high: '0.35000000', low: '0.31001000', volume: '134681.88000000', quoteVolume: '44351.78363150', eventTime: 1520501508957 }, ELFETH: { close: '0.00120820', open: '0.00132816', high: '0.00132926', low: '0.00115888', volume: '852919.00000000', quoteVolume: '1045.37831133', eventTime: 1520501508735 }, PIVXBTC: { close: '0.00049510', open: '0.00051000', high: '0.00056290', low: '0.00049200', volume: '215530.27000000', quoteVolume: '111.50245426', eventTime: 1520501508367 } ``` </details> #### Get 24hr Price Change Statistics via WebSocket ```js // For all symbols: binance.websockets.prevDay(false, (error, response) => { console.info(response); }); // For a specific symbol: binance.websockets.prevDay('BNBBTC', (error, response) => { console.info(response); }); ``` <details> <summary>View Response</summary> ``` { eventType: '24hrTicker', eventTime: 1512629577435, symbol: 'BNBBTC', priceChange: '-0.00002671', percentChange: '-12.844', averagePrice: '0.00019282', prevClose: '0.00020796', close: '0.00018125', closeQty: '55.00000000', bestBid: '0.00018038', bestBidQty: '580.00000000', bestAsk: '0.00018125', bestAskQty: '144.00000000', open: '0.00020796', high: '0.00021300', low: '0.00017555', volume: '3731915.00000000', quoteVolume: '719.59011818', openTime: 1512543177433, closeTime: 1512629577433, firstTradeId: 2248079, lastTradeId: 2284725, numTrades: 36647 } ``` </details> #### Get Market Depth via WebSocket ```javascript binance.websockets.depth(['BNBBTC'], (depth) => { let {e:eventType, E:eventTime, s:symbol, u:updateId, b:bidDepth, a:askDepth} = depth; console.info(symbol+" market depth update"); console.info(bidDepth, askDepth); }); ``` #### Maintain Market Depth Cache Locally via WebSocket ```javascript binance.websockets.depthCache(['BNBBTC'], (symbol, depth) => { let bids = binance.sortBids(depth.bids); let asks = binance.sortAsks(depth.asks); console.info(symbol+" depth cache update"); console.info("bids", bids); console.info("asks", asks); console.info("best bid: "+binance.first(bids)); console.info("best ask: "+binance.first(asks)); console.info("last updated: " + new Date(depth.eventTime)); }); ``` <details> <summary>View Response</summary> ```javascript BNBBTC depth cache update asks { '0.00025400': 0.531114, '0.00025440': 0.2602512, '0.00025469': 0.01400795, '0.00025500': 0.0051, '0.00025555': 0.0245328, '0.00025629': 0.05100171, '0.00025630': 0.0146091, '0.00025642': 0.02230854, '0.00025825': 0.00180775, '0.00025896': 0.21856224, '0.00025927': 0.025927 } bids { '0.00025203': 0.201624, '0.00025202': 0.04838784, '0.00025200': 0.13482, '0.00025195': 0.01385725, '0.00025187': 0.25539618, '0.00025138': 0.012569, '0.00025136': 0.04247984, '0.00025135': 0.0085459, '0.00025100': 0.02259, '0.00025072': 0.012536, '0.00025071': 0.00401136 } //best ask: 0.00025400 //best bid: 0.00025203 //last updated: Thu Apr 18 2019 00:52:49 GMT-0400 (Eastern Daylight Time) ``` </details> #### bookTickers stream includes the bid/ask price & amount, for all symbols ```js binance.websockets.bookTickers( console.log ); ``` #### bookTickers stream includes the bid/ask price & amount, for a symbol ```js binance.websockets.bookTickers( 'BTCUSDT', console.log ); ``` ### Deposit & Withdraw #### Get Deposit Address ```js binance.depositAddress("XMR", (error, response) => { console.info(response); }); ``` #### Get All Deposit History ```js binance.depositHistory((error, response) => { console.info(response); }); ``` #### Get Deposit History for a specific symbol ```js binance.depositHistory((error, response) => { console.info(response); }, "VEN"); ``` #### Get All Withdraw History ```js binance.withdrawHistory((error, response) => { console.info(response); }); ``` #### Get Withdraw History for a specific symbol ```js binance.withdrawHistory((error, response) => { console.info(response); }, "BTC"); ``` #### Withdraw with AddressTag ```js // Required for coins like XMR, XRP, etc. let address = "44tLjmXrQNrWJ5NBsEj2R77ZBEgDa3fEe9GLpSf2FRmhexPvfYDUAB7EXX1Hdb3aMQ9FLqdJ56yaAhiXoRsceGJCRS3Jxkn"; let addressTag = "0e5e38a01058dbf64e53a4333a5acf98e0d5feb8e523d32e3186c664a9c762c1"; let amount = 0.1; binance.withdraw("XMR", address, amount, addressTag); ``` #### Withdraw ```js binance.withdraw("BTC", "1C5gqLRs96Xq4V2ZZAR1347yUCpHie7sa", 0.2); ``` ### Universal Transfer / Internal Wallet Transfer Example Spot account transfer to USDⓈ-M Futures account , use ENUM -> "MAIN_UMFUTURE" ```js console.info( await binance.universalTransfer("MAIN_UMFUTURE","USDT",10) ); ``` for more account transfers (ENUMs) see [docs](https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer) # Binance Margin API #### Transfer from Main account to Margin account ```js binance.mgTransferMainToMargin(asset, amount, (error, response) => { if ( error ) return console.warn(error); // Success! Transaction ID: response.tranId }); ``` #### Transfer from Margin account to Main account ```js binance.mgTransferMarginToMain(asset, amount, (error, response) => { if ( error ) return console.warn(error); // Success! Transaction ID: response.tranId }); ``` #### Get maximum transfer-out amount from Margin account to Main account ```js binance.maxTransferable(asset, (error, response) => { if ( error ) return console.warn(error); console.info(`Maximum transfer-out amount: ${response.amount}`); }); ``` #### Get maximum borrow amount ```js binance.maxBorrowable(asset, (error, response) => { if ( error ) return console.warn(error); console.info(`Maximum borrow amount: ${response.amount}`); }); ``` #### Borrow from margin account ```js binance.mgBorrow(asset, amount, (error, response) => { if ( error ) return console.warn(error); // Success! Transaction ID: response.tranId }); ``` #### Repay margin account ```js binance.mgRepay(asset, amount, (error, response) => { if ( error ) return console.warn(error); // Success! Transaction ID: response.tranId }); ``` #### Margin BUY and SELL orders Instead of `binance.buy()` use `binance.mgBuy()` and instead of `binance.sell()` use `binance.mgSell()`. For market orders use `binance.mgMarketBuy()` and `binance.mgMarketSell()`. For order operations, use `binance.mgCancel()`, `binance.mgCancelOrders()`, `binance.mgAllOrders()`, `binance.openOrders()`, `binance.mgOrderStatus()`. Usage and callbacks are the same as the 'regular account' counterparts. #### Get your Trade History for the Margin account Use `binance.mgTrades()` instead of `binance.trades()`. ```javascript binance.mgTrades("ETHUSDT", (error, trades, symbol) => { console.info(symbol+" trade history", trades); }); ``` <details> <summary>View Response</summary> ```js [ { symbol: 'ETHUSDT', id: 9572, orderId: 47884, price: '2063.07', qty: '1.44877', commission: '2.98891392', commissionAsset: 'USDT', time: 1617900638521, isBuyer: false, isMaker: false, isBestMatch: true, isIsolated: true }] ``` </details> #### Margin account details ```javascript binance.mgAccount((error, response) => { if ( error ) return console.warn(error); console.info("Account details response:", response) }) ``` <details> <summary>View response</summary> ```javascript { borrowEnabled: true, marginLevel: '999.00000000', totalAssetOfBtc: '0.00000003', totalLiabilityOfBtc: '0.00000000', totalNetAssetOfBtc: '0.00000003', tradeEnabled: true, transferEnabled: true, userAssets: [ { asset: 'MATIC', borrowed: '0.00000000', free: '0.00000000', interest: '0.00000000', locked: '0.00000000', netAsset: '0.00000000' } ] } ``` </details> # Binance Lending API #### Lending Account Details ```javascript let lendingData = await binance.lending(); ``` <details> <summary>View response</summary> ```javascript lendingData { positionAmountVos: [ { amount: '952983.20208997', amountInBTC: '129.54853649', amountInUSDT: '952983.20208997', asset: 'USDT' } ], totalAmountInBTC: '129.54853649', totalAmountInUSDT: '952983.20208997', totalFixedAmountInBTC: '13.59400000', totalFixedAmountInUSDT: '100000.00000000', totalFlexibleInBTC: '115.95453649', totalFlexibleInUSDT: '852983.20208997' } { positionAmountVos: [], totalAmountInBTC: '0.00000000', totalAmountInUSDT: '0.00000000', totalFixedAmountInBTC: '0.00000000', totalFixedAmountInUSDT: '0.00000000', totalFlexibleInBTC: '0.00000000', totalFlexibleInUSDT: '0.00000000' } { positionAmountVos: [], totalAmountInBTC: '0.00000000', totalAmountInUSDT: '0.00000000', totalFixedAmountInBTC: '0.00000000', totalFixedAmountInUSDT: '0.00000000', totalFlexibleInBTC: '0.00000000', totalFlexibleInUSDT: '0.00000000' } ``` </details> #### [Advanced Examples](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md) > [exchangeInfo: Pull minimum order size, quantity, etc](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#exchangeinfo-pull-minimum-order-size-quantity-etc)\ [Clamp order quantities to required amounts via minQty, minNotional, stepSize when placing orders](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#clamp-order-quantities-to-required-amounts-via-minqty-minnotional-stepsize-when-placing-orders)\ [Show API Rate limits](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#show-api-rate-limits)\ [Connect to all WebSockets at once](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#connect-to-all-websockets-at-once-thanks-keith1024)\ [Get last order for a symbol](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#get-last-order-for-a-symbol)\ [newOrderRespType example](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#neworderresptype-example-when-placing-orders)\ [Recent Trades (historicalTrades, recentTrades, aggTrades functions)](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#recent-trades-historicaltrades-recenttrades-aggtrades-functions)\ [Terminate WebSocket connections](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#terminate-websocket-connections)\ [User Data: Account Balance Updates, Trade Updates, New Orders, Filled Orders, Cancelled Orders via WebSocket](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#user-data-account-balance-updates-trade-updates-new-orders-filled-orders-cancelled-orders-via-websocket) [Margin User Data: Account Balance Updates, Trade Updates, New Orders, Filled Orders, Cancelled Orders via WebSocket](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#margin-user-data-account-balance-updates-trade-updates-new-orders-filled-orders-cancelled-orders-via-websocket) [Asynchronous Syntax Options](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#asynchronous-syntax-options) ### Troubleshooting Verify that your system time is correct. If you have any suggestions don't hesitate to file an issue. Having problems? Try adding `useServerTime` to your options or setting `recvWindow`: ```js binance.options({ APIKEY: 'xxx', APISECRET: 'xxx', useServerTime: true, recvWindow: 60000, // Set a higher recvWindow to increase response timeout verbose: true, // Add extra output when subscribing to WebSockets, etc log: log => { console.log(log); // You can create your own logger here, or disable console output } }); ``` Problems getting your balance? Wrap the entry point of your application in useServerTime: ```js await binance.useServerTime(); binance.balance((error, balances) => { if ( error ) return console.error(error); console.info("balances()", balances); console.info("BNB balance: ", balances.BNB.available); }); ``` You can enable verbose mode to help with debugging WebSocket streams: ```js binance.setOption( 'verbose', true ); ``` ### Sponsors [![Vitality](https://github.com/user-attachments/assets/0981aae2-3e12-4b57-8d2f-c5ae2b3b8b1c)](https://vitalitycrypto.com/) ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=jaggedsoft/node-binance-api&type=Timeline)](https://star-history.com/#jaggedsoft/node-binance-api&Timeline) ## Contribution - Give us a star :star: - Fork and Clone! Awesome - Select existing [issues](https://github.com/jaggedsoft/node-binance-api/issues) or create a [new issue](https://github.com/jaggedsoft/node-binance-api/issues/new) and give us a PR with your bugfix or improvement after. We love it ❤️ ![Downloads](https://img.shields.io/npm/dt/node-binance-api.svg?style=for-the-badge&maxAge=86400) ![Stars](https://img.shields.io/github/stars/jaggedsoft/node-binance-api.svg?style=for-the-badge&label=Stars) ![Contributors](https://img.shields.io/github/contributors/jaggedsoft/node-binance-api.svg?style=for-the-badge&maxAge=86400) [![CCXT on X](https://img.shields.io/twitter/follow/ccxt_official.svg?style=social)](https://x.com/ccxt_official)

Crypto & Blockchain API Tools
1.7K Github Stars
binance-rs
Open Source

binance-rs

# binance-rs Unofficial Rust Library for the [Binance API](https://github.com/binance/binance-spot-api-docs) and [Binance Futures API (Under development with upcoming breaking changes)](https://binance-docs.github.io/apidocs/futures/en/#general-info) [![Crates.io](https://img.shields.io/crates/v/binance.svg)](https://crates.io/crates/binance) [![Build Status](https://travis-ci.org/wisespace-io/binance-rs.png?branch=master)](https://travis-ci.org/wisespace-io/binance-rs) [![CI](https://github.com/wisespace-io/binance-rs/workflows/Rust/badge.svg)](https://github.com/wisespace-io/binance-rs/actions?query=workflow%3ARust) [![MIT licensed](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE-MIT) [![Apache-2.0 licensed](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE) [Documentation on docs.rs](https://docs.rs/crate/binance/) ## Binance API Telegram <https://t.me/binance_api_english> ## Usage Add this to your Cargo.toml ```toml [dependencies] binance = { git = "https://github.com/ccxt/binance-rs.git" } ``` ## Rust >= 1.56.1 ```rust rustup install stable ``` ### Table of Contents - [MARKET DATA](#market-data) - [ACCOUNT DATA](#account-data) - [ERROR HANDLING](#error-handling) - [TESTNET AND API CLUSTERS](#testnet-and-api-clusters) - [USER STREAM CONFIGURATION](#user-stream-configuration) - [WEBSOCKETS](#websockets) - [USER STREAM](#user-stream) - [TRADES](#trades) - [KLINE](#kline) - [MULTIPLE STREAMS](#multiple-streams) ### MARKET DATA ```rust use binance::api::*; use binance::model::*; use binance::market::*; fn main() { let market: Market = Binance::new(None, None); // Order book at default depth match market.get_depth("BNBETH") { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {}", e), } // Order book at depth 500 match market.get_custom_depth("BNBETH", 500) { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {}", e), } // Latest price for ALL symbols match market.get_all_prices() { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } // Latest price for ONE symbol match market.get_price("BNBETH") { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } // Current average price for ONE symbol match market.get_average_price("BNBETH") { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } // Best price/qty on the order book for ALL symbols match market.get_all_book_tickers() { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } // Best price/qty on the order book for ONE symbol match market.get_book_ticker("BNBETH") { Ok(answer) => println!( "Bid Price: {}, Ask Price: {}", answer.bid_price, answer.ask_price ), Err(e) => println!("Error: {:?}", e), } // 24hr ticker price change statistics match market.get_24h_price_stats("BNBETH") { Ok(answer) => println!( "Open Price: {}, Higher Price: {}, Lower Price: {:?}", answer.open_price, answer.high_price, answer.low_price ), Err(e) => println!("Error: {:?}", e), } // last 10 5min klines (candlesticks) for a symbol: match market.get_klines("BNBETH", "5m", 10, None, None) { Ok(klines) => { match klines { binance::model::KlineSummaries::AllKlineSummaries(klines) => { let kline: KlineSummary = klines[0].clone(); // You need to iterate over the klines println!( "Open: {}, High: {}, Low: {}", kline.open, kline.high, kline.low ) } } }, Err(e) => println!("Error: {}", e), } } ``` ### ACCOUNT DATA ```rust use binance::api::*; use binance::account::*; fn main() { let api_key = Some("YOUR_API_KEY".into()); let secret_key = Some("YOUR_SECRET_KEY".into()); let account: Account = Binance::new(api_key, secret_key); match account.get_account() { Ok(answer) => println!("{:?}", answer.balances), Err(e) => println!("Error: {:?}", e), } match account.get_open_orders("WTCETH") { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } match account.limit_buy("WTCETH", 10, 0.014000) { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } match account.market_buy("WTCETH", 5) { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } match account.limit_sell("WTCETH", 10, 0.035000) { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } match account.market_sell("WTCETH", 5) { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } match account.custom_order("WTCETH", 9999, 0.0123, "SELL", "LIMIT", "IOC") { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } let order_id = 1_957_528; match account.order_status("WTCETH", order_id) { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } match account.cancel_order("WTCETH", order_id) { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } match account.cancel_all_open_orders("WTCETH") { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } match account.get_balance("KNC") { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } match account.trade_history("WTCETH") { Ok(answer) => println!("{:?}", answer), Err(e) => println!("Error: {:?}", e), } } ``` ### ERROR HANDLING Provides more detailed error information You can check out the [Binance Error Codes](https://github.com/binance-exchange/binance-official-api-docs/blob/master/errors.md) ```rust use binance::errors::ErrorKind as BinanceLibErrorKind; [...] Err(err) => { println!("Can't put an order!"); match err.0 { BinanceLibErrorKind::BinanceError(response) => match response.code { -1013_i16 => println!("Filter failure: LOT_SIZE!"), -2010_i16 => println!("Funds insufficient! {}", response.msg), _ => println!("Non-catched code {}: {}", response.code, response.msg), }, BinanceLibErrorKind::Msg(msg) => { println!("Binancelib error msg: {}", msg) } _ => println!("Other errors: {}.", err.0), }; } ``` ### TESTNET AND API CLUSTERS You can overwrite the default binance api urls if there are performance issues with the endpoints. You can check out the [Binance API Clusters](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#general-api-information). The same is applicable for Testnet and Binance.US support. See example below: ```rust let general: General = if use_testnet { let config = Config::default().set_rest_api_endpoint("https://testnet.binance.vision"); // .set_ws_endpoint("wss://testnet.binance.vision/ws") // .set_futures_rest_api_endpoint("https://testnet.binancefuture.com/api") // .set_futures_ws_endpoint("https://testnet.binancefuture.com/ws") Binance::new_with_config(None, None, &config) } else { Binance::new(None, None) }; ``` ### USER STREAM CONFIGURATION ```rust use binance::api::*; use binance::userstream::*; fn main() { let api_key_user = Some("YOUR_API_KEY".into()); let user_stream: UserStream = Binance::new(api_key_user.clone(), None); if let Ok(answer) = user_stream.start() { println!("Data Stream Started ..."); let listen_key = answer.listen_key; match user_stream.keep_alive(&listen_key) { Ok(msg) => println!("Keepalive user data stream: {:?}", msg), Err(e) => println!("Error: {:?}", e), } match user_stream.close(&listen_key) { Ok(msg) => println!("Close user data stream: {:?}", msg), Err(e) => println!("Error: {:?}", e), } } else { println!("Not able to start an User Stream (Check your API_KEY)"); } } ``` #### USER STREAM ```rust use binance::api::*; use binance::userstream::*; use binance::websockets::*; use std::sync::atomic::{AtomicBool}; fn main() { let api_key_user = Some("YOUR_KEY".into()); let keep_running = AtomicBool::new(true); // Used to control the event loop let user_stream: UserStream = Binance::new(api_key_user, None); if let Ok(answer) = user_stream.start() { let listen_key = answer.listen_key; let mut web_socket = WebSockets::new(|event: WebsocketEvent| { match event { WebsocketEvent::AccountUpdate(account_update) => { for balance in &account_update.balance { println!("Asset: {}, free: {}, locked: {}", balance.asset, balance.free, balance.locked); } }, WebsocketEvent::OrderTrade(trade) => { println!("Symbol: {}, Side: {}, Price: {}, Execution Type: {}", trade.symbol, trade.side, trade.price, trade.execution_type); }, _ => (), }; Ok(()) }); web_socket.connect(&listen_key).unwrap(); // check error if let Err(e) = web_socket.event_loop(&keep_running) { match e { err => { println!("Error: {:?}", err); } } } } else { println!("Not able to start an User Stream (Check your API_KEY)"); } } ``` #### TRADES ```rust use binance::websockets::*; use std::sync::atomic::{AtomicBool}; fn main() { let keep_running = AtomicBool::new(true); // Used to control the event loop let agg_trade = format!("!ticker@arr"); // All Symbols let mut web_socket = WebSockets::new(|event: WebsocketEvent| { match event { // 24hr rolling window ticker statistics for all symbols that changed in an array. WebsocketEvent::DayTickerAll(ticker_events) => { for tick_event in ticker_events { if tick_event.symbol == "BTCUSDT" { let btcusdt: f32 = tick_event.average_price.parse().unwrap(); let btcusdt_close: f32 = tick_event.current_close.parse().unwrap(); println!("{} - {}", btcusdt, btcusdt_close); } } }, _ => (), }; Ok(()) }); web_socket.connect(&agg_trade).unwrap(); // check error if let Err(e) = web_socket.event_loop(&keep_running) { match e { err => { println!("Error: {:?}", err); } } } } ``` #### KLINE ```rust use binance::websockets::*; use std::sync::atomic::{AtomicBool}; fn main() { let keep_running = AtomicBool::new(true); // Used to control the event loop let kline = format!("{}", "ethbtc@kline_1m"); let mut web_socket = WebSockets::new(|event: WebsocketEvent| { match event { WebsocketEvent::Kline(kline_event) => { println!("Symbol: {}, high: {}, low: {}", kline_event.kline.symbol, kline_event.kline.low, kline_event.kline.high); }, _ => (), }; Ok(()) }); web_socket.connect(&kline).unwrap(); // check error if let Err(e) = web_socket.event_loop(&keep_running) { match e { err => { println!("Error: {:?}", err); } } } web_socket.disconnect().unwrap(); } ``` #### MULTIPLE STREAMS ```rust use binance::websockets::*; use std::sync::atomic::{AtomicBool}; fn main() { let endpoints = ["ETHBTC", "BNBETH"] .map(|symbol| format!("{}@depth@100ms", symbol.to_lowercase())); let keep_running = AtomicBool::new(true); let mut web_socket = WebSockets::new(|event: WebsocketEvent| { if let WebsocketEvent::DepthOrderBook(depth_order_book) = event { println!("{:?}", depth_order_book); } Ok(()) }); web_socket.connect_multiple_streams(&endpoints).unwrap(); // check error if let Err(e) = web_socket.event_loop(&keep_running) { println!("Error: {:?}", e); } web_socket.disconnect().unwrap(); } ``` ### Other Exchanges If you use [Bitfinex](https://www.bitfinex.com/) check out my [Rust library for bitfinex API](https://github.com/wisespace-io/bitfinex-rs)

Developer Tools Crypto & Blockchain
855 Github Stars
binance-api-node
Open Source

binance-api-node

# binance-api-node [![telegram](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/binance_api_node)[![build](https://img.shields.io/github/actions/workflow/status/viewblock/binance-api-node/ci.yml?style=flat-square)](https://github.com/ViewBlock/binance-api-node/actions) [![bnb](https://img.shields.io/badge/binance-winner-yellow.svg?style=flat-square)](https://github.com/binance-exchange/binance-api-node) > A complete API wrapper for the [Binance](https://binance.com) API. Note: This wrapper uses Promises, if they are not supported in your environment, you might want to add [a polyfill](https://github.com/stefanpenner/es6-promise) for them. For PRs or issues, head over to the [source repository](https://github.com/Ashlar/binance-api-node). For contribution guidelines and development instructions, see [CONTRIBUTING.md](CONTRIBUTING.md). #### Community Telegram Chat https://t.me/binance_api_node ### Installation ``` npm install binance-api-node ``` [![NPM](https://nodei.co/npm/binance-api-node.png?compact=false)](https://npmjs.org/package/binance-api-node) <!-- [![npm install binance-api-node](https://nodei.co/npm/binance-api-node.png?mini=true)](https://npmjs.org/package/binance-api-node) --> **This project is powered by** <a href="https://github.com/ccxt/ccxt"><img src="https://avatars.githubusercontent.com/u/31901609" width=4% height=4%></a> ### Getting started Import the module and create a new client. Passing api keys is optional only if you don't plan on doing authenticated calls. You can create an api key [here](https://www.binance.com/userCenter/createApi.html). If you want to create demo/testnet keys click [here](https://demo.binance.com/) ```js import Binance from 'binance-api-node' const client = Binance() // Authenticated client, can make signed calls const client2 = Binance({ apiKey: 'xxx', apiSecret: 'xxx', getTime: xxx, }) client.time().then(time => console.log(time)) ``` To use testnet, initialize it with the testnet boolean set to true. ```js const client = Binance({ apiKey: 'xxx', apiSecret: 'xxx', getTime: xxx, testnet: true, }) ``` ### Browser vs Node.js This library works in both browsers and Node.js environments: ### RSA/ECDSA support This library supports RSA and ED25519 keys out of the box. The usage is straightforward, just provide `privateKey` instead of `apiSecret`. ```js const apiKey = "ZymCbCxu1LiYIW8IcYSbXQOaAtHaeW3ioCU5qFf5QvUyTfP1runCaY8AwzCaoOaq" const privateKey = "-----BEGIN PRIVATE KEY-----\ndMC4CAfAwafYDK2cwaCIEIa+Ax8dMK50wcIcD0Zdf2jaCDoRdaoc7KaadRUh+aLdt\n-----END PRIVATE KEY-----" const client = Binance({ privateKey, apiKey, }) ``` ### Proxy Support (Node.js only) Proxy support for HTTP and WebSocket connections is available in Node.js: ```js const client = Binance({ apiKey: 'xxx', apiSecret: 'xxx', proxy: 'http://proxy-host:port', }) // All HTTP requests and WebSocket connections will use the proxy await client.time() client.ws.ticker('BTCUSDT', ticker => console.log(ticker)) ``` **Notes:** - `binance-api-node` fully supports the new algo service introduced on the Decemeber 9th of 2025 - Proxy support is only available in Node.js environment - Browsers use system/OS proxy settings automatically - Supports HTTP and HTTPS proxies (use `http://` or `https://` protocol) - Supports authenticated proxies: `http://username:password@proxy-host:port` If you do not have an appropriate babel config, you will need to use the basic commonjs requires. ```js const Binance = require('binance-api-node').default ``` Every REST method returns a Promise, making this library [async await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) ready. Following examples will use the `await` form, which requires some configuration you will have to lookup. ### Table of Contents - [binance-api-node ](#binance-api-node--) - [Community Telegram Chat](#community-telegram-chat) - [Installation](#installation) - [Getting started](#getting-started) - [Browser vs Node.js](#browser-vs-nodejs) - [Proxy Support (Node.js only)](#proxy-support-nodejs-only) - [Table of Contents](#table-of-contents) - [Init](#init) - [Public REST Endpoints](#public-rest-endpoints) - [ping](#ping) - [time](#time) - [exchangeInfo](#exchangeinfo) - [book](#book) - [candles](#candles) - [aggTrades](#aggtrades) - [trades](#trades) - [dailyStats](#dailystats) - [avgPrice](#avgprice) - [prices](#prices) - [allBookTickers](#allbooktickers) - [Futures Public REST Endpoints](#futures-public-rest-endpoints) - [futures ping](#futures-ping) - [futures time](#futures-time) - [futures exchangeInfo](#futures-exchangeinfo) - [futures book](#futures-book) - [futures candles](#futures-candles) - [futures aggTrades](#futures-aggtrades) - [futures trades](#futures-trades) - [futures dailyStats](#futures-dailystats) - [futures prices](#futures-prices) - [futures allBookTickers](#futures-allbooktickers) - [futures markPrice](#futures-markprice) - [futures AllForceOrders](#futures-allforceorders) - [Delivery Public REST Endpoints](#delivery-public-rest-endpoints) - [delivery ping](#delivery-ping) - [delivery time](#delivery-time) - [delivery exchangeInfo](#delivery-exchangeinfo) - [delivery book](#delivery-book) - [delivery candles](#delivery-candles) - [delivery aggTrades](#delivery-aggtrades) - [delivery trades](#delivery-trades) - [delivery dailyStats](#delivery-dailystats) - [delivery prices](#delivery-prices) - [delivery allBookTickers](#delivery-allbooktickers) - [delivery markPrice](#delivery-markprice) - [Authenticated REST Endpoints](#authenticated-rest-endpoints) - [order](#order) - [updateOrder](#updateorder) - [orderTest](#ordertest) - [orderOco](#orderoco) - [getOrder](#getorder) - [getOrderOco](#getorderoco) - [cancelOrder](#cancelorder) - [cancelOrderOco](#cancelorderoco) - [cancelOpenOrders](#cancelopenorders) - [openOrders](#openorders) - [allOrders](#allorders) - [allOrdersOCO](#allordersoco) - [accountInfo](#accountinfo) - [myTrades](#mytrades) - [dailyAccountSnapshot](#dailyaccountsnapshot) - [tradesHistory](#tradeshistory) - [withdrawHistory](#withdrawhistory) - [withdraw](#withdraw) - [depositAddress](#depositaddress) - [depositHistory](#deposithistory) - [tradeFee](#tradefee) - [capitalConfigs](#capitalconfigs) - [universalTransfer](#universaltransfer) - [universalTransferHistory](#universaltransferhistory) - [assetDetail](#assetdetail) - [getBnbBurn](#getbnbburn) - [setBnbBurn](#setbnbburn) - [dustLog](#dustlog) - [dustTransfer](#dusttransfer) - [accountCoins](#accountcoins) - [lendingAccount](#lendingaccount) - [fundingWallet](#fundingwallet) - [apiPermission](#apipermission) - [Margin](#margin) - [marginAccountInfo](#marginaccountinfo) - [marginLoan](#marginloan) - [marginRepay](#marginrepay) - [marginIsolatedAccount](#marginisolatedaccount) - [disableMarginAccount](#disablemarginaccount) - [enableMarginAccount](#enablemarginaccount) - [marginMaxBorrow](#marginmaxborrow) - [marginCreateIsolated](#margincreateisolated) - [marginIsolatedTransfer](#marginisolatedtransfer) - [marginIsolatedTransferHistory](#marginisolatedtransferhistory) - [marginOrder](#marginorder) - [marginCancelOrder](#margincancelorder) - [marginOrderOco](#marginorderoco) - [marginOpenOrders](#marginopenorders) - [marginCancelOpenOrders](#margincancelopenorders) - [marginGetOrder](#margingetorder) - [marginGetOrderOco](#margingetorderoco) - [Portfolio Margin Endpoints](#portfolio-margin-endpoints) - [getPortfolioMarginAccountInfo](#getportfoliomarginaccountinfo) - [Futures Authenticated REST endpoints](#futures-authenticated-rest-endpoints) - [futuresOrder](#futuresorder) - [futuresUpdateOrder](#futuresupdateorder) - [futuresGetOrder](#futuresgetorder) - [futuresAllOrders](#futuresallorders) - [futuresBatchOrders](#futuresbatchorders) - [futuresCancelBatchOrders](#futurescancelbatchorders) - [futuresLeverage](#futuresleverage) - [futuresMarginType](#futuresmargintype) - [futuresPositionMargin](#futurespositionmargin) - [futuresMarginHistory](#futuresmarginhistory) - [futuresIncome](#futuresincome) - [futuresAccountBalance](#futuresaccountbalance) - [futuresUserTrades](#futuresusertrades) - [futuresLeverageBracket](#futuresleveragebracket) - [Delivery Authenticated REST endpoints](#delivery-authenticated-rest-endpoints) - [deliveryGetOrder](#deliverygetorder) - [deliveryAllOrders](#deliveryallorders) - [deliveryBatchOrders](#deliverybatchorders) - [deliveryCancelBatchOrders](#deliverycancelbatchorders) - [deliveryLeverage](#deliveryleverage) - [deliveryMarginType](#deliverymargintype) - [deliveryPositionMargin](#deliverypositionmargin) - [deliveryMarginHistory](#deliverymarginhistory) - [deliveryIncome](#deliveryincome) - [deliveryAccountBalance](#deliveryaccountbalance) - [deliveryUserTrades](#deliveryusertrades) - [deliveryLeverageBracket](#deliveryleveragebracket) - [WebSockets](#websockets) - [depth](#depth) - [customSubStream](#customsubstream) - [partialDepth](#partialdepth) - [ticker](#ticker) - [allTickers](#alltickers) - [miniTicker](#miniticker) - [allMiniTickers](#allminitickers) - [bookTicker](#bookticker) - [candles](#candles-1) - [trades](#trades-1) - [aggTrades](#aggtrades-1) - [user](#user) - [Futures WebSockets](#futures-websockets) - [futuresDepth](#futuresdepth) - [futuresPartialDepth](#futurespartialdepth) - [futuresTicker](#futuresticker) - [futuresAllTickers](#futuresalltickers) - [futuresCandles](#futurescandles) - [futuresAggTrades](#futuresaggtrades) - [futuresLiquidations](#futuresliquidations) - [futuresAllLiquidations](#futuresallliquidations) - [futuresCustomSubStream](#futurescustomsubstream) - [futuresUser](#futuresuser) - [Delivery WebSockets](#delivery-websockets) - [deliveryDepth](#deliverydepth) - [deliveryPartialDepth](#deliverypartialdepth) - [deliveryTicker](#deliveryticker) - [deliveryAllTickers](#deliveryalltickers) - [deliveryCandles](#deliverycandles) - [deliveryAggTrades](#deliveryaggtrades) - [deliveryCustomSubStream](#deliverycustomsubstream) - [deliveryUser](#deliveryuser) - [Common](#common) - [getInfo](#getinfo) - [ErrorCodes](#errorcodes) ### Init | Param | Type | Required | Info | | ----------- | -------- | -------- | -------------------------------------------- | | apiKey | String | false | Required when making private calls | | apiSecret | String | false | Required when making private calls | | privateKey | String | false | Required when using RSA/Ed25519 calls | | getTime | Function | false | Time generator, defaults to () => Date.now() | | httpBase | String | false | Changes the default endpoint | | httpFutures | String | false | Changes the default endpoint | | wsBase | String | false | Changes the default endpoint | | wsFutures | String | false | Changes the default endpoint | ### Public REST Endpoints #### ping Test connectivity to the API. ```js console.log(await client.ping()) ``` #### time Test connectivity to the Rest API and get the current server time. ```js console.log(await client.time()) ``` <details> <summary>Output</summary> ```js 1508478457643 ``` </details> #### exchangeInfo Get the current exchange trading rules and symbol information. You can optionally pass a symbol to only retrieve info of this specific one. ```js console.log(await client.exchangeInfo()) ``` | Param | Type | Required | Default | | ------ | ------ | -------- | ------- | | symbol | String | false | | <details> <summary>Output</summary> ```js { "timezone": "UTC", "serverTime": 1508631584636, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 1200 }, { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 1, "limit": 10 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 100000 } ], "exchangeFilters": [], "symbols": [{ "symbol": "ETHBTC", "status": "TRADING", "baseAsset": "ETH", "baseAssetPrecision": 8, "quoteAsset": "BTC", "quotePrecision": 8, "orderTypes": ["LIMIT", "MARKET"], "icebergAllowed": false, "filters": [{ "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "100000.00000000", "tickSize": "0.00000100" }, { "filterType": "LOT_SIZE", "minQty": "0.00100000", "maxQty": "100000.00000000", "stepSize": "0.00100000" }, { "filterType": "MIN_NOTIONAL", "minNotional": "0.00100000" }] }] } ``` </details> #### book Get the order book for a symbol. ```js console.log(await client.book({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | Default | | ------ | ------ | -------- | ------- | | symbol | String | true | | limit | Number | false | `100` | <details> <summary>Output</summary> ```js { lastUpdateId: 17647759, asks: [ { price: '0.05411500', quantity: '5.55000000' }, { price: '0.05416700', quantity: '11.80100000' } ], bids: [ { price: '0.05395500', quantity: '2.70000000' }, { price: '0.05395100', quantity: '11.84100000' } ] } ``` </details> #### candles Retrieves Candlestick for a symbol. Candlesticks are uniquely identified by their open time. ```js console.log(await client.candles({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | Default | Description | | --------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------- | | symbol | String | true | | interval | String | false | `5m` | `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `2h`,<br>`4h`, `6h`, `8h`, `12h`, `1d`, `3d`, `1w`, `1M` | | limit | Number | false | `500` | Max `1000` | | startTime | Number | false | | endTime | Number | false | <details> <summary>Output</summary> ```js ;[ { openTime: 1508328900000, open: '0.05655000', high: '0.05656500', low: '0.05613200', close: '0.05632400', volume: '68.88800000', closeTime: 1508329199999, quoteAssetVolume: '2.29500857', trades: 85, baseAssetVolume: '40.61900000', }, ] ``` </details> #### aggTrades Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated. ```js console.log(await client.aggTrades({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | Default | Description | | --------- | ------ | -------- | ------- | -------------------------------------------------------- | | symbol | String | true | | fromId | String | false | | ID to get aggregate trades from INCLUSIVE. | | startTime | Number | false | | Timestamp in ms to get aggregate trades from INCLUSIVE. | | endTime | Number | false | | Timestamp in ms to get aggregate trades until INCLUSIVE. | | limit | Number | false | `500` | Max `500` | Note: If both `startTime` and `endTime` are sent, `limit` should not be sent AND the distance between `startTime` and `endTime` must be less than 1 hour. Note: If `frondId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned. <details> <summary>Output</summary> ```js ;[ { aggId: 2107132, symbol: 'ETHBTC', price: '0.05390400', quantity: '1.31000000', firstId: 2215345, lastId: 2215345, timestamp: 1508478599481, isBuyerMaker: true, wasBestPrice: true, }, ] ``` </details> #### trades Get recent trades of a symbol. ```js console.log(await client.trades({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | Default | Description | | ------ | ------ | -------- | ------- | ----------- | | symbol | String | true | | limit | Number | false | `500` | Max `500` | <details> <summary>Output</summary> ```js ;[ { id: 28457, price: '4.00000100', qty: '12.00000000', time: 1499865549590, isBuyerMaker: true, isBestMatch: true, }, ] ``` </details> #### dailyStats 24 hour price change statistics, not providing a symbol will return all tickers and is resource-expensive. ```js console.log(await client.dailyStats({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | | ------ | ------ | -------- | | symbol | String | false | <details> <summary>Output</summary> ```js { symbol: 'ETHBTC', priceChange: '-0.00112000', priceChangePercent: '-1.751', weightedAvgPrice: '0.06324784', prevClosePrice: '0.06397400', lastPrice: '0.06285500', lastQty: '0.63500000', bidPrice: '0.06285500', bidQty: '0.81900000', askPrice: '0.06291900', askQty: '2.93800000', openPrice: '0.06397500', highPrice: '0.06419100', lowPrice: '0.06205300', volume: '126240.37200000', quoteVolume: '7984.43091340', openTime: 1521622289427, closeTime: 1521708689427, firstId: 45409308, // First tradeId lastId: 45724293, // Last tradeId count: 314986 // Trade count } ``` </details> #### avgPrice Current average price for a symbol. ```js console.log(await client.avgPrice({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | | ------ | ------ | -------- | | symbol | String | true | <details> <summary>Output</summary> ```js { "mins": 5, "price": "9.35751834" } ``` </details> #### prices Latest price for a symbol, not providing the symbol will return prices for all symbols. ```js console.log(await client.prices()) ``` | Param | Type | Required | | ------ | ------ | -------- | | symbol | String | false | <details> <summary>Output</summary> ```js { ETHBTC: '0.05392500', LTCBTC: '0.01041100', ... } ``` </details> #### allBookTickers Best price/qty on the order book for all symbols. ```js console.log(await client.allBookTickers()) ``` <details> <summary>Output</summary> ```js { DASHBTC: { symbol: 'DASHBTC', bidPrice: '0.04890400', bidQty: '0.74100000', askPrice: '0.05230000', askQty: '0.79900000' }, DASHETH: { symbol: 'DASHETH', bidPrice: '0.89582000', bidQty: '0.63300000', askPrice: '1.02328000', askQty: '0.99900000' } ... } ``` </details> ### Futures Public REST Endpoints #### futures ping Test connectivity to the API. ```js console.log(await client.futuresPing()) ``` #### futures time Test connectivity to the Rest API and get the current server time. ```js console.log(await client.futuresTime()) ``` <details> <summary>Output</summary> ```js 1508478457643 ``` </details> #### futures exchangeInfo Get the current exchange trading rules and symbol information. ```js console.log(await client.futuresExchangeInfo()) ``` <details> <summary>Output</summary> ```js { "timezone": "UTC", "serverTime": 1508631584636, "rateLimits": [ { "rateLimitType": "REQUEST_WEIGHT", "interval": "MINUTE", "intervalNum": 1, "limit": 1200 }, { "rateLimitType": "ORDERS", "interval": "SECOND", "intervalNum": 1, "limit": 10 }, { "rateLimitType": "ORDERS", "interval": "DAY", "intervalNum": 1, "limit": 100000 } ], "exchangeFilters": [], "symbols": [...] } ``` </details> #### futures book Get the order book for a symbol. ```js console.log(await client.futuresBook({ symbol: 'BTCUSDT' })) ``` | Param | Type | Required | Default | | ------ | ------ | -------- | ------- | | symbol | String | true | | limit | Number | false | `100` | <details> <summary>Output</summary> ```js { lastUpdateId: 17647759, asks: [ { price: '8000.05411500', quantity: '54.55000000' }, { price: '8000.05416700', quantity: '1111.80100000' } ], bids: [ { price: '8000.05395500', quantity: '223.70000000' }, { price: '8000.05395100', quantity: '1134.84100000' } ] } ``` </details> #### futures candles Retrieves Candlestick for a symbol. Candlesticks are uniquely identified by their open time. ```js console.log(await client.futuresCandles({ symbol: 'BTCUSDT' })) ``` | Param | Type | Required | Default | Description | | --------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------- | | symbol | String | true | | interval | String | false | `5m` | `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `2h`,<br>`4h`, `6h`, `8h`, `12h`, `1d`, `3d`, `1w`, `1M` | | limit | Number | false | `500` | Max `1000` | | startTime | Number | false | | endTime | Number | false | <details> <summary>Output</summary> ```js ;[ { openTime: 1508328900000, open: '0.05655000', high: '0.05656500', low: '0.05613200', close: '0.05632400', volume: '68.88800000', closeTime: 1508329199999, quoteAssetVolume: '2.29500857', trades: 85, baseAssetVolume: '40.61900000', }, ] ``` </details> #### futures aggTrades Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated. ```js console.log(await client.futuresAggTrades({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | Default | Description | | --------- | ------ | -------- | ------- | -------------------------------------------------------- | | symbol | String | true | | | | fromId | String | false | | ID to get aggregate trades from INCLUSIVE. | | startTime | Number | false | | Timestamp in ms to get aggregate trades from INCLUSIVE. | | endTime | Number | false | | Timestamp in ms to get aggregate trades until INCLUSIVE. | | limit | Number | false | `500` | Max `500` | Note: If both `startTime` and `endTime` are sent, `limit` should not be sent AND the distance between `startTime` and `endTime` must be less than 24 hours. Note: If `frondId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned. <details> <summary>Output</summary> ```js ;[ { aggId: 2107132, price: '0.05390400', quantity: '1.31000000', firstId: 2215345, lastId: 2215345, timestamp: 1508478599481, isBuyerMaker: true, wasBestPrice: true, }, ] ``` </details> #### futures trades Get recent trades of a symbol. ```js console.log(await client.futuresTrades({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | Default | Description | | ------ | ------ | -------- | ------- | ----------- | | symbol | String | true | | limit | Number | false | `500` | Max `500` | <details> <summary>Output</summary> ```js ;[ { id: 28457, price: '4.00000100', qty: '12.00000000', time: 1499865549590, isBuyerMaker: true, isBestMatch: true, }, ] ``` </details> #### futures dailyStats 24 hour price change statistics, not providing a symbol will return all tickers and is resource-expensive. ```js console.log(await client.futuresDailyStats({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | | ------ | ------ | -------- | | symbol | String | false | <details> <summary>Output</summary> ```js { symbol: 'BTCUSDT', priceChange: '-0.00112000', priceChangePercent: '-1.751', weightedAvgPrice: '0.06324784', prevClosePrice: '0.06397400', lastPrice: '0.06285500', lastQty: '0.63500000', bidPrice: '0.06285500', bidQty: '0.81900000', askPrice: '0.06291900', askQty: '2.93800000', openPrice: '0.06397500', highPrice: '0.06419100', lowPrice: '0.06205300', volume: '126240.37200000', quoteVolume: '7984.43091340', openTime: 1521622289427, closeTime: 1521708689427, firstId: 45409308, // First tradeId lastId: 45724293, // Last tradeId count: 314986 // Trade count } ``` </details> #### futures prices Latest price for symbol, not providing a symbol will return latest price for all symbols and is resource-expensive. ```js console.log(await client.futuresPrices()) ``` | Param | Type | Required | | ------ | ------ | -------- | | symbol | String | false | <details> <summary>Output</summary> ```js { BTCUSDT: '8590.05392500', ETHUSDT: '154.1100', ... } ``` </details> #### futures allBookTickers Best price/qty on the order book for all symbols. ```js console.log(await client.futuresAllBookTickers()) ``` <details> <summary>Output</summary> ```js { BTCUSDT: { symbol: 'BTCUSDT', bidPrice: '0.04890400', bidQty: '0.74100000', askPrice: '0.05230000', askQty: '0.79900000' }, ETHUSDT: { symbol: 'ETHUSDT', bidPrice: '0.89582000', bidQty: '0.63300000', askPrice: '1.02328000', askQty: '0.99900000' } ... } ``` </details> #### futures markPrice Mark Price and Funding Rate. ```js console.log(await client.futuresMarkPrice()) ``` <details> <summary>Output</summary> ```js { "symbol": "BTCUSDT", "markPrice": "11012.80409769", "lastFundingRate": "-0.03750000", "nextFundingTime": 1562569200000, "time": 1562566020000 } ``` </details> #### futures AllForceOrders Get all Liquidation Orders. ```js console.log(await client.futuresAllForceOrders()) ``` | Param | Type | Required | | --------- | ------ | -------- | | symbol | String | false | | startTime | Long | false | | endTime | Long | false | | limit | Long | false | <details> <summary>Output</summary> ```js ;[ { symbol: 'BTCUSDT', // SYMBOL price: '7918.33', // ORDER_PRICE origQty: '0.014', // ORDER_AMOUNT executedQty: '0.014', // FILLED_AMOUNT avragePrice: '7918.33', // AVG_PRICE status: 'FILLED', // STATUS timeInForce: 'IOC', // TIME_IN_FORCE type: 'LIMIT', side: 'SELL', // DIRECTION time: 1568014460893, }, ] ``` </details> ### Delivery Public REST Endpoints #### delivery ping Test connectivity to the API. ```js console.log(await client.deliveryPing()) ``` #### delivery time Test connectivity to the Rest API and get the current server time. ```js console.log(await client.deliveryTime()) ``` <details> <summary>Output</summary> ```js 1508478457643 ``` </details> #### delivery exchangeInfo Get the current exchange trading rules and symbol information. ```js console.log(await client.deliveryExchangeInfo()) ``` <details> <summary>Output</summary> ```js { timezone: 'UTC', serverTime: 1663099219744, rateLimits: [ { rateLimitType: 'REQUEST_WEIGHT', interval: 'MINUTE', intervalNum: 1, limit: 2400 }, { rateLimitType: 'ORDERS', interval: 'MINUTE', intervalNum: 1, limit: 1200 } ], exchangeFilters: [], symbols: [...] } ``` </details> #### delivery book Get the order book for a symbol. ```js console.log(await client.deliveryBook({ symbol: 'TRXUSD_PERP' })) ``` | Param | Type | Required | Default | | ------ | ------ | -------- | ------- | | symbol | String | true | | limit | Number | false | `500` | <details> <summary>Output</summary> ```js { lastUpdateId: 17647759, asks: [ { price: '8000.05411500', quantity: '54.55000000' }, { price: '8000.05416700', quantity: '1111.80100000' } ], bids: [ { price: '8000.05395500', quantity: '223.70000000' }, { price: '8000.05395100', quantity: '1134.84100000' } ] } ``` </details> #### delivery candles Retrieves Candlestick for a symbol. Candlesticks are uniquely identified by their open time. ```js console.log(await client.deliveryCandles({ symbol: 'TRXUSD_PERP' })) ``` | Param | Type | Required | Default | Description | | --------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------- | | symbol | String | true | | interval | String | false | `5m` | `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `2h`,<br>`4h`, `6h`, `8h`, `12h`, `1d`, `3d`, `1w`, `1M` | | limit | Number | false | `500` | Max `1000` | | startTime | Number | false | | endTime | Number | false | <details> <summary>Output</summary> ```js [ { openTime: 1663104600000, open: '0.06091', high: '0.06091', low: '0.06086', close: '0.06090', volume: '7927', closeTime: 1663104899999, baseVolume: '1302212.12820796', trades: 75, quoteAssetVolume: '386', baseAssetVolume: '63382.78318786' } ] ``` </details> #### delivery aggTrades Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated. ```js console.log(await client.deliveryAggTrades({ symbol: 'TRXUSD_PERP' })) ``` | Param | Type | Required | Default | Description | | --------- | ------ | -------- | ------- | -------------------------------------------------------- | | symbol | String | true | | | | fromId | String | false | | ID to get aggregate trades from INCLUSIVE. | | startTime | Number | false | | Timestamp in ms to get aggregate trades from INCLUSIVE. | | endTime | Number | false | | Timestamp in ms to get aggregate trades until INCLUSIVE. | | limit | Number | false | `500` | Max `1000` | Note: If both `startTime` and `endTime` are sent, `limit` should not be sent AND the distance between `startTime` and `endTime` must be less than 24 hours. Note: If `fromId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned. Note : Only market trades will be aggregated and returned, which means the insurance fund trades and ADL trades won't be aggregated. <details> <summary>Output</summary> ```js [ { aggId: 14642023, symbol: 'TRXUSD_PERP', price: '0.06087', quantity: '50', firstId: 26319898, lastId: 26319898, timestamp: 1663105187120, isBuyerMaker: false, } ] ``` </details> #### delivery trades Get recent trades of a symbol. ```js console.log(await client.deliveryTrades({ symbol: 'TRXUSD_PERP' })) ``` | Param | Type | Required | Default | Description | | ------ | ------ | -------- | ------- | ----------- | | symbol | String | true | | limit | Number | false | `500` | Max `1000` | <details> <summary>Output</summary> ```js ;[ { id: 26319660, price: '0.06097', qty: '28', baseQty: '4592.42250287', time: 1663103746267, isBuyerMaker: true }, ] ``` </details> #### delivery dailyStats 24 hour price change statistics, not providing a symbol will return all tickers and is resource-expensive. ```js console.log(await client.deliveryDailyStats({ symbol: 'TRXUSD_PERP' })) ``` | Param | Type | Required | | ------ | ------ | -------- | | symbol | String | false | | pair | String | false | <details> <summary>Output</summary> ```js { symbol: 'TRXUSD_PERP', pair: 'TRXUSD', priceChange: '-0.00277', priceChangePercent: '-4.353', weightedAvgPrice: '0.06248010', lastPrice: '0.06087', lastQty: '4', openPrice: '0.06364', highPrice: '0.06395', lowPrice: '0.06069', volume: '545316', baseVolume: '87278342.48218514', openTime: 1663019640000, closeTime: 1663106045576, firstId: 26308774, lastId: 26320065, count: 11292 } ``` </details> #### delivery prices Latest price for all symbols. ```js console.log(await client.futuresPrices()) ``` <details> <summary>Output</summary> ```js { BTCUSDT: '8590.05392500', ETHUSDT: '154.1100', ... } ``` </details> #### delivery allBookTickers Best price/qty on the order book for all symbols. ```js console.log(await client.deliveryAllBookTickers()) ``` <details> <summary>Output</summary> ```js { BTCUSD_PERP: { symbol: 'BTCUSD_PERP', pair: 'BTCUSD', bidPrice: '20120.9', bidQty: '13673', askPrice: '20121.0', askQty: '2628', time: 1663106372658 }, ETHUSD_PERP: { symbol: 'ETHUSD_PERP', pair: 'ETHUSD', bidPrice: '1593.63', bidQty: '7210', askPrice: '1593.64', askQty: '27547', time: 1663106372667 } ... } ``` </details> #### delivery markPrice Mark Price and Funding Rate. ```js console.log(await client.deliveryMarkPrice()) ``` <details> <summary>Output</summary> ```js [ { symbol: 'BTCUSD_221230', pair: 'BTCUSD', markPrice: '20158.81560758', indexPrice: '20152.05327273', estimatedSettlePrice: '20147.96717735', lastFundingRate: '', interestRate: '', nextFundingTime: 0, time: 1663106459005 }, { symbol: 'FILUSD_PERP', pair: 'FILUSD', markPrice: '5.88720470', indexPrice: '5.89106242', estimatedSettlePrice: '5.89377086', lastFundingRate: '0.00010000', interestRate: '0.00010000', nextFundingTime: 1663113600000, time: 1663106459005 } ... ] ``` </details> ### Authenticated REST Endpoints Note that for all authenticated endpoints, you can pass an extra parameter `useServerTime` set to `true` in order to fetch the server time before making the request. #### order - Creates a new order. - see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade ```js console.log( await client.order({ symbol: 'XLMETH', side: 'BUY', quantity: '100', price: '0.0002', }), ) ``` | Param | Type | Required | Default | Description | | ---------------- | ------ | -------- | -------- | ------------------------------------------------------------------- | | symbol | String | true | | | | side | String | true | | `BUY`,`SELL` | | type | String | false | `LIMIT` | `LIMIT`, `MARKET` | | quantity | String | true | | | | price | String | true | | Optional for `MARKET` orders | | timeInForce | String | false | `GTC` | `FOK`, `GTC`, `IOC` | | newClientOrderId | String | false | | A unique id for the order. Automatically generated if not sent. | | stopPrice | Number | false | | Used with stop orders | | activationPrice | Number | false | | Used with `TRAILING_STOP_MARKET` | | callbackRate | Number | false | | Used with `TRAILING_STOP_MARKET` | | newOrderRespType | String | false | `RESULT` | Returns more complete info of the order. `ACK`, `RESULT`, or `FULL` | | icebergQty | Number | false | | Used with iceberg orders | | recvWindow | Number | false | | | Additional mandatory parameters based on `type`: | Type | Additional mandatory parameters | | -----------------------| ----------------------------------------------- | | `LIMIT` | `timeInForce`, `quantity`, `price` | | `MARKET` | `quantity` | | `STOP` | `quantity`, `price`, `stopPrice` | | `STOP_LOSS_LIMIT` | `timeInForce`, `quantity`, `price`, `stopPrice` | | `STOP_LOSS_MARKET` | `stopPrice` | | `TAKE_PROFIT` | `quantity`, `price`, `stopPrice` | | `TAKE_PROFIT_MARKET` | `stopPrice` | | `STOP_PROFIT_LIMIT` | `timeInForce`, `quantity`, `price`, `stopPrice` | | `LIMIT_MAKER` | `quantity`, `price` | | `TRAILING_STOP_MARKET` | `callbackRate`, `activationPrice` | - `LIMIT_MAKER` are `LIMIT` orders that will be rejected if they would immediately match and trade as a taker. - `STOP` and `TAKE_PROFIT` will execute a `MARKET` order when the `stopPrice` is reached. - Any `LIMIT` or `LIMIT_MAKER` type order can be made an iceberg order by sending an `icebergQty`. - Any order with an `icebergQty` MUST have `timeInForce` set to `GTC`. <details> <summary>Output</summary> ```js { symbol: 'XLMETH', orderId: 1740797, clientOrderId: '1XZTVBTGS4K1e', transactTime: 1514418413947, price: '0.00020000', origQty: '100.00000000', executedQty: '0.00000000', status: 'NEW', timeInForce: 'GTC', type: 'LIMIT', side: 'BUY' } ``` </details> #### orderTest Test new order creation and signature/recvWindow. Creates and validates a new order but does not send it into the matching engine. Same API as above, but does not return any output on success. #### updateOrder - updates an order - see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-an-existing-order-and-send-a-new-order-trade ```Js const order = await client.updateOrder({ symbol: 'LTCUSDT', cancelOrderId: 12345678, side: 'BUY', type: 'LIMIT', quantity: 1, price: 80, timeInForce: 'GTC', }) ``` #### orderOco Creates a new OCO order. ```js console.log( await client.orderOco({ symbol: 'XLMETH', side: 'SELL', quantity: 100, price: 0.0002, stopPrice: 0.0001, stopLimitPrice: 0.0001, }), ) ``` | Param | Type | Required | Description |----------------------|--------|----------|------------ | symbol | String | true | | listClientOrderId | String | false | A unique Id for the entire orderList | side | String | true | `BUY`,`SELL` | quantity | Number | true | | limitClientOrderId | String | false | A unique Id for the limit order | price | Number | true | | limitIcebergQty | Number | false | Used to make the `LIMIT_MAKER` leg an iceberg order. | stopClientOrderId | String | false | A unique Id for the stop loss/stop loss limit leg | stopPrice | Number | true | stopLimitPrice | Number | false | If provided, `stopLimitTimeInForce` is required. | stopIcebergQty | Number | false | Used with `STOP_LOSS_LIMIT` leg to make an iceberg order. | stopLimitTimeInForce | String | false | `FOK`, `GTC`, `IOC` | newOrderRespType | String | false | Returns more complete info of the order. `ACK`, `RESULT`, or `FULL` | recvWindow | Number | false | The value cannot be greater than `60000` Additional Info: - Price Restrictions: - `SELL`: Limit Price > Last Price > Stop Price - `BUY`: Limit Price < Last Price < Stop Price - Quantity Restrictions: - Both legs must have the same quantity. - ```ICEBERG``` quantities however do not have to be the same <details> <summary>Output</summary> ```js { "orderListId": 0, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp", "transactionTime": 1514418413947, "symbol": "XLMETH", "orders": [ { "symbol": "XLMETH", "orderId": 1740797, "clientOrderId": "1XZTVBTGS4K1e" }, { "symbol": "XLMETH", "orderId": 1740798, "clientOrderId": "1XZTVBTGS4K1f" } ], "orderReports": [ { "symbol": "XLMETH", "orderId": 1740797, "orderListId": 0, "clientOrderId": "1XZTVBTGS4K1e", "transactTime": 1514418413947, "price": "0.000000", "origQty": "100", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "STOP_LOSS", "side": "SELL", "stopPrice": "0.0001" }, { "symbol": "XLMETH", "orderId": 1740798, "orderListId": 0, "clientOrderId": "1XZTVBTGS4K1f", "transactTime": 1514418413947, "price": "0.0002", "origQty": "100", "executedQty": "0.000000", "cummulativeQuoteQty": "0.000000", "status": "NEW", "timeInForce": "GTC", "type": "LIMIT_MAKER", "side": "SELL" } ] } ``` </details> #### getOrder Check an order's status. ```js console.log( await client.getOrder({ symbol: 'BNBETH', orderId: 50167927, }), ) ``` | Param | Type | Required | Description | | ----------------- | ------ | -------- | ------------------------------------------- | | symbol | String | true | | orderId | Number | true | Not required if `origClientOrderId` is used | | origClientOrderId | String | false | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { clientOrderId: 'NkQnNkdBV1RGjUALLhAzNy', cummulativeQuoteQty: '0.16961580', executedQty: '3.91000000', icebergQty: '0.00000000', isWorking: true, orderId: 50167927, origQty: '3.91000000', price: '0.04338000', side: 'SELL', status: 'FILLED', stopPrice: '0.00000000', symbol: 'BNBETH', time: 1547075007821, timeInForce: 'GTC', type: 'LIMIT', updateTime: 1547075016737 } ``` </details> #### getOrderOco Retrieves a specific OCO based on provided optional parameters ```js console.log( await client.getOrderOco({ orderListId: 27, }), ) ``` | Param | Type | Required | Description | | ----------------- | ------ | -------- | ------------------------------------------- | | orderListId | Number | true | Not required if `listClientOrderId` is used | | listClientOrderId | String | false | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { orderListId: 27, contingencyType: 'OCO', listStatusType: 'EXEC_STARTED', listOrderStatus: 'EXECUTING', listClientOrderId: 'h2USkA5YQpaXHPIrkd96xE', transactionTime: 1565245656253, symbol: 'LTCBTC', orders: [ { symbol: 'LTCBTC', orderId: 4, clientOrderId: 'qD1gy3kc3Gx0rihm9Y3xwS' }, { symbol: 'LTCBTC', orderId: 5, clientOrderId: 'ARzZ9I00CPM8i3NhmU9Ega' } ] } ``` </details> #### cancelOrder Cancels an active order. ```js console.log( await client.cancelOrder({ symbol: 'ETHBTC', orderId: 1, }), ) ``` | Param | Type | Required | Description | | ----------------- | ------ | -------- | -------------------------------------------------------------------------- | | symbol | String | true | | orderId | Number | true | Not required if `origClientOrderId` is used | | origClientOrderId | String | false | | newClientOrderId | String | false | Used to uniquely identify this cancel. Automatically generated by default. | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { symbol: 'ETHBTC', origClientOrderId: 'bnAoRHgI18gRD80FJmsfNP', orderId: 1, clientOrderId: 'RViSsQPTp1v3WmLYpeKT11' } ``` </details> #### cancelOrderOco Cancel an entire Order List. ```js console.log( await client.cancelOrderOco({ symbol: 'ETHBTC', orderListId: 0, }), ) ``` | Param | Type | Required | Description | | ----------------- | ------ | -------- | -------------------------------------------------------------------------- | | symbol | String | true | | orderListId | Number | true | Not required if `listClientOrderId` is used | | listClientOrderId | String | false | | newClientOrderId | String | false | Used to uniquely identify this cancel. Automatically generated by default. | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { orderListId: 0, contingencyType: 'OCO', listStatusType: 'ALL_DONE', listOrderStatus: 'ALL_DONE', listClientOrderId: 'C3wyj4WVEktd7u9aVBRXcN', transactionTime: 1574040868128, symbol: 'LTCBTC', orders: [ { symbol: 'LTCBTC', orderId: 2, clientOrderId: 'pO9ufTiFGg3nw2fOdgeOXa' }, { symbol: 'LTCBTC', orderId: 3, clientOrderId: 'TXOvglzXuaubXAaENpaRCB' } ], orderReports: [ { symbol: 'LTCBTC', origClientOrderId: 'pO9ufTiFGg3nw2fOdgeOXa', orderId: 2, orderListId: 0, clientOrderId: 'unfWT8ig8i0uj6lPuYLez6', price: '1.00000000', origQty: '10.00000000', executedQty: '0.00000000', cummulativeQuoteQty: '0.00000000', status: 'CANCELED', timeInForce: 'GTC', type: 'STOP_LOSS_LIMIT', side: 'SELL', stopPrice: '1.00000000' }, { symbol: 'LTCBTC', origClientOrderId: 'TXOvglzXuaubXAaENpaRCB', orderId: 3, orderListId: 0, clientOrderId: 'unfWT8ig8i0uj6lPuYLez6', price: '3.00000000', origQty: '10.00000000', executedQty: '0.00000000', cummulativeQuoteQty: '0.00000000', status: 'CANCELED', timeInForce: 'GTC', type: 'LIMIT_MAKER', side: 'SELL' } ] } ``` </details> #### cancelOpenOrders Cancels all active orders on a symbol. This includes OCO orders. ```js console.log( await client.cancelOpenOrders({ symbol: 'ETHBTC' }), ) ``` | Param | Type | Required | |------------|----------|-----------| | symbol | String | true | <details> <summary>Output</summary> ```js [ { symbol: 'ETHBTC', origClientOrderId: 'bnAoRHgI18gRD80FJmsfNP', orderId: 1, clientOrderId: 'RViSsQPTp1v3WmLYpeKT11' }, { symbol: 'ETHBTC', origClientOrderId: 'IDbzcGmfwSCKihxILK1snu', orderId: 2, clientOrderId: 'HKFcuWAm9euMgRuwVGR8CL' } ] ``` </details> #### openOrders Get all open orders on a symbol. ```js console.log( await client.openOrders({ symbol: 'XLMBTC', }), ) ``` | Param | Type | Required | | ---------- | ------ | -------- | | symbol | String | true | | recvWindow | Number | false | <details> <summary>Output</summary> ```js ;[ { symbol: 'XLMBTC', orderId: 11271740, clientOrderId: 'ekHkROfW98gBN80LTfufQZ', price: '0.00001081', origQty: '1331.00000000', executedQty: '0.00000000', status: 'NEW', timeInForce: 'GTC', type: 'LIMIT', side: 'BUY', stopPrice: '0.00000000', icebergQty: '0.00000000', time: 1522682290485, isWorking: true, }, ] ``` </details> #### allOrders Get all account orders on a symbol; active, canceled, or filled. ```js console.log( await client.allOrders({ symbol: 'ETHBTC', }), ) ``` | Param | Type | Required | Default | Description | | ---------- | ------ | -------- | ------- | -------------------------------------------------------------------------------------- | | symbol | String | true | | orderId | Number | false | | If set, it will get orders >= that orderId. Otherwise most recent orders are returned. | | limit | Number | false | `500` | Max `500` | | recvWindow | Number | false | <details> <summary>Output</summary> ```js ;[ { symbol: 'ENGETH', orderId: 191938, clientOrderId: '1XZTVBTGS4K1e', price: '0.00138000', origQty: '1.00000000', executedQty: '1.00000000', status: 'FILLED', timeInForce: 'GTC', type: 'LIMIT', side: 'SELL', stopPrice: '0.00000000', icebergQty: '0.00000000', time: 1508611114735, isWorking: true, }, ] ``` </details> #### allOrdersOCO Retrieves all OCO based on provided optional parameters ```js console.log( await client.allOrdersOCO({ timestamp: 1565245913483, }), ) ``` | Param | Type | Required | Default | Description | |------------|---------|----------|---------|-----------------------------------------------------------| | timestamp | Number | true | | | | startTime | Number | false | | | | endTime | Number | false | | | | limit | Integer | false | `500` | Max `1000` | | recvWindow | Number | false | | The value cannot be greater than 60000 | | formId | Number | false | | If supplied, neither startTime or endTime can be provided | <details> <summary>Output</summary> ```js ;[ { "orderListId": 29, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ", "transactionTime": 1565245913483, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 4, "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB" }, { "symbol": "LTCBTC", "orderId": 5, "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3" } ] }, { "orderListId": 28, "contingencyType": "OCO", "listStatusType": "EXEC_STARTED", "listOrderStatus": "EXECUTING", "listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d", "transactionTime": 1565245913407, "symbol": "LTCBTC", "orders": [ { "symbol": "LTCBTC", "orderId": 2, "clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP" }, { "symbol": "LTCBTC", "orderId": 3, "clientOrderId": "z0KCjOdditiLS5ekAFtK81" } ] } ] ``` </details> #### accountInfo Get current account information. ```js console.log(await client.accountInfo()) ``` | Param | Type | Required | | ---------- | ------ | -------- | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { makerCommission: 10, takerCommission: 10, buyerCommission: 0, sellerCommission: 0, canTrade: true, canWithdraw: true, canDeposit: true, balances: [ { asset: 'BTC', free: '0.00000000', locked: '0.00000000' }, { asset: 'LTC', free: '0.00000000', locked: '0.00000000' }, ] } ``` </details> #### myTrades Get trades for the current authenticated account and symbol. ```js console.log( await client.myTrades({ symbol: 'ETHBTC', }), ) ``` | Param | Type | Required | Default | Description | | ---------- | ------ | -------- | ------- | ------------------------------------------------------- | | symbol | String | true | | limit | Number | false | `500` | Max `1000` | | fromId | Number | false | | TradeId to fetch from. Default gets most recent trades. | | orderId | Number | false | | This can only be used in combination with symbol. | | startTime | Number | false | | | | endTime | Number | false | | | | recvWindow | Number | false | `5000` | The value cannot be greater than `60000`. | <details> <summary>Output</summary> ```js ;[ { id: 9960, orderId: 191939, price: '0.00138000', qty: '10.00000000', commission: '0.00001380', commissionAsset: 'ETH', time: 1508611114735, isBuyer: false, isMaker: false, isBestMatch: true, }, ] ``` </details> #### dailyAccountSnapshot Get asset snapshot for the current authenticated account. ```js console.log( await client.accountSnapshot({ "type": "SPOT" }); ) ``` | Param | Type | Required | Default | Description | | ---------- | ------ | -------- | ------- | ------------------------------------------------------- | | type | String | true | | startTime | Number | false | | endTime | Number | false | | limit | Number | false | `5` | min `5`, max `30`, default `5` | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { "code":200, // 200 for success; others are error codes "msg":"", // error message "snapshotVos":[ { "data":{ "balances":[ { "asset":"BTC", "free":"0.09905021", "locked":"0.00000000" }, { "asset":"USDT", "free":"1.89109409", "locked":"0.00000000" } ], "totalAssetOfBtc":"0.09942700" }, "type":"spot", "updateTime":1576281599000 } ] } ``` </details> #### tradesHistory Lookup symbol trades history. ```js console.log(await client.tradesHistory({ symbol: 'ETHBTC' })) ``` | Param | Type | Required | Default | Description | | ------ | ------ | -------- | ------- | ------------------------------------------------------- | | symbol | String | true | | limit | Number | false | `500` | Max `500` | | fromId | Number | false | `null` | TradeId to fetch from. Default gets most recent trades. | <details> <summary>Output</summary> ```js ;[ { id: 28457, price: '4.00000100', qty: '12.00000000', time: 1499865549590, isBuyerMaker: true, isBestMatch: true, }, ] ``` </details> #### withdrawHistory Get the account withdraw history. ```js console.log(await client.withdrawHistory()) ``` | Param | Type | Required | Description | | ---------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------- | | asset | String | false | | | status | Number | false | 0 (0: Email Sent, 1: Cancelled 2: Awaiting Approval, 3: Rejected, 4: Processing, 5: Failure, 6: Completed) | | offset | Number | false | | | limit | Number | false | | | startTime | Number | false | | | endTime | Number | false | | | recvWindow | Number | false | | <details> <summary>Output</summary> ```js [ { "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60", "amount": "8.91000000", "applyTime": "2019-10-12 11:12:02", "coin": "USDT", "id": "b6ae22b3aa844210a7041aee7589627c", "withdrawOrderId": "WITHDRAWtest123", // will not be returned if there's no withdrawOrderId for this withdraw. "network": "ETH", "transferType": 0, // 1 for internal transfer, 0 for external transfer "status": 6, "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268" }, { "address": "1FZdVHtiBqMrWdjPyRPULCUceZPJ2WLCsB", "amount": "0.00150000", "applyTime": "2019-09-24 12:43:45", "coin": "BTC", "id": "156ec387f49b41df8724fa744fa82719", "network": "BTC", "status": 6, "txId": "60fd9007ebfddc753455f95fafa808c4302c836e4d1eebc5a132c36c1d8ac354" } ] ``` </details> #### withdraw Triggers the withdraw process. ```js console.log( await client.withdraw({ coin: 'ETH', network: 'ETH', address: '0xfa97c22a03d8522988c709c24283c0918a59c795', amount: 100, // addressTag: '' // MEMO }), ) ``` | Param | Type | Required | Description | | ---------- | ------ | -------- | -------------------------- | | asset | String | true | | address | String | true | | amount | Number | true | | name | String | false | Description of the address | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { "id":"7213fea8e94b4a5593d507237e5a555b" } ``` </details> #### depositAddress Fetch deposit address with network. ```js console.log(await client.depositAddress({ coin: 'NEO' })) ``` | Param | Type | Required | Description | | -------- | ------ | -------- | ---------------- | | coin | String | true | The coin name | | network | String | false | The network name | <details> <summary>Output</summary> ```js { address: 'AM6ytPW78KYxQCmU2pHYGcee7GypZ7Yhhc', coin: 'NEO', tag: '', url: 'https://neoscan.io/address/AM6ytPW78KYxQCmU2pHYGcee7GypZ7Yhhc' } ``` </details> #### depositHistory Fetch deposit address with network. ```js console.log(await client.depositHistory()) ``` | Param | Type | Required | Description | | ---------- | ------ | -------- | ---------------- | | coin | String | false | The coin name | | status | Number | false | 0 (0:pending, 6: credited but cannot withdraw, 1:success) | | startTime | Number | false | Default: 90 days from current timestamp | | endTime | Number | false | Default: present timestamp | | offset | Number | false | default: 0 | | limit | Number | false | | | recvWindow | Number | false | | <details> <summary>Output</summary> ```js [ { "amount": "0.00999800", "coin": "PAXG", "network": "ETH", "status": 1, "address": "0x788cabe9236ce061e5a892e1a59395a81fc8d62c", "addressTag": "", "txId": "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3", "insertTime": 1599621997000, "transferType": 0, "confirmTimes": "12/12" }, { "amount": "0.50000000", "coin": "IOTA", "network": "IOTA", "status": 1, "address": "SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW", "addressTag": "", "txId": "ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999", "insertTime": 1599620082000, "transferType": 0, "confirmTimes": "1/1" } ] ``` </details> #### tradeFee Retrieve the account trade Fee per asset. ```js console.log(await client.tradeFee()) ``` <details> <summary>Output</summary> ```js [ { "symbol": "ADABNB", "makerCommission": 0.9000, "takerCommission": 1.0000 }, { "symbol": "BNBBTC", "makerCommission": 0.3000, "takerCommission": 0.3000 } ] ``` </details> #### capitalConfigs Get information of coins (available for deposit and withdraw) for user. ```js console.log(await client.capitalConfigs()) ``` <details> <summary>Output</summary> ```js [ { 'coin': 'CTR', 'depositAllEnable': false, 'free': '0.00000000', 'freeze': '0.00000000', 'ipoable': '0.00000000', 'ipoing': '0.00000000', 'isLegalMoney': false, 'locked': '0.00000000', 'name': 'Centra', 'networkList': [ { 'addressRegex': '^(0x)[0-9A-Fa-f]{40}$', 'coin': 'CTR', 'depositDesc': 'Delisted, Deposit Suspended', 'depositEnable': false, 'isDefault': true, 'memoRegex': '', 'minConfirm': 12, 'name': 'ERC20', 'network': 'ETH', 'resetAddressStatus': false, 'specialTips': '', 'unLockConfirm': 0, 'withdrawDesc': '', 'withdrawEnable': true, 'withdrawFee': '35.00000000', 'withdrawIntegerMultiple': '0.00000001', 'withdrawMax': '0.00000000', 'withdrawMin': '70.00000000' } ], 'storage': '0.00000000', 'trading': false, 'withdrawAllEnable': true, 'withdrawing': '0.00000000' } ] ``` </details> #### universalTransfer You need to enable Permits Universal Transfer option for the api key which requests this endpoint. ```js console.log(await client.universalTransfer({ type: 'MAIN_C2C', asset: 'USDT', amount: '1000' })) ``` | Param | Type | Required | Description | | ---------- | ------ | -------- | ---------------- | | type | String | true | | asset | String | true | | amount | String | true | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { tranId:13526853623 } ``` </details> #### universalTransferHistory ```js console.log(await client.universalTransferHistory({ type: 'MAIN_C2C' })) ``` | Param | Type | Required | Description | | ---------- | ------ | -------- | ------------------- | | type | String | true | | startTime | Number | false | | endTime | Number | false | | current | Number | false | Default 1 | | size | Number | false | Default 10, Max 100 | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { "total": 2, "rows": [ { "asset":"USDT", "amount":"1", "type":"MAIN_C2C" "status": "CONFIRMED", "tranId": 11415955596, "timestamp":1544433328000 }, { "asset":"USDT", "amount":"2", "type":"MAIN_C2C", "status": "CONFIRMED", "tranId": 11366865406, "timestamp":1544433328000 } ] } ``` </details> #### assetDetail ```js console.log(await client.assetDetail()) ``` | Param | Type | Required | Description | | ---------- | -------- | -------- | ------------------- | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { "CTR": { "minWithdrawAmount": "70.00000000", //min withdraw amount "depositStatus": false,//deposit status (false if ALL of networks' are false) "withdrawFee": 35, // withdraw fee "withdrawStatus": true, //withdraw status (false if ALL of networks' are false) "depositTip": "Delisted, Deposit Suspended" //reason }, "SKY": { "minWithdrawAmount": "0.02000000", "depositStatus": true, "withdrawFee": 0.01, "withdrawStatus": true } } ``` </details> #### getBnbBurn ```js console.log(await client.getBnbBurn()) ``` | Param | Type | Required | Description | | ---------- | -------- | -------- | ------------------- | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "spotBNBBurn":true, "interestBNBBurn": false } ``` </details> #### setBnbBurn ```js console.log(await client.setBnbBurn({ spotBNBBurn: "true" })) ``` | Param | Type | Required | Description | | --------------- | -------- | -------- | ------------------- | | spotBNBBurn | String | false | "true" or "false"; Determines whether to use BNB to pay for trading fees on SPOT | | interestBNBBurn | String | false | "true" or "false"; Determines whether to use BNB to pay for margin loan's interest | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "spotBNBBurn":true, "interestBNBBurn": false } ``` </details> #### dustLog ```js console.log(await client.dustLog()) ``` | Param | Type | Required | Description | | ---------- | -------- | -------- | ------------------- | | startTime | Number | false | | endTime | Number | false | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { "total": 8, //Total counts of exchange "userAssetDribblets": [ { "operateTime": 1615985535000, "totalTransferedAmount": "0.00132256", "totalServiceChargeAmount": "0.00002699", "transId": 45178372831, "userAssetDribbletDetails": [ { "transId": 4359321, "serviceChargeAmount": "0.000009", "amount": "0.0009", "operateTime": 1615985535000, "transferedAmount": "0.000441", "fromAsset": "USDT" }, { "transId": 4359321, "serviceChargeAmount": "0.00001799", "amount": "0.0009", "operateTime": 1615985535000, "transferedAmount": "0.00088156", "fromAsset": "ETH" } ] }, { "operateTime":1616203180000, "totalTransferedAmount": "0.00058795", "totalServiceChargeAmount": "0.000012", "transId": 4357015, "userAssetDribbletDetails": [ { "transId": 4357015, "serviceChargeAmount": "0.00001", "amount": "0.001", "operateTime": 1616203180000, "transferedAmount": "0.00049", "fromAsset": "USDT" }, { "transId": 4357015, "serviceChargeAmount": "0.000002", "amount": "0.0001", "operateTime": 1616203180000, "transferedAmount": "0.00009795", "fromAsset": "ETH" } ] } ] } } ``` </details> #### dustTransfer ```js console.log(await client.dustTransfer({ asset: ['ETH', 'LTC', 'TRX'] })) ``` | Param | Type | Required | Description | | ---------- | -------- | -------- | ------------------- | | asset | [String] | true | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { "totalServiceCharge":"0.02102542", "totalTransfered":"1.05127099", "transferResult":[ { "amount":"0.03000000", "fromAsset":"ETH", "operateTime":1563368549307, "serviceChargeAmount":"0.00500000", "tranId":2970932918, "transferedAmount":"0.25000000" }, { "amount":"0.09000000", "fromAsset":"LTC", "operateTime":1563368549404, "serviceChargeAmount":"0.01548000", "tranId":2970932918, "transferedAmount":"0.77400000" }, { "amount":"248.61878453", "fromAsset":"TRX", "operateTime":1563368549489, "serviceChargeAmount":"0.00054542", "tranId":2970932918, "transferedAmount":"0.02727099" } ] } ``` </details> #### accountCoins Retrieve account coins related information. Implemented as `getAll` in Binance Docs. ```js console.log(await client.accountCoins()) ``` | Param | Type | Required | Description | | ---------- | -------- | -------- | ------------------- | | recvWindow | Number | false | <details> <summary>Output</summary> ```js [ { "coin": "BTC", "depositAllEnable": true, "free": "0.08074558", "freeze": "0.00000000", "ipoable": "0.00000000", "ipoing": "0.00000000", "isLegalMoney": false, "locked": "0.00000000", "name": "Bitcoin", "networkList": [ { "addressRegex": "^(bnb1)[0-9a-z]{38}$", "coin": "BTC", "depositDesc": "Wallet Maintenance, Deposit Suspended", // shown only when "depositEnable" is false. "depositEnable": false, "isDefault": false, "memoRegex": "^[0-9A-Za-z\\-_]{1,120}$", "minConfirm": 1, // min number for balance confirmation "name": "BEP2", "network": "BNB", "resetAddressStatus": false, "specialTips": "Both a MEMO and an Address are required to successfully deposit your BEP2-BTCB tokens to Binance.", "unLockConfirm": 0, // confirmation number for balance unlock "withdrawDesc": "Wallet Maintenance, Withdrawal Suspended", // shown only when "withdrawEnable" is false. "withdrawEnable": false, "withdrawFee": "0.00000220", "withdrawMin": "0.00000440" }, { "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$", "coin": "BTC", "depositEnable": true, "insertTime": 1563532929000, "isDefault": true, "memoRegex": "", "minConfirm": 1, "name": "BTC", "network": "BTC", "resetAddressStatus": false, "specialTips": "", "unLockConfirm": 2, "updateTime": 1571014804000, "withdrawEnable": true, "withdrawFee": "0.00050000", "withdrawIntegerMultiple": "0.00000001", "withdrawMin": "0.00100000" } ], "storage": "0.00000000", "trading": true, "withdrawAllEnable": true, "withdrawing": "0.00000000" } ] ``` </details> #### lendingAccount Get information of lending assets for user. ```js console.log(await client.lendingAccount()) ``` <details> <summary>Output</summary> ```js { "positionAmountVos": [ { "amount": "75.46000000", "amountInBTC": "0.01044819", "amountInUSDT": "75.46000000", "asset": "USDT" }, { "amount": "1.67072036", "amountInBTC": "0.00023163", "amountInUSDT": "1.67289230", "asset": "BUSD" } ], "totalAmountInBTC": "0.01067982", "totalAmountInUSDT": "77.13289230", "totalFixedAmountInBTC": "0.00000000", "totalFixedAmountInUSDT": "0.00000000", "totalFlexibleInBTC": "0.01067982", "totalFlexibleInUSDT": "77.13289230" } ``` </details> #### fundingWallet Query funding wallet, includes Binance Pay, Binance Card, Binance Gift Card, Stock Token. ```js console.log(await client.fundingWallet()) ``` | Param | Type | Required | Description | | ---------- | -------- | -------- | ------------------- | | asset | String | false | | needBtcValuation | String | false | 'true' or 'false' <details> <summary>Output</summary> ```js [ { "asset": "USDT", "free": "1", "locked": "0", "freeze": "0", "withdrawing": "0", "btcValuation": "0.00000091" } ] ``` </details> #### apiPermission Get API Key Permission. ```js console.log(await client.apiPermission()) ``` | Param | Type | Required | Description | | ---------- | -------- | -------- | ------------------- | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { "ipRestrict": false, "createTime": 1623840271000, "enableWithdrawals": false, // This option allows you to withdraw via API. You must apply the IP Access Restriction filter in order to withdrawals "enableInternalTransfer": true, // This option authorizes this key to transfer funds between your master account and your sub account instantly "permitsUniversalTransfer": true, // Authorizes this key to be used for a dedicated universal transfer API to transfer multiple supported currencies. Each business's own transfer API rights are not affected by this authorization "enableVanillaOptions": false, // Authorizes this key to Vanilla options trading "enableReading": true, "enableFutures": false, // API Key created before your futures account opened does not support futures API service "enableMargin": false, // This option can be adjusted after the Cross Margin account transfer is completed "enableSpotAndMarginTrading": false, // Spot and margin trading "tradingAuthorityExpirationTime": 1628985600000 // Expiration time for spot and margin trading permission } ``` </details> ### Margin #### marginAccountInfo Query cross margin account details (USER_DATA) ```js console.log(await client.marginAccountInfo()); ``` | Param | Type | Required | Description | | ----- | ------ | -------- | -------------- | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "borrowEnabled": true, "marginLevel": "11.64405625", "totalAssetOfBtc": "6.82728457", "totalLiabilityOfBtc": "0.58633215", "totalNetAssetOfBtc": "6.24095242", "tradeEnabled": true, "transferEnabled": true, "userAssets": [ { "asset": "BTC", "borrowed": "0.00000000", "free": "0.00499500", "interest": "0.00000000", "locked": "0.00000000", "netAsset": "0.00499500" }, { "asset": "BNB", "borrowed": "201.66666672", "free": "2346.50000000", "interest": "0.00000000", "locked": "0.00000000", "netAsset": "2144.83333328" }, { "asset": "ETH", "borrowed": "0.00000000", "free": "0.00000000", "interest": "0.00000000", "locked": "0.00000000", "netAsset": "0.00000000" }, { "asset": "USDT", "borrowed": "0.00000000", "free": "0.00000000", "interest": "0.00000000", "locked": "0.00000000", "netAsset": "0.00000000" } ] } ``` </details> #### marginLoan Create a loan for margin account. ```js console.log(await client.marginLoan({ asset: 'BTC', amount:'0.0001' })); ``` | Param | Type | Required | Description | | ------ | ------ | -------- | -------------- | | asset | String | true | The asset name | | amount | Number | true | <details> <summary>Output</summary> ```js { "tranId": 100000001 //transaction id } ``` </details> #### marginRepay Repay loan for margin account. ```js console.log(await client.marginRepay({ asset: 'BTC', amount:'0.0001' })); ``` | Param | Type | Required | Description | | ------ | ------ | -------- | -------------- | | asset | String | true | The asset name | | amount | Number | true | <details> <summary>Output</summary> ```js { "tranId": 100000001 //transaction id } ``` </details> #### marginIsolatedAccount Query Isolated Margin Account Info ```js console.log(await client.marginIsolatedAccount({ symbols: 'BTCUSDT'})); ``` | Param | Type | Required | Description | | ----- | ------ | -------- | -------------- | | symbols | String | false | Max 5 symbols can be sent; separated by "," | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "assets":[ { "baseAsset": { "asset": "BTC", "borrowEnabled": true, "borrowed": "0.00000000", "free": "0.00000000", "interest": "0.00000000", "locked": "0.00000000", "netAsset": "0.00000000", "netAssetOfBtc": "0.00000000", "repayEnabled": true, "totalAsset": "0.00000000" }, "quoteAsset": { "asset": "USDT", "borrowEnabled": true, "borrowed": "0.00000000", "free": "0.00000000", "interest": "0.00000000", "locked": "0.00000000", "netAsset": "0.00000000", "netAssetOfBtc": "0.00000000", "repayEnabled": true, "totalAsset": "0.00000000" }, "symbol": "BTCUSDT" "isolatedCreated": true, "marginLevel": "0.00000000", "marginLevelStatus": "EXCESSIVE", // "EXCESSIVE", "NORMAL", "MARGIN_CALL", "PRE_LIQUIDATION", "FORCE_LIQUIDATION" "marginRatio": "0.00000000", "indexPrice": "10000.00000000" "liquidatePrice": "1000.00000000", "liquidateRate": "1.00000000" "tradeEnabled": true } ], "totalAssetOfBtc": "0.00000000", "totalLiabilityOfBtc": "0.00000000", "totalNetAssetOfBtc": "0.00000000" } ``` </details> #### disableMarginAccount Inactive Isolated Margin trading pair for symbol ```js console.log(await client.disableMarginAccount({ symbol: 'BTCUSDT' })); ``` | Param | Type | Required | Description | | ----- | ------ | -------- | -------------- | | symbol | String | true | | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "success": true, "symbol": "BTCUSDT" } ``` </details> #### enableMarginAccount Active Isolated Margin trading pair for symbol ```js console.log(await client.enableMarginAccount({ symbol: 'BTCUSDT' })); ``` | Param | Type | Required | Description | | ----- | ------ | -------- | -------------- | | symbol | String | true | | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "success": true, "symbol": "BTCUSDT" } ``` </details> #### marginMaxBorrow If isolatedSymbol is not sent, crossed margin data will be sent. ```js console.log(await client.marginMaxBorrow({ asset: 'BTC', isolatedSymbol: 'BTCUSDT'})); ``` | Param | Type | Required | Description | | ----- | ------ | -------- | -------------- | | asset | String | true | | isolatedSymbol| String | false | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "amount": "1.69248805", // account's currently max borrowable amount with sufficient system availability "borrowLimit": "60" // max borrowable amount limited by the account level } ``` </details> #### marginCreateIsolated ```js console.log(await client.marginCreateIsolated({ base: 'BTC', quote: 'USDT'})); ``` | Param | Type | Required | Description | | ---------- | ------ | -------- | --------------------- | | base | String | true | Base asset of symbol | | quote | String | true | Quote asset of symbol | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "success": true, "symbol": "BTCUSDT" } ``` </details> #### marginIsolatedTransfer ```js console.log(await client.marginIsolatedTransfer({ asset: 'USDT', symbol: 'BNBUSDT', transFrom: 'ISOLATED_MARGIN', transTo: 'SPOT', amount: 1})); ``` | Param | Type | Required | Description | | ---------- | ------ | -------- | ------------------------- | | asset | String | true | asset,such as BTC | | symbol | String | true | | transFrom | String | true | "SPOT", "ISOLATED_MARGIN" | | transTo | String | true | "SPOT", "ISOLATED_MARGIN" | | amount | Number | true | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { //transaction id "tranId": 100000001 } ``` </details> #### marginIsolatedTransferHistory ```js console.log(await client.marginIsolatedTransferHistory({ symbol: 'BNBUSDT'})); ``` | Param | Type | Required | Description | | ---------- | ------ | -------- | ------------------------- | | asset | String | false | asset,such as BTC | | symbol | String | true | | transFrom | String | false | "SPOT", "ISOLATED_MARGIN" | | transTo | String | false | "SPOT", "ISOLATED_MARGIN" | | startTime | Number | false | | endTime | Number | false | | current | Number | false | Current page, default 1 | | size | Number | false | Default 10, max 100 | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "rows": [ { "amount": "0.10000000", "asset": "BNB", "status": "CONFIRMED", "timestamp": 1566898617000, "txId": 5240372201, "transFrom": "SPOT", "transTo": "ISOLATED_MARGIN" }, { "amount": "5.00000000", "asset": "USDT", "status": "CONFIRMED", "timestamp": 1566888436123, "txId": 5239810406, "transFrom": "ISOLATED_MARGIN", "transTo": "SPOT" } ], "total": 2 } ``` </details> #### marginOrder ```js console.log(await client.marginOrder({ symbol: 'BTCUSDT', type: 'MARKET', side: 'SELL', quantity: '10', })); ``` | Param | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------- | | symbol | String | true | asset, such as `BTC` | | isIsolated | String | false | for isolated margin or not, `TRUE`, `FALSE`, default `FALSE` | side | String | true | `BUY` `SELL` | | type | String | true | | quantity | String | false | | quoteOrderQty | String | false | | price | String | false | | stopPrice | String | false | Used with `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` orders. | newClientOrderId | String | false | A unique id among open orders. Automatically generated if not sent. | icebergQty | Boolean | false | Used with `LIMIT`, `STOP_LOSS_LIMIT`, and `TAKE_PROFIT_LIMIT` to create an iceberg order. | newOrderRespType | String | false | Set the response JSON. `ACK`, `RESULT`, or `FULL`; `MARKET` and `LIMIT` order types default to `FULL`, all other orders default to `ACK`. | sideEffectType | String | false | `NO_SIDE_EFFECT`, `MARGIN_BUY`, `AUTO_REPAY`; default `NO_SIDE_EFFECT`. | timeInForce | String | false | `GTC`,`IOC`,`FOK` | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "symbol": "BTCUSDT", "orderId": 28, "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP", "transactTime": 1507725176595, "price": "1.00000000", "origQty": "10.00000000", "executedQty": "10.00000000", "cummulativeQuoteQty": "10.00000000", "status": "FILLED", "timeInForce": "GTC", "type": "MARKET", "side": "SELL", "marginBuyBorrowAmount": 5, // will not return if no margin trade happens "marginBuyBorrowAsset": "BTC", // will not return if no margin trade happens "isIsolated": true, // if isolated margin "fills": [ { "price": "4000.00000000", "qty": "1.00000000", "commission": "4.00000000", "commissionAsset": "USDT" }, { "price": "3999.00000000", "qty": "5.00000000", "commission": "19.99500000", "commissionAsset": "USDT" }, { "price": "3998.00000000", "qty": "2.00000000", "commission": "7.99600000", "commissionAsset": "USDT" }, { "price": "3997.00000000", "qty": "1.00000000", "commission": "3.99700000", "commissionAsset": "USDT" }, { "price": "3995.00000000", "qty": "1.00000000", "commission": "3.99500000", "commissionAsset": "USDT" } ] } ``` </details> #### marginCancelOrder Cancels an active margin order. ```js console.log( await client.marginCancelOrder({ symbol: 'ETHBTC', orderId: 1, }), ) ``` | Param | Type | Required | Description | | ----------------- | ------ | -------- | -------------------------------------------------------------------------- | | symbol | String | true | | orderId | Number | true | Not required if `origClientOrderId` is used | | origClientOrderId | String | false | | newClientOrderId | String | false | Used to uniquely identify this cancel. Automatically generated by default. | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { symbol: "LTCBTC", orderId: 28, origClientOrderId: "myOrder1", clientOrderId: "cancelMyOrder1", price: "1.00000000", origQty: "10.00000000", executedQty: "8.00000000", cummulativeQuoteQty: "8.00000000", status: "CANCELED", timeInForce: "GTC", type: "LIMIT", side: "SELL" } ``` </details> #### marginOrderOco ```js console.log(await client.marginOrderOco({ symbol: 'AUDIOUSDT', type: 'MARKET', side: 'SELL', quantity: '10', })); ``` | Param | Type | Required | Description | | ----------------- | ------- | -------- | ------------------------- | | symbol | String | true | asset, such as `BTC` | | isIsolated | String | false | for isolated margin or not, `TRUE`, `FALSE`, default `FALSE` | side | String | true | `BUY` `SELL` | | type | String | true | | quantity | String | false | | quoteOrderQty | String | false | | price | String | false | | stopPrice | String | false | Used with `STOP_LOSS`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT`, and `TAKE_PROFIT_LIMIT` orders. | stopLimitPrice | String | false | Used with `STOP_LOSS_LIMIT` orders. | newClientOrderId | String | false | A unique id among open orders. Automatically generated if not sent. | icebergQty | Boolean | false | Used with `LIMIT`, `STOP_LOSS_LIMIT`, and `TAKE_PROFIT_LIMIT` to create an iceberg order. | newOrderRespType | String | false | Set the response JSON. `ACK`, `RESULT`, or `FULL`; `MARKET` and `LIMIT` order types default to `FULL`, all other orders default to `ACK`. | sideEffectType | String | false | `NO_SIDE_EFFECT`, `MARGIN_BUY`, `AUTO_REPAY`; default `NO_SIDE_EFFECT`. | timeInForce | String | false | `GTC`,`IOC`,`FOK` | | recvWindow | Number | false | No more than 60000 | <details> <summary>Output</summary> ```js { "orderListId": 45514668, "contingencyType": 'OCO', "listStatusType": 'EXEC_STARTED', "listOrderStatus": 'EXECUTING', "listClientOrderId": 'CD9UzEJfmcGZ4kLfZT2ga2', "transactionTime": 1632192162785, "symbol": 'AUDIOUSDT', "isIsolated": true, "orders": [ { "symbol": 'AUDIOUSDT', "orderId": 239313661, "clientOrderId": 'ZbUwgKv6UB8eMzf2yfXENl' }, { "symbol": 'AUDIOUSDT', "orderId": 239313662, "clientOrderId": 'f5u1RIHAPRd4W3fFhFykBo' } ], "orderReports": [ { "symbol": 'AUDIOUSDT', "orderId": 239313661, "orderListId": 45514668, "clientOrderId": 'ZbUwgKv6UB8eMzf2yfXENl', "transactTime": 1632192162785, "price": '2.20000000', "origQty": '12.80000000', "executedQty": '0', "cummulativeQuoteQty": '0', "status": 'NEW', "timeInForce": 'GTC', "type": 'STOP_LOSS_LIMIT', "side": 'SELL', "stopPrice": '2.20000000' }, { "symbol": 'AUDIOUSDT', "orderId": 239313662, "orderListId": 45514668, "clientOrderId": 'f5u1RIHAPRd4W3fFhFykBo', "transactTime": 1632192162785, "price": '2.50000000', "origQty": '12.80000000', "executedQty": '0', "cummulativeQuoteQty": '0', "status": 'NEW', "timeInForce": 'GTC', "type": 'LIMIT_MAKER', "side": 'SELL' } ] } ``` </details> #### marginOpenOrders Query Margin Account's Open Orders ```js console.log( await client.marginOpenOrders({ symbol: 'XLMBTC', }), ) ``` | Param | Type | Required | | ---------- | ------ | -------- | | symbol | String | false | | isIsolated | String | false | | recvWindow | Number | false | <details> <summary>Output</summary> ```js ;[ { clientOrderId: "qhcZw71gAkCCTv0t0k8LUK", cummulativeQuoteQty: "0.00000000", executedQty: "0.00000000", icebergQty: "0.00000000", isWorking: true, orderId: 211842552, origQty: "0.30000000", price: "0.00475010", side: "SELL", status: "NEW", stopPrice: "0.00000000", symbol: "BNBBTC", isIsolated: true, time: 1562040170089, timeInForce: "GTC", type: "LIMIT", selfTradePreventionMode: "NONE", updateTime: 1562040170089 } ] ``` </details> #### marginCancelOpenOrders Cancels all active orders on a symbol for margin account. This includes OCO orders. ```js console.log( await client.marginCancelOpenOrders({ symbol: 'ETHBTC' }), ) ``` | Param | Type | Required | |------------|----------|-----------| | symbol | String | true | | isIsolated | String | false | <details> <summary>Output</summary> ```js [ { symbol: 'ETHBTC', isIsolated: false, origClientOrderId: 'bnAoRHgI18gRD80FJmsfNP', orderId: 1, clientOrderId: 'RViSsQPTp1v3WmLYpeKT11' }, { symbol: 'ETHBTC', isIsolated: false, origClientOrderId: 'IDbzcGmfwSCKihxILK1snu', orderId: 2, clientOrderId: 'HKFcuWAm9euMgRuwVGR8CL' } ] ``` </details> #### marginGetOrder Query Margin Account's Order ```js console.log(await client.marginGetOrder({ symbol: 'BNBBTC', orderId: '213205622', })); ``` | Param | Type | Required | Description | | -------------------- | ------ | -------- | ------------------------- | | symbol | String | true | asset,such as BTC | | isIsolated | String | false | for isolated margin or not, `TRUE`, `FALSE`, default `FALSE` | orderId | String | false | | origClientOrderId | String | false | | recvWindow | Number | false | The value cannot be greater than `60000` <details> <summary>Output</summary> ```js { "clientOrderId": "ZwfQzuDIGpceVhKW5DvCmO", "cummulativeQuoteQty": "0.00000000", "executedQty": "0.00000000", "icebergQty": "0.00000000", "isWorking": true, "orderId": 213205622, "origQty": "0.30000000", "price": "0.00493630", "side": "SELL", "status": "NEW", "stopPrice": "0.00000000", "symbol": "BNBBTC", "isIsolated": true, "time": 1562133008725, "timeInForce": "GTC", "type": "LIMIT", "updateTime": 1562133008725 } ``` </details> #### marginGetOrderOco Retrieves a specific Margin OCO based on provided optional parameters ```js console.log( await client.getMarginOrderOco({ orderListId: 27, }), ) ``` | Param | Type | Required | Description | | ----------------- | ------ | -------- | ------------------------------------------- | | orderListId | Number | true | Not required if `listClientOrderId` is used | | symbol | Boolean| false | mandatory for isolated margin, not supported for cross margin | isIsolated | Boolean| false | | listClientOrderId | String | false | | recvWindow | Number | false | <details> <summary>Output</summary> ```js { orderListId: 27, contingencyType: 'OCO', listStatusType: 'EXEC_STARTED', listOrderStatus: 'EXECUTING', listClientOrderId: 'h2USkA5YQpaXHPIrkd96xE', transactionTime: 1565245656253, symbol: 'LTCBTC', isIsolated: false, orders: [ { symbol: 'LTCBTC', orderId: 4, clientOrderId: 'qD1gy3kc3Gx0rihm9Y3xwS' }, { symbol: 'LTCBTC', orderId: 5, clientOrderId: 'ARzZ9I00CPM8i3NhmU9Ega' } ] } ``` </details> ### Portfolio Margin Endpoints Only Portfolio Margin Account is accessible to these endpoints. #### getPortfolioMarginAccountInfo Get a Portfolio Margin Account Info. ```js console.log(await client.getPortfolioMarginAccountInfo()) ``` <details> <summary>Output</summary> ```js { "uniMMR": "1.87987800", // Portfolio margin account maintenance margin rate "accountEquity": "122607.35137903", // Account equity, unit:USD "accountMaintMargin": "23.72469206", // Portfolio margin account maintenance margin, unit:USD "accountStatus": "NORMAL" // Portfolio margin account status:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED" } ``` </details> ### Futures Authenticated REST endpoints #### futuresOrder - Creates a futures order - see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api ```js console.log( await client.futuresOrder({ symbol: 'LTCUSDT', side: 'BUY', type: 'LIMIT', quantity: 1, price: 80, timeInForce: 'GTC', }) ) ``` #### futuresUpdateOrder - Updates a futures order - see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order ```js console.log( await client.futuresUpdateOrder({ orderId: 23423423423, symbol: 'LTCUSDT', side: 'BUY', type: 'LIMIT', quantity: 1, price: 80, timeInForce: 'GTC', }) ) ``` #### futuresGetOrder Check an order's status. - These orders will not be found - order status is CANCELED or EXPIRED, <b>AND</b> - order has NO filled trade, <b>AND</b> - created time + 7 days < current time | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ---------------- | | symbol | STRING | YES | The pair name | | orderId | LONG | NO | | | origClientOrderId | STRING | NO | | | recvWindow | LONG | NO | | Either <b>orderId</b> or <b>origClientOrderId</b> must be sent. ```js console.log( await client.futuresGetOrder({ symbol: 'BNBETH', orderId: 50167927, }) ) ``` <details> <summary>Output</summary> ```js { "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false // if conditional order trigger is protected } ``` </details> #### futuresAllOrders Get all account orders; active, canceled, or filled. - These orders will not be found - order status is CANCELED or EXPIRED, <b>AND</b> - order has NO filled trade, <b>AND</b> - created time + 7 days < current time | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ---------------------- | | symbol | STRING | YES | The pair name | | orderId | LONG | NO | | | startTime | LONG | NO | | | endTime | LONG | NO | | | limit | INT | NO | Default 500; max 1000. | | recvWindow | LONG | NO | | If <b>orderId</b> is set, it will get orders >= that <b>orderId</b>. Otherwise most recent orders are returned. ```js console.log( await client.futuresAllOrders({ symbol: 'BNBETH', orderId: 50167927, startTime: 1579276756075, limit: 700, }) ) ``` <details> <summary>Output</summary> ```js [ { "avgPrice": "0.00000", "clientOrderId": "abc", "cumQuote": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSDT", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false // if conditional order trigger is protected } ] ``` </details> #### futuresBatchOrders Place multiple orders | Name | Type | Mandatory | Description | |-----------------------|--------|-----------|-------------------------------------------------------------------------------------------| | batchOrders | LIST | YES | order list. Max 5 orders | #### futuresCancelBatchOrders Cancel multiple orders | Name | Type | Mandatory | Description | |-----------------------|--------|-----------|-------------------------------------------------------------------------------------------| | symbol | STRING | YES | The pair name | | orderIdList | STRING | NO | max length 10<br/>e.g. `'[1234567,2345678]'` | | origClientOrderIdList | STRING | NO | max length 10<br/> e.g. `'["my_id_1","my_id_2"]'`, encode the double quotes. No space after comma. | #### futuresLeverage Change user's initial leverage of specific symbol market. | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ------------------------------------------ | | symbol | STRING | YES | The pair name | | leverage | INT | YES | target initial leverage: int from 1 to 125 | | recvWindow | LONG | NO | | ```js console.log( await client.futuresLeverage({ symbol: 'BTCUSDT', leverage: 21, }) ) ``` <details> <summary>Output</summary> ```js { "leverage": 21, "maxNotionalValue": "1000000", "symbol": "BTCUSDT" } ``` </details> #### futuresMarginType Change margin type. | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ----------------- | | symbol | STRING | YES | The pair name | | marginType | ENUM | YES | ISOLATED, CROSSED | | recvWindow | LONG | NO | | ```js console.log( await client.futuresMarginType({ symbol: 'BTCUSDT', marginType: 'ISOLATED', }) ) ``` <details> <summary>Output</summary> ```js { "code": 200, "msg": "success" } ``` </details> #### futuresPositionMargin Modify isolated position margin. | Name | Type | Mandatory | Description | | ----------------- | ------- | -------- | ------------------------------------------------- | | symbol | STRING | YES | The pair name | | positionSide | ENUM | NO | Default BOTH for One-way Mode; <br>LONG or SHORT for Hedge Mode. <br>It must be sent with Hedge Mode. | | amount | DECIMAL | YES | | | type | INT | YES | 1: Add position margin,2: Reduce position margin | | recvWindow | LONG | NO | | Only for isolated symbol. ```js console.log( await client.futuresPositionMargin({ symbol: 'BTCUSDT', amount: 100, type: 1, }) ) ``` <details> <summary>Output</summary> ```js { "amount": 100.0, "code": 200, "msg": "Successfully modify position margin.", "type": 1 } ``` </details> #### futuresMarginHistory Get position margin change history. | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ------------------------------------------------- | | symbol | STRING | YES | The pair name | | type | INT | NO | 1: Add position margin,2: Reduce position margin | | startTime | LONG | NO | | | endTime | LONG | NO | | | limit | INT | NO | Default 500; | | recvWindow | LONG | NO | | ```js console.log( await client.futuresMarginHistory({ symbol: 'BTCUSDT', type: 1, startTime: 1579276756075, limit: 700, }) ) ``` <details> <summary>Output</summary> ```js [ { "amount": "23.36332311", "asset": "USDT", "symbol": "BTCUSDT", "time": 1578047897183, "type": 1, "positionSide": "BOTH" }, { "amount": "100", "asset": "USDT", "symbol": "BTCUSDT", "time": 1578047900425, "type": 1, "positionSide": "LONG" } ] ``` </details> #### futuresIncome Get income history. | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ------------------------------------------------- | | symbol | STRING | NO | The pair name | | incomeType | STRING | NO | "TRANSFER","WELCOME_BONUS", "REALIZED_PNL",<br>"FUNDING_FEE", "COMMISSION", and "INSURANCE_CLEAR" | | startTime | LONG | NO | Timestamp in ms to get funding from INCLUSIVE. | | endTime | LONG | NO | Timestamp in ms to get funding until INCLUSIVE. | | limit | INT | NO | Default 100; max 1000 | | recvWindow | LONG | NO | | - If incomeType is not sent, all kinds of flow will be returned - "trandId" is unique in the same incomeType for a user ```js console.log( await client.futuresIncome({ symbol: 'BTCUSDT', startTime: 1579276756075, limit: 700, }) ) ``` <details> <summary>Output</summary> ```js [ { "symbol": "", // trade symbol, if existing "incomeType": "TRANSFER", // income type "income": "-0.37500000", // income amount "asset": "USDT", // income asset "info":"TRANSFER", // extra information "time": 1570608000000, "tranId":"9689322392", // transaction id "tradeId":"" // trade id, if existing }, { "symbol": "BTCUSDT", "incomeType": "COMMISSION", "income": "-0.01000000", "asset": "USDT", "info":"COMMISSION", "time": 1570636800000, "tranId":"9689322392", "tradeId":"2059192" } ] ``` </details> #### futuresAccountBalance Get futures account balance ```js console.log(await client.futuresAccountBalance()); ``` <details> <summary>Output</summary> ```js [ { "accountAlias": "SgsR", // unique account code "asset": "USDT", // asset name "balance": "122607.35137903", // wallet balance "crossWalletBalance": "23.72469206", // crossed wallet balance "crossUnPnl": "0.00000000" // unrealized profit of crossed positions "availableBalance": "23.72469206", // available balance "maxWithdrawAmount": "23.72469206" // maximum amount for transfer out } ] ``` </details> #### futuresUserTrades Get trades for a specific account and symbol. ```js console.log( await client.futuresUserTrades({ symbol: 'ETHBTC', }), ) ``` | Param | Type | Mandatory | Description | | ---------- | ------ | --------- | -------------------------------------------------------- | | symbol | STRING | YES | | | startTime | LONG | NO | | | endTime | LONG | NO | | | limit | INT | NO | Default 500; max 1000. | | fromId | LONG | NO | Trade id to fetch from. Default gets most recent trades. | | recvWindow | LONG | NO | | <details> <summary>Output</summary> ```js [ { "buyer": false, "commission": "-0.07819010", "commissionAsset": "USDT", "id": 698759, "maker": false, "orderId": 25851813, "price": "7819.01", "qty": "0.002", "quoteQty": "15.63802", "realizedPnl": "-0.91539999", "side": "SELL", "positionSide": "SHORT", "symbol": "BTCUSDT", "time": 1569514978020 } ] ``` </details> #### futuresLeverageBracket Get notional and leverage brackets. ```js console.log( await client.futuresLeverageBracket({ symbol: 'ETHBTC', // Optional }), ) ``` | Param | Type | Mandatory | Description | | ---------- | ------ | --------- | ----------------------------------------------------------| | symbol | STRING | NO | Use if you are only interested in brackets for one symbol | | recvWindow | LONG | NO | | <details> <summary>Output</summary> ```js [ { "symbol": "ETHUSDT", "brackets": [ { "bracket": 1, // Notional bracket "initialLeverage": 75, // Max initial leverage for this bracket "notionalCap": 10000, // Cap notional of this bracket "notionalFloor": 0, // Notional threshold of this bracket "maintMarginRatio": 0.0065, // Maintenance ratio for this bracket "cum":0 // Auxiliary number for quick calculation }, ] } ] ``` </details> ### Delivery Authenticated REST endpoints #### deliveryGetOrder Check an order's status. - These orders will not be found - order status is CANCELED or EXPIRED, <b>AND</b> - order has NO filled trade, <b>AND</b> - created time + 7 days < current time | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ---------------- | | symbol | STRING | YES | | | orderId | LONG | NO | | | origClientOrderId | STRING | NO | | | recvWindow | LONG | NO | | Either <b>orderId</b> or <b>origClientOrderId</b> must be sent. ```js console.log( await client.deliveryGetOrder({ symbol: 'BTCUSD_200925', orderId: 1917641, }) ) ``` <details> <summary>Output</summary> ```js { "avgPrice": "0.0", "clientOrderId": "abc", "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSD_200925", "pair": "BTCUSD", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false // if conditional order trigger is protected } ``` </details> #### deliveryAllOrders Get all account orders; active, canceled, or filled. - These orders will not be found - order status is CANCELED or EXPIRED, <b>AND</b> - order has NO filled trade, <b>AND</b> - created time + 7 days < current time | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ---------------------- | | symbol | STRING | YES | The pair name | | orderId | LONG | NO | | | startTime | LONG | NO | | | endTime | LONG | NO | | | limit | INT | NO | Default 500; max 1000. | | recvWindow | LONG | NO | | If <b>orderId</b> is set, it will get orders >= that <b>orderId</b>. Otherwise most recent orders are returned. ```js console.log( await client.deliveryAllOrders({ symbol: 'BTCUSD_200925' }) ) ``` <details> <summary>Output</summary> ```js [ { "avgPrice": "0.0", "clientOrderId": "abc", "cumBase": "0", "executedQty": "0", "orderId": 1917641, "origQty": "0.40", "origType": "TRAILING_STOP_MARKET", "price": "0", "reduceOnly": false, "side": "BUY", "positionSide": "SHORT", "status": "NEW", "stopPrice": "9300", // please ignore when order type is TRAILING_STOP_MARKET "closePosition": false, // if Close-All "symbol": "BTCUSD_200925", "pair": "BTCUSD", "time": 1579276756075, // order time "timeInForce": "GTC", "type": "TRAILING_STOP_MARKET", "activatePrice": "9020", // activation price, only return with TRAILING_STOP_MARKET order "priceRate": "0.3", // callback rate, only return with TRAILING_STOP_MARKET order "updateTime": 1579276756075, // update time "workingType": "CONTRACT_PRICE", "priceProtect": false // if conditional order trigger is protected } ... ] ``` </details> #### deliveryBatchOrders Place multiple orders | Name | Type | Mandatory | Description | |-----------------------|--------|-----------|-------------------------------------------------------------------------------------------| | batchOrders | LIST | YES | order list. Max 5 orders | #### deliveryCancelBatchOrders Cancel multiple orders | Name | Type | Mandatory | Description | |-----------------------|--------|-----------|-------------------------------------------------------------------------------------------| | symbol | STRING | YES | The pair name | | orderIdList | STRING | NO | max length 10<br/>e.g. `'[1234567,2345678]'` | | origClientOrderIdList | STRING | NO | max length 10<br/> e.g. `'["my_id_1","my_id_2"]'`, encode the double quotes. No space after comma. | #### deliveryLeverage Change user's initial leverage of specific symbol market. | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ------------------------------------------ | | symbol | STRING | YES | The pair name | | leverage | INT | YES | target initial leverage: int from 1 to 125 | | recvWindow | LONG | NO | | ```js console.log( await client.deliveryLeverage({ symbol: 'BTCUSD_200925', leverage: 21, }) ) ``` <details> <summary>Output</summary> ```js { "leverage": 21, "maxQty": "1000", // maximum quantity of base asset "symbol": "BTCUSD_200925" } ``` </details> #### deliveryMarginType Change margin type. | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ----------------- | | symbol | STRING | YES | The pair name | | marginType | ENUM | YES | ISOLATED, CROSSED | | recvWindow | LONG | NO | | ```js console.log( await client.futuresMarginType({ symbol: 'BTCUSD_200925', marginType: 'ISOLATED', }) ) ``` <details> <summary>Output</summary> ```js { "code": 200, "msg": "success" } ``` </details> #### deliveryPositionMargin Modify isolated position margin. | Name | Type | Mandatory | Description | | ----------------- | ------- | -------- | ------------------------------------------------- | | symbol | STRING | YES | The pair name | | positionSide | ENUM | NO | Default BOTH for One-way Mode; <br>LONG or SHORT for Hedge Mode. <br>It must be sent with Hedge Mode. | | amount | DECIMAL | YES | | | type | INT | YES | 1: Add position margin,2: Reduce position margin | | recvWindow | LONG | NO | | Only for isolated symbol. ```js console.log( await client.deliveryPositionMargin({ symbol: 'BTCUSD_200925', amount: 100, type: 1, }) ) ``` <details> <summary>Output</summary> ```js { "amount": 100.0, "code": 200, "msg": "Successfully modify position margin.", "type": 1 } ``` </details> #### deliveryMarginHistory Get position margin change history. | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ------------------------------------------------- | | symbol | STRING | YES | The pair name | | type | INT | NO | 1: Add position margin,2: Reduce position margin | | startTime | LONG | NO | | | endTime | LONG | NO | | | limit | INT | NO | Default 50; | | recvWindow | LONG | NO | | ```js console.log( await client.deliveryMarginHistory({ symbol: 'BTCUSD_200925', type: 1, startTime: 1578047897180, limit: 10, }) ) ``` <details> <summary>Output</summary> ```js [ { "amount": "23.36332311", "asset": "BTC", "symbol": "BTCUSD_200925", "time": 1578047897183, "type": 1, "positionSide": "BOTH" }, { "amount": "100", "asset": "BTC", "symbol": "BTCUSD_200925", "time": 1578047900425, "type": 1, "positionSide": "LONG" } ... ] ``` </details> #### deliveryIncome Get income history. | Name | Type | Mandatory | Description | | ----------------- | ------ | -------- | ------------------------------------------------- | | symbol | STRING | NO | The pair name | | incomeType | STRING | NO | "TRANSFER","WELCOME_BONUS", "REALIZED_PNL",<br>"FUNDING_FEE", "COMMISSION", and "INSURANCE_CLEAR" | | startTime | LONG | NO | Timestamp in ms to get funding from INCLUSIVE. | | endTime | LONG | NO | Timestamp in ms to get funding until INCLUSIVE. | | limit | INT | NO | Default 100; max 1000 | | recvWindow | LONG | NO | | - If `incomeType` is not sent, all kinds of flow will be returned - `trandId` is unique in the same incomeType for a user - The interval between `startTime` and `endTime` can not exceed 200 days: - If `startTime` and `endTime` are not sent, the last 200 days will be returned ```js console.log( await client.deliveryIncome({ symbol: 'BTCUSD_200925', startTime: 1570608000000, limit: 700, }) ) ``` <details> <summary>Output</summary> ```js [ { "symbol": "", // trade symbol, if existing "incomeType": "TRANSFER", // income type "income": "-0.37500000", // income amount "asset": "BTC", // income asset "info":"WITHDRAW", // extra information "time": 1570608000000, "tranId":"9689322392", // transaction id "tradeId":"" // trade id, if existing }, { "symbol": "BTCUSD_200925", "incomeType": "COMMISSION", "income": "-0.01000000", "asset": "BTC", "info":"", "time": 1570636800000, "tranId":"9689322392", "tradeId":"2059192" } ] ``` </details> #### deliveryAccountBalance Get delivery account balance ```js console.log(await client.deliveryAccountBalance()); ``` <details> <summary>Output</summary> ```js [ { "accountAlias": "SgsR", // unique account code "asset": "BTC", "balance": "0.00250000", "withdrawAvailable": "0.00250000", "crossWalletBalance": "0.00241969", "crossUnPnl": "0.00000000", "availableBalance": "0.00241969", "updateTime": 1592468353979 } ... ] ``` </details> #### deliveryUserTrades Get trades for a specific account and symbol. ```js console.log( await client.deliveryUserTrades({ symbol: 'BTCUSD_200626', }), ) ``` | Param | Type | Mandatory | Description | | ---------- | ------ | --------- | -------------------------------------------------------- | | symbol | STRING | NO | | | pair | STRING | NO | | | startTime | LONG | NO | | | endTime | LONG | NO | | | limit | INT | NO | Default 50; max 1000. | | fromId | LONG | NO | Trade id to fetch from. Default gets most recent trades. | | recvWindow | LONG | NO | | - Either symbol or pair must be sent - Symbol and pair cannot be sent together - Pair and fromId cannot be sent together - If a pair is sent,tickers for all symbols of the pair will be returned - The parameter `fromId` cannot be sent with `startTime` or `endTime` <details> <summary>Output</summary> ```js [ { 'symbol': 'BTCUSD_200626', 'id': 6, 'orderId': 28, 'pair': 'BTCUSD', 'side': 'SELL', 'price': '8800', 'qty': '1', 'realizedPnl': '0', 'marginAsset': 'BTC', 'baseQty': '0.01136364', 'commission': '0.00000454', 'commissionAsset': 'BTC', 'time': 1590743483586, 'positionSide': 'BOTH', 'buyer': false, 'maker': false } ... ] ``` </details> #### deliveryLeverageBracket Get the pair's default notional bracket list. ```js console.log( await client.deliveryLeverageBracket({ pair: 'BTCUSD', // Optional }), ) ``` | Param | Type | Mandatory | Description | | ---------- | ------ | --------- | ----------------------------------------------------------| | symbol | STRING | NO | Use if you are only interested in brackets for one symbol | | recvWindow | LONG | NO | | <details> <summary>Output</summary> ```js [ { "pair": "BTCUSD", "brackets": [ { "bracket": 1, // bracket level "initialLeverage": 125, // the maximum leverage "qtyCap": 50, // upper edge of base asset quantity "qtylFloor": 0, // lower edge of base asset quantity "maintMarginRatio": 0.004 // maintenance margin rate "cum": 0.0 // Auxiliary number for quick calculation }, ] } ] ``` </details> ### WebSockets Every websocket utility returns a function you can call to close the opened connection and avoid memory issues. ```js const clean = client.ws.depth('ETHBTC', depth => { console.log(depth) }) // After you're done clean() ``` #### depth Live depth market data feed. The first parameter can either be a single symbol string or an array of symbols. If you wish to specify the update speed (can either be `1000ms` or `100ms`) of the stream then append the speed at the end of the symbol string as follows: `ETHBTC@100ms` ```js client.ws.depth('ETHBTC', depth => { console.log(depth) }) ``` <details> <summary>Output</summary> ```js { eventType: 'depthUpdate', eventTime: 1508612956950, symbol: 'ETHBTC', firstUpdateId: 18331140, finalUpdateId: 18331145, bidDepth: [ { price: '0.04896500', quantity: '0.00000000' }, { price: '0.04891100', quantity: '15.00000000' }, { price: '0.04891000', quantity: '0.00000000' } ], askDepth: [ { price: '0.04910600', quantity: '0.00000000' }, { price: '0.04910700', quantity: '11.24900000' } ] } ``` </details> #### customSubStream You can add custom sub streams by view [docs](#https://binance-docs.github.io/apidocs/futures/cn/#websocket) ```js client.ws.customSubStream('!markPrice@arr@1s', console.log) ``` #### partialDepth Top levels bids and asks, pushed every second. Valid levels are 5, 10, or 20. Accepts an array of objects for multiple depths. If you wish to specify the update speed (can either be `1000ms` or `100ms`) of the stream then append the speed at the end of the symbol string as follows: `ETHBTC@100ms` ```js client.ws.partialDepth({ symbol: 'ETHBTC', level: 10 }, depth => { console.log(depth) }) ``` <details> <summary>Output</summary> ```js { symbol: 'ETHBTC', level: 10, bids: [ { price: '0.04896500', quantity: '0.00000000' }, { price: '0.04891100', quantity: '15.00000000' }, { price: '0.04891000', quantity: '0.00000000' } ], asks: [ { price: '0.04910600', quantity: '0.00000000' }, { price: '0.04910700', quantity: '11.24900000' } ] } ``` </details> #### ticker 24hr Ticker statistics for a symbol pushed every second. Accepts an array of symbols. ```js client.ws.ticker('HSRETH', ticker => { console.log(ticker) }) ``` <details> <summary>Output</summary> ```js { eventType: '24hrTicker', eventTime: 1514670820924, symbol: 'HSRETH', priceChange: '-0.00409700', priceChangePercent: '-11.307', weightedAvg: '0.03394946', prevDayClose: '0.03623500', curDayClose: '0.03213800', closeTradeQuantity: '7.02000000', bestBid: '0.03204200', bestBidQnt: '78.00000000', bestAsk: '0.03239800', bestAskQnt: '7.00000000', open: '0.03623500', high: '0.03659900', low: '0.03126000', volume: '100605.15000000', volumeQuote: '3415.49097353', openTime: 1514584420922, closeTime: 1514670820922, firstTradeId: 344803, lastTradeId: 351380, totalTrades: 6578 } ``` </details> #### allTickers Retrieves all the tickers. ```js client.ws.allTickers(tickers => { console.log(tickers) }) ``` #### miniTicker 24hr Mini Ticker statistics for a symbol pushed every second. Accepts an array of symbols. ```js client.ws.miniTicker('HSRETH', ticker => { console.log(ticker) }) ``` <details> <summary>Output</summary> ```js { eventType: '24hrMiniTicker', eventTime: 1514670820924, symbol: 'HSRETH', curDayClose: '0.03213800', open: '0.03623500', high: '0.03659900', low: '0.03126000', volume: '100605.15000000', volumeQuote: '3415.49097353' } ``` </details> #### allMiniTickers Retrieves all the mini tickers. ```js client.ws.allMiniTickers(tickers => { console.log(tickers) }) ``` #### bookTicker Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. Accepts a single symbol or an array of symbols. ```js client.ws.bookTicker('BTCUSDT', ticker => { console.log(ticker) }) ``` <details> <summary>Output</summary> ```js { updateId: 23099391508, symbol: 'BTCUSDT', bestBid: '21620.03000000', bestBidQnt: '0.09918000', bestAsk: '21621.65000000', bestAskQnt: '0.06919000' } ``` </details> #### candles Live candle data feed for a given interval. You can pass either a symbol string or a symbol array. ```js client.ws.candles('ETHBTC', '1m', candle => { console.log(candle) }) ``` <details> <summary>Output</summary> ```js { eventType: 'kline', eventTime: 1508613366276, symbol: 'ETHBTC', open: '0.04898000', high: '0.04902700', low: '0.04898000', close: '0.04901900', volume: '37.89600000', trades: 30, interval: '5m', isFinal: false, quoteVolume: '1.85728874', buyVolume: '21.79900000', quoteBuyVolume: '1.06838790' } ``` </details> #### trades Live trade data feed. Pass either a single symbol string or an array of symbols. The trade streams push raw trade information; each trade has a unique buyer and seller. ```js client.ws.trades(['ETHBTC', 'BNBBTC'], trade => { console.log(trade) }) ``` <details> <summary>Output</summary> ```js { eventType: 'trade', eventTime: 1508614495052, tradeTime: 1508614495050, symbol: 'ETHBTC', price: '0.04923600', quantity: '3.43500000', isBuyerMaker: true, maker: true, tradeId: 2148226, buyerOrderId: 390876, sellerOrderId: 390752 } ``` </details> #### aggTrades Live trade data feed. Pass either a single symbol string or an array of symbols. The aggregate trade streams push trade information that is aggregated for a single taker order. ```js client.ws.aggTrades(['ETHBTC', 'BNBBTC'], trade => { console.log(trade) }) ``` <details> <summary>Output</summary> ```js { eventType: 'aggTrade', eventTime: 1508614495052, aggId: 2148226, price: '0.04923600', quantity: '3.43500000', firstId: 37856, lastId: 37904, timestamp: 1508614495050, symbol: 'ETHBTC', isBuyerMaker: false, wasBestPrice: true } ``` </details> #### user Live user messages data feed. **Requires authentication** ```js const clean = await client.ws.user(msg => { console.log(msg) }) ``` There is also equivalent function to query the margin wallet: ```js client.ws.marginUser() ``` Note that this method return a promise which will resolve the `clean` callback. <details> <summary>Output</summary> ```js { eventType: 'account', eventTime: 1508614885818, balances: { '123': { available: '0.00000000', locked: '0.00000000' }, '456': { available: '0.00000000', locked: '0.00000000' }, BTC: { available: '0.00000000', locked: '0.00000000' }, } } ``` </details> ### Futures WebSockets Every websocket utility returns a function you can call to close the opened connection and avoid memory issues. ```js const clean = client.ws.futuresDepth('ETHBTC', depth => { console.log(depth) }) // After you're done clean() ``` Each websocket utility supports the ability to get a clean callback without data transformation, for this, pass the third attribute FALSE. ```js const clean = client.ws.futuresDepth('ETHBTC', depth => { console.log(depth) }, false) ``` <details> <summary>Output</summary> ```js { "e": "depthUpdate", // Event type "E": 123456789, // Event time "T": 123456788, // transaction time "s": "BTCUSDT", // Symbol "U": 157, // First update ID in event "u": 160, // Final update ID in event "pu": 149, // Final update Id in last stream(ie `u` in last stream) "b": [ // Bids to be updated [ "0.0024", // Price level to be updated "10" // Quantity ] ], "a": [ // Asks to be updated [ "0.0026", // Price level to be updated "100" // Quantity ] ] } ``` </details> #### futuresDepth Live futuresDepth market data feed. The first parameter can either be a single symbol string or an array of symbols. ```js client.ws.futuresDepth('ETHBTC', depth => { console.log(depth) }) ``` <details> <summary>Output</summary> ```js { eventType: 'depthUpdate', eventTime: 1508612956950, symbol: 'ETHBTC', firstUpdateId: 18331140, finalUpdateId: 18331145, bidDepth: [ { price: '0.04896500', quantity: '0.00000000' }, { price: '0.04891100', quantity: '15.00000000' }, { price: '0.04891000', quantity: '0.00000000' } ], askDepth: [ { price: '0.04910600', quantity: '0.00000000' }, { price: '0.04910700', quantity: '11.24900000' } ] } ``` </details> #### futuresPartialDepth Top levels bids and asks, pushed every second. Valid levels are 5, 10, or 20. Accepts an array of objects for multiple depths. ```js client.ws.futuresPartialDepth({ symbol: 'ETHBTC', level: 10 }, depth => { console.log(depth) }) ``` <details> <summary>Output</summary> ```js { eventType: 'depthUpdate', eventTime: 1508612956950, symbol: 'ETHBTC', level: 10, firstUpdateId: 18331140, finalUpdateId: 18331145, bidDepth: [ { price: '0.04896500', quantity: '0.00000000' }, { price: '0.04891100', quantity: '15.00000000' }, { price: '0.04891000', quantity: '0.00000000' } ], askDepth: [ { price: '0.04910600', quantity: '0.00000000' }, { price: '0.04910700', quantity: '11.24900000' } ] } ``` </details> #### futuresTicker 24hr Ticker statistics for a symbol pushed every 500ms. Accepts an array of symbols. ```js client.ws.futuresTicker('HSRETH', ticker => { console.log(ticker) }) ``` <details> <summary>Output</summary> ```js { eventType: '24hrTicker', eventTime: 123456789, symbol: 'BTCUSDT', priceChange: '0.0015', priceChangePercent: '250.00', weightedAvg: '0.0018', curDayClose: '0.0025', closeTradeQuantity: '10', open: '0.0010', high: '0.0025', low: '0.0010', volume: '10000', volumeQuote: '18', openTime: 0, closeTime: 86400000, firstTradeId: 0, lastTradeId: 18150, totalTrades: 18151, } ``` </details> #### futuresAllTickers Retrieves all the tickers. ```js client.ws.futuresAllTickers(tickers => { console.log(tickers) }) ``` #### futuresCandles Live candle data feed for a given interval. You can pass either a symbol string or a symbol array. ```js client.ws.futuresCandles('ETHBTC', '1m', candle => { console.log(candle) }) ``` <details> <summary>Output</summary> ```js { eventType: 'kline', eventTime: 1508613366276, symbol: 'ETHBTC', open: '0.04898000', high: '0.04902700', low: '0.04898000', close: '0.04901900', volume: '37.89600000', trades: 30, interval: '5m', isFinal: false, quoteVolume: '1.85728874', buyVolume: '21.79900000', quoteBuyVolume: '1.06838790' } ``` </details> #### futuresAggTrades Live trade data feed. Pass either a single symbol string or an array of symbols. The Aggregate Trade Streams push trade information that is aggregated for a single taker order every 100 milliseconds. ```js client.ws.futuresAggTrades(['ETHBTC', 'BNBBTC'], trade => { console.log(trade) }) ``` <details> <summary>Output</summary> ```js { eventType: 'aggTrade', eventTime: 1508614495052, aggId: 2148226, price: '0.04923600', quantity: '3.43500000', firstId: 37856, lastId: 37904, timestamp: 1508614495050, symbol: 'ETHBTC', isBuyerMaker: false, } ``` </details> #### futuresLiquidations Live liquidation data feed. Pass either a single symbol string or an array of symbols. The Liquidation Order Streams push force liquidation order information for specific symbol(s). ```js client.ws.futuresLiquidations(['ETHBTC', 'BNBBTC'], liquidation => { console.log(liquidation) }) ``` <details> <summary>Output</summary> ```js { symbol: string price: '0.04923600', origQty: '3.43500000', lastFilledQty: '3.43500000', accumulatedQty: '3.43500000', averagePrice: '0.04923600', status: 'FILLED', timeInForce: 'IOC', type: 'LIMIT', side: 'SELL', time: 1508614495050 } ``` </details> #### futuresAllLiquidations Live liquidation data feed. Pass either a single symbol string or an array of symbols. The All Liquidation Order Streams push force liquidation order information for all symbols in the market. ```js client.ws.futuresAllLiquidations(liquidation => { console.log(liquidation) }) ``` <details> <summary>Output</summary> ```js { symbol: string price: '0.04923600', origQty: '3.43500000', lastFilledQty: '3.43500000', accumulatedQty: '3.43500000', averagePrice: '0.04923600', status: 'FILLED', timeInForce: 'IOC', type: 'LIMIT', side: 'SELL', time: 1508614495050 } ``` </details> #### futuresCustomSubStream You can add custom sub streams by view [docs](#https://binance-docs.github.io/apidocs/futures/cn/#websocket) ```js client.ws.futuresCustomSubStream(['!markPrice@arr','ETHBTC@markPrice@1s'], console.log) ``` #### futuresUser Live user messages data feed. **Requires authentication** ```js const futuresUser = await client.ws.futuresUser(msg => { console.log(msg) }) ``` <details> <summary>Output</summary> ```js { eventTime: 1564745798939, transactionTime: 1564745798938, eventType: 'ACCOUNT_UPDATE', eventReasonType: 'ORDER', balances: [ { asset:'USDT', walletBalance:'122624.12345678', crossWalletBalance:'100.12345678' }, { asset:'BNB', walletBalance:'1.00000000', crossWalletBalance:'0.00000000' } ], positions: [ { symbol:'BTCUSDT', positionAmount:'0', entryPrice:'0.00000', accumulatedRealized:'200', unrealizedPnL:'0', marginType:'isolated', isolatedWallet:'0.00000000', positionSide:'BOTH' }, { symbol:'BTCUSDT', positionAmount:'20', entryPrice:'6563.66500', accumulatedRealized:'0', unrealizedPnL:'2850.21200', marginType:'isolated', isolatedWallet:'13200.70726908', positionSide:'LONG' } ], } ``` </details> ### Delivery WebSockets Every websocket utility returns a function you can call to close the opened connection and avoid memory issues. ```js const clean = client.ws.deliveryDepth('BTCUSD_200626', depth => { console.log(depth) }) // After you're done clean() ``` Each websocket utility supports the ability to get a clean callback without data transformation, for this, pass the third attribute FALSE. ```js const clean = client.ws.deliveryDepth('BTCUSD_200626', depth => { console.log(depth) }, false) ``` <details> <summary>Output</summary> ```js { "e": "depthUpdate", // Event type "E": 1591270260907, // Event time "T": 1591270260891, // Transction time "s": "BTCUSD_200626", // Symbol "ps": "BTCUSD", // Pair "U": 17285681, // First update ID in event "u": 17285702, // Final update ID in event "pu": 17285675, // Final update Id in last stream(ie `u` in last stream) "b": [ // Bids to be updated [ "9517.6", // Price level to be updated "10" // Quantity ] ], "a": [ // Asks to be updated [ "9518.5", // Price level to be updated "45" // Quantity ] ] } ``` </details> #### deliveryDepth Live futuresDepth market data feed. The first parameter can either be a single symbol string or an array of symbols. ```js client.ws.deliveryDepth('TRXUSD_PERP', depth => { console.log(depth) }) ``` <details> <summary>Output</summary> ```js { eventType: 'depthUpdate', eventTime: 1663111254317, transactionTime: 1663111254138, symbol: 'TRXUSD_PERP', pair: 'TRXUSD', firstUpdateId: 558024151999, finalUpdateId: 558024152633, prevFinalUpdateId: 558024150524, bidDepth: [ { price: '0.06052', quantity: '1805' }, { price: '0.06061', quantity: '313' } ], askDepth: [ { price: '0.06062', quantity: '314' }, { price: '0.06063', quantity: '790' }, { price: '0.06065', quantity: '1665' }, { price: '0.06066', quantity: '2420' } ] } ``` </details> #### deliveryPartialDepth Top bids and asks. Valid levels are 5, 10, or 20. Update Speed : 250ms, 500ms or 100ms. Accepts an array of objects for multiple depths. ```js client.ws.deliveryPartialDepth({ symbol: 'TRXUSD_PERP', level: 10 }, depth => { console.log(depth) }) ``` <details> <summary>Output</summary> ```js { level: 10, eventType: 'depthUpdate', eventTime: 1663111554598, transactionTime: 1663111554498, symbol: 'TRXUSD_PERP', pair: 'TRXUSD', firstUpdateId: 558027933795, finalUpdateId: 558027935097, prevFinalUpdateId: 558027932895, bidDepth: [ { price: '0.06063', quantity: '604' }, { price: '0.06062', quantity: '227' }, { price: '0.06061', quantity: '327' } ], askDepth: [ { price: '0.06064', quantity: '468' }, { price: '0.06065', quantity: '131' } ] } ``` </details> #### deliveryTicker 24hr rollwing window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Accepts an array of symbols. ```js client.ws.deliveryTicker('BNBUSD_PERP', ticker => { console.log(ticker) }) ``` <details> <summary>Output</summary> ```js { eventType: '24hrTicker', eventTime: 1664834148221, symbol: 'BNBUSD_PERP', pair: 'BNBUSD', priceChange: '0.130', priceChangePercent: '0.046', weightedAvg: '286.02648763', curDayClose: '285.745', closeTradeQuantity: '1', open: '285.615', high: '289.050', low: '282.910', volume: '9220364', volumeBase: '322360.49452795', openTime: 1664747700000, closeTime: 1664834148215, firstTradeId: 179381113, lastTradeId: 179462069, totalTrades: 80957 } ``` </details> #### deliveryAllTickers Retrieves all the tickers. ```js client.ws.deliveryAllTickers(tickers => { console.log(tickers) }) ``` #### deliveryCandles Live candle data feed for a given interval. You can pass either a symbol string or a symbol array. ```js client.ws.deliveryCandles('ETHUSD_PERP', '1m', candle => { console.log(candle) }) ``` <details> <summary>Output</summary> ```js { eventType: 'kline', eventTime: 1664834318306, symbol: 'ETHUSD_PERP', startTime: 1664834280000, closeTime: 1664834339999, firstTradeId: 545784425, lastTradeId: 545784494, open: '1317.68', high: '1317.91', low: '1317.68', close: '1317.91', volume: '6180', trades: 70, interval: '1m', isFinal: false, baseVolume: '46.89730466', buyVolume: '5822', baseBuyVolume: '44.18040830' } ``` </details> #### deliveryAggTrades Live trade data feed. Pass either a single symbol string or an array of symbols. The Aggregate Trade Streams push trade information that is aggregated for a single taker order every 100 milliseconds. ```js client.ws.deliveryAggTrades(['ETHUSD_PERP', 'BNBUSD_PERP'], trade => { console.log(trade) }) ``` <details> <summary>Output</summary> ```js { eventType: 'aggTrade', eventTime: 1664834403682, symbol: 'ETHUSD_PERP', aggId: 216344302, price: '1317.57', quantity: '1318', firstId: 545784591, lastId: 545784591, timestamp: 1664834403523, isBuyerMaker: false } ``` </details> #### deliveryCustomSubStream You can add custom sub streams by view [docs](https://binance-docs.github.io/apidocs/delivery/en/#websocket-market-streams) ```js client.ws.deliveryCustomSubStream(['!miniTicker@arr','ETHUSD_PERP@markPrice@1s'], console.log) ``` #### deliveryUser Live user messages data feed. For different event types, see [official documentation](https://binance-docs.github.io/apidocs/delivery/en/#user-data-streams) **Requires authentication** ```js const deliveryUser = await client.ws.deliveryUser(msg => { console.log(msg) }) ``` <details> <summary>Output</summary> ```js { eventTime: 1664834883117, transactionTime: 1664834883101, eventType: 'ACCOUNT_UPDATE', eventReasonType: 'ORDER', balances: [ { asset: 'BUSD', walletBalance: '123.45678901', crossWalletBalance: '123.45678901', balanceChange: '0' }, { asset: 'BNB', walletBalance: '0.12345678', crossWalletBalance: '0.12345678', balanceChange: '0' } ], positions: [ { symbol: 'ETHBUSD', positionAmount: '420.024', entryPrice: '1234.56789', accumulatedRealized: '9000.12345678', unrealizedPnL: '0.38498800', marginType: 'cross', isolatedWallet: '0', positionSide: 'BOTH' } ] } ``` </details> #### Common #### getInfo To get information about limits from response headers call getInfo() ```js console.log(client.getInfo()) ``` <details> <summary>Output</summary> ```js { futures: { futuresLatency: "2ms", orderCount1m: "10", usedWeigh1m: "1", }, spot: { orderCount1d: "347", orderCount10s: "1", usedWeigh1m: "15", }, delivery: { usedWeight1m: '13', responseTime: '4ms', orderCount1m: '1' } } ``` </details> ### ErrorCodes An utility error code map is also being exported by the package in order for you to make readable conditionals upon specific errors that could occur while using the API. ```js import Binance, { ErrorCodes } from 'binance-api-node' console.log(ErrorCodes.INVALID_ORDER_TYPE) // -1116 ```

Crypto & Blockchain
709 Github Stars
php-binance-api
Open Source

php-binance-api

[![Latest Version](https://img.shields.io/github/release/jaggedsoft/php-binance-api.svg?style=flat-square)](https://github.com/jaggedsoft/php-binance-api/releases) [![GitHub last commit](https://img.shields.io/github/last-commit/jaggedsoft/php-binance-api.svg?style=flat-square)](#) [![Packagist Downloads](https://img.shields.io/packagist/dt/jaggedsoft/php-binance-api.svg?style=flat-square)](https://packagist.org/packages/jaggedsoft/php-binance-api) <!-- [![Build Status](https://travis-ci.org/jaggedsoft/php-binance-api.svg?branch=master&style=flat-square)](https://travis-ci.org/jaggedsoft/php-binance-api) [![Coverage Status](https://coveralls.io/repos/github/jaggedsoft/php-binance-api/badge.svg?branch=master&style=flat-square)](https://coveralls.io/github/jaggedsoft/php-binance-api) [![CodeCov](https://codecov.io/gh/jaggedsoft/php-binance-api/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/github/jaggedsoft/php-binance-api/) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/683459a5a71c4875956cf23078a0c39b)](https://www.codacy.com/app/dmzoneill/php-binance-api?utm_source=github.com&utm_medium=referral&utm_content=jaggedsoft/php-binance-api&utm_campaign=Badge_Coverage) [![Code consistency](https://squizlabs.github.io/PHP_CodeSniffer/analysis/jaggedsoft/php-binance-api/grade.svg?style=flat-square)](https://squizlabs.github.io/PHP_CodeSniffer/analysis/jaggedsoft/php-binance-api) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/683459a5a71c4875956cf23078a0c39b)](https://www.codacy.com/app/dmzoneill/php-binance-api?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=jaggedsoft/php-binance-api&amp;utm_campaign=Badge_Grade) --> # PHP Binance API This project is designed to help you make your own projects that interact with [Binance](https://accounts.binance.com/register?ref=PGDFCE46). You can stream candlestick chart data, market depth, or use other advanced features such as setting stop losses and iceberg orders. This project seeks to have complete API coverage (spot and futures) including WebSockets. #### Installation ``` composer require "jaggedsoft/php-binance-api @dev" ``` <details> <summary>Click for help with installation</summary> ## Install Composer If the above step didn't work, install composer and try again. #### Debian / Ubuntu ``` sudo apt-get install curl php-curl curl -s http://getcomposer.org/installer | php php composer.phar install ``` Composer not found? Use this command instead: ``` php composer.phar require "jaggedsoft/php-binance-api @dev" ``` #### Windows: [Download installer for Windows](https://github.com/jaggedsoft/php-binance-api/#installing-on-windows) </details> #### Getting started `composer require jaggedsoft/php-binance-api` ```php require 'vendor/autoload.php'; // 1. config in home directory $api = new Binance\API(); // 2. config in specified file $api = new Binance\API( "somefile.json" ); // 3. config by specifying api key and secret $api = new Binance\API("<api key>","<secret>"); // 4. config by specifying api key, api secret and testnet flag. By default the testnet is disabled $api = new Binance\API("<testnet api key>","<testnet secret>", true); // 5. Rate Limiting Support $api = new Binance\RateLimiter(new Binance\API()); ``` See [additional options](https://github.com/jaggedsoft/php-binance-api/#config-file-in-home-directory) for more options and help installing on Windows #### Rate Limiting This Feature is in beta, you can start using rate limiting as a wrapper to the main API class. ```php $api = new Binance\API( "somefile.json" ); $api = new Binance\RateLimiter($api); while(true) { $api->openOrders("BNBBTC"); // rate limited } ``` ======= #### Security - CA Bundles If you don't know what a CA bundle is, no action is required. If you do know and you don't like our auto upate feature. You can disable the downloading of the CA Bundle ```php $api = new Binance\API( "somefile.json" ); $api->caOverride = true; ``` #### Get latest price of all symbols ```php $ticker = $api->prices(); print_r($ticker); ``` <details> <summary>View Response</summary> ``` Array ( [ETHBTC] => 0.05050800 [LTCBTC] => 0.00967400 [BNBBTC] => 0.00021479 [NEOBTC] => 0.00479300 [123456] => 0.00030000 [QTUMETH] => 0.03482000 [EOSETH] => 0.00176100 [SNTETH] => 0.00008766 [BNTETH] => 0.00662400 [BCCBTC] => 0.05629200 [GASBTC] => 0.00338500 [BNBETH] => 0.00418603 [BTMETH] => 0.00018900 [HCCBTC] => 0.00000180 [BTCUSDT] => 6028.95000000 [ETHUSDT] => 304.98000000 [HSRBTC] => 0.00289000 [OAXETH] => 0.00136700 [DNTETH] => 0.00020573 [MCOETH] => 0.02685800 [ICNETH] => 0.00395000 [ELCBTC] => 0.00000053 [MCOBTC] => 0.00133000 [WTCBTC] => 0.00117000 [WTCETH] => 0.02300000 [LLTBTC] => 0.00001669 [LRCBTC] => 0.00001100 [LRCETH] => 0.00016311 [QTUMBTC] => 0.00178400 [YOYOBTC] => 0.00000481 [OMGBTC] => 0.00125600 [OMGETH] => 0.02497000 [ZRXBTC] => 0.00003376 [ZRXETH] => 0.00067001 [STRATBTC] => 0.00052100 [STRATETH] => 0.00950200 [SNGLSBTC] => 0.00002216 [SNGLSETH] => 0.00043508 [BQXBTC] => 0.00010944 [BQXETH] => 0.00241250 [KNCBTC] => 0.00017060 [KNCETH] => 0.00340090 [FUNBTC] => 0.00000313 [FUNETH] => 0.00006184 [SNMBTC] => 0.00001761 [SNMETH] => 0.00035599 [NEOETH] => 0.09500000 [IOTABTC] => 0.00006783 [IOTAETH] => 0.00136000 [LINKBTC] => 0.00004476 [LINKETH] => 0.00087796 [XVGBTC] => 0.00000081 [XVGETH] => 0.00001611 [CTRBTC] => 0.00009408 [CTRETH] => 0.00187010 [SALTBTC] => 0.00044400 [SALTETH] => 0.00890000 [MDABTC] => 0.00021973 [MDAETH] => 0.00435550 [MTLBTC] => 0.00116900 [MTLETH] => 0.02470000 [SUBBTC] => 0.00002163 [SUBETH] => 0.00042901 [EOSBTC] => 0.00008822 [SNTBTC] => 0.00000438 [ETC] => 0.00000000 [ETCETH] => 0.03600000 [ETCBTC] => 0.00180800 [MTHBTC] => 0.00001425 [MTHETH] => 0.00028092 [ENGBTC] => 0.00007040 [ENGETH] => 0.00138220 [DNTBTC] => 0.00001052 [ZECBTC] => 0.00000000 [ZECETH] => 0.00000000 [BNTBTC] => 0.00033501 [ASTBTC] => 0.00004528 [ASTETH] => 0.00083990 [DASHBTC] => 0.04651300 [DASHETH] => 0.90520000 ) Price of BNB: 0.00021479 BTC. ``` </details> #### Get latest price of a symbol ```php $price = $api->price("BNBBTC"); echo "Price of BNB: {$price} BTC.".PHP_EOL; ``` #### Get miniTicker for all symbols ```php $api->miniTicker(function($api, $ticker) { print_r($ticker); }); ``` <details> <summary>View Response</summary> ``` [7] => Array ( [symbol] => LTCUSDT [close] => 182.85000000 [open] => 192.62000000 [high] => 195.25000000 [low] => 173.08000000 [volume] => 238603.66451000 [quoteVolume] => 43782422.11276660 [eventTime] => 1520497914289 ) [8] => Array ( [symbol] => ICXBTC [close] => 0.00029790 [open] => 0.00030550 [high] => 0.00031600 [low] => 0.00026850 [volume] => 8468620.53000000 [quoteVolume] => 2493.60935828 [eventTime] => 1520497915200 ) ``` </details> #### Get balances for all of your positions, including estimated BTC value ```php $ticker = $api->prices(); // Make sure you have an updated ticker object for this to work $balances = $api->balances($ticker); print_r($balances); echo "BTC owned: ".$balances['BTC']['available'].PHP_EOL; echo "ETH owned: ".$balances['ETH']['available'].PHP_EOL; echo "Estimated Value: ".$api->btc_value." BTC".PHP_EOL; ``` <details> <summary>View Response</summary> ``` [WTC] => Array ( [available] => 909.61000000 [onOrder] => 0.00000000 [btcValue] => 0.94015470 ) [BNB] => Array ( [available] => 1045.94316876 [onOrder] => 0.00000000 [btcValue] => 0.21637426 ) ... (more) ``` </details> #### Get all bid/ask prices ```php $bookPrices = $api->bookPrices(); print_r($bookPrices); echo "Bid price of BNB: {$bookPrices['BNBBTC']['bid']}".PHP_EOL; ``` <details> <summary>View Response</summary> ``` Price of BNB: 0.00021491 Array ( [ETHBTC] => Array ( [bid] => 0.05053000 [bids] => 7.21000000 [ask] => 0.05076000 [asks] => 13.73600000 ) [LTCBTC] => Array ( [bid] => 0.00966500 [bids] => 62.57000000 [ask] => 0.00967100 [asks] => 5.48000000 ) [BNBBTC] => Array ( [bid] => 0.00021010 [bids] => 6.00000000 [ask] => 0.00021479 [asks] => 76.00000000 ) [NEOBTC] => Array ( [bid] => 0.00476600 [bids] => 5.16000000 [ask] => 0.00479900 [asks] => 276.00000000 ) [QTUMETH] => Array ( [bid] => 0.03515000 [bids] => 11.87000000 [ask] => 0.03599900 [asks] => 0.60000000 ) [EOSETH] => Array ( [bid] => 0.00176000 [bids] => 52.63000000 [ask] => 0.00177900 [asks] => 654.44000000 ) [SNTETH] => Array ( [bid] => 0.00008522 [bids] => 2347.00000000 [ask] => 0.00008764 [asks] => 2151.00000000 ) [BNTETH] => Array ( [bid] => 0.00662400 [bids] => 1940.32000000 [ask] => 0.00683900 [asks] => 64.89000000 ) [BCCBTC] => Array ( [bid] => 0.05614300 [bids] => 2.15000000 [ask] => 0.05710000 [asks] => 0.75900000 ) [GASBTC] => Array ( [bid] => 0.00337800 [bids] => 597.29000000 [ask] => 0.00338500 [asks] => 14.63000000 ) [BNBETH] => Array ( [bid] => 0.00411497 [bids] => 375.00000000 [ask] => 0.00418603 [asks] => 4.00000000 ) [BTMETH] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [HCCBTC] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [BTCUSDT] => Array ( [bid] => 5970.00000000 [bids] => 0.00500000 [ask] => 5989.96000000 [asks] => 0.26295200 ) [ETHUSDT] => Array ( [bid] => 303.86000000 [bids] => 4.27000000 [ask] => 304.99000000 [asks] => 0.11361000 ) [HSRBTC] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [OAXETH] => Array ( [bid] => 0.00137100 [bids] => 145.88000000 [ask] => 0.00139500 [asks] => 960.81000000 ) [DNTETH] => Array ( [bid] => 0.00020421 [bids] => 19401.00000000 [ask] => 0.00020573 [asks] => 1.00000000 ) [MCOETH] => Array ( [bid] => 0.02630000 [bids] => 20.36000000 [ask] => 0.02684100 [asks] => 75.35000000 ) [ICNETH] => Array ( [bid] => 0.00391600 [bids] => 51.07000000 [ask] => 0.00396800 [asks] => 146.69000000 ) [ELCBTC] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [MCOBTC] => Array ( [bid] => 0.00132800 [bids] => 24.64000000 [ask] => 0.00133200 [asks] => 8.26000000 ) [WTCBTC] => Array ( [bid] => 0.00116640 [bids] => 104.00000000 [ask] => 0.00118000 [asks] => 1572.00000000 ) [WTCETH] => Array ( [bid] => 0.02311400 [bids] => 0.99000000 [ask] => 0.02330000 [asks] => 27.68000000 ) [LLTBTC] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [LRCBTC] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [LRCETH] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [QTUMBTC] => Array ( [bid] => 0.00178700 [bids] => 328.30000000 [ask] => 0.00180500 [asks] => 50.00000000 ) [YOYOBTC] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [OMGBTC] => Array ( [bid] => 0.00126100 [bids] => 61.00000000 [ask] => 0.00126400 [asks] => 8.50000000 ) [OMGETH] => Array ( [bid] => 0.02467200 [bids] => 60.99000000 [ask] => 0.02527500 [asks] => 7.98000000 ) [ZRXBTC] => Array ( [bid] => 0.00003370 [bids] => 69.00000000 [ask] => 0.00003377 [asks] => 7437.00000000 ) [ZRXETH] => Array ( [bid] => 0.00065565 [bids] => 68.00000000 [ask] => 0.00069171 [asks] => 123.00000000 ) [STRATBTC] => Array ( [bid] => 0.00051200 [bids] => 387.00000000 [ask] => 0.00052100 [asks] => 17.90000000 ) [STRATETH] => Array ( [bid] => 0.00988800 [bids] => 299.97000000 [ask] => 0.01084600 [asks] => 133.91000000 ) [SNGLSBTC] => Array ( [bid] => 0.00002211 [bids] => 1028.00000000 [ask] => 0.00002217 [asks] => 536.00000000 ) [SNGLSETH] => Array ( [bid] => 0.00043801 [bids] => 892.00000000 [ask] => 0.00043902 [asks] => 1585.00000000 ) [BQXBTC] => Array ( [bid] => 0.00011061 [bids] => 1814.00000000 [ask] => 0.00011496 [asks] => 1707.00000000 ) [BQXETH] => Array ( [bid] => 0.00220610 [bids] => 109.00000000 [ask] => 0.00241190 [asks] => 2606.00000000 ) [KNCBTC] => Array ( [bid] => 0.00017061 [bids] => 1109.00000000 [ask] => 0.00017297 [asks] => 63.00000000 ) [KNCETH] => Array ( [bid] => 0.00340090 [bids] => 3.00000000 [ask] => 0.00342860 [asks] => 515.00000000 ) [FUNBTC] => Array ( [bid] => 0.00000314 [bids] => 17100.00000000 [ask] => 0.00000317 [asks] => 15600.00000000 ) [FUNETH] => Array ( [bid] => 0.00006186 [bids] => 4473.00000000 [ask] => 0.00006467 [asks] => 42036.00000000 ) [SNMBTC] => Array ( [bid] => 0.00001760 [bids] => 3695.00000000 [ask] => 0.00001781 [asks] => 623.00000000 ) [SNMETH] => Array ( [bid] => 0.00034783 [bids] => 507.00000000 [ask] => 0.00035350 [asks] => 1501.00000000 ) [NEOETH] => Array ( [bid] => 0.09414500 [bids] => 12.38000000 [ask] => 0.09599700 [asks] => 23.38000000 ) [IOTABTC] => Array ( [bid] => 0.00006791 [bids] => 2000.00000000 [ask] => 0.00006857 [asks] => 1861.00000000 ) [IOTAETH] => Array ( [bid] => 0.00135101 [bids] => 1461.00000000 [ask] => 0.00138938 [asks] => 21.00000000 ) [LINKBTC] => Array ( [bid] => 0.00004400 [bids] => 683.00000000 [ask] => 0.00004491 [asks] => 7292.00000000 ) [LINKETH] => Array ( [bid] => 0.00086045 [bids] => 682.00000000 [ask] => 0.00087683 [asks] => 4286.00000000 ) [XVGBTC] => Array ( [bid] => 0.00000080 [bids] => 96600.00000000 [ask] => 0.00000081 [asks] => 179622.00000000 ) [XVGETH] => Array ( [bid] => 0.00001556 [bids] => 96537.00000000 [ask] => 0.00001675 [asks] => 4.00000000 ) [CTRBTC] => Array ( [bid] => 0.00009346 [bids] => 2133.00000000 [ask] => 0.00009470 [asks] => 1992.00000000 ) [CTRETH] => Array ( [bid] => 0.00187050 [bids] => 501.00000000 [ask] => 0.00189230 [asks] => 105.00000000 ) [SALTBTC] => Array ( [bid] => 0.00044400 [bids] => 181.09000000 [ask] => 0.00044700 [asks] => 1144.81000000 ) [SALTETH] => Array ( [bid] => 0.00866500 [bids] => 216.71000000 [ask] => 0.00893900 [asks] => 237.00000000 ) [MDABTC] => Array ( [bid] => 0.00021328 [bids] => 555.00000000 [ask] => 0.00021973 [asks] => 236.00000000 ) [MDAETH] => Array ( [bid] => 0.00425610 [bids] => 450.00000000 [ask] => 0.00441450 [asks] => 511.00000000 ) [MTLBTC] => Array ( [bid] => 0.00114500 [bids] => 194.48000000 [ask] => 0.00117000 [asks] => 1.40000000 ) [MTLETH] => Array ( [bid] => 0.02156000 [bids] => 183.00000000 [ask] => 0.02436700 [asks] => 200.97000000 ) [SUBBTC] => Array ( [bid] => 0.00002116 [bids] => 520.00000000 [ask] => 0.00002177 [asks] => 957.00000000 ) [SUBETH] => Array ( [bid] => 0.00042121 [bids] => 202.00000000 [ask] => 0.00044390 [asks] => 69.00000000 ) [EOSBTC] => Array ( [bid] => 0.00008837 [bids] => 52.00000000 [ask] => 0.00008901 [asks] => 565.00000000 ) [SNTBTC] => Array ( [bid] => 0.00000431 [bids] => 11731.00000000 [ask] => 0.00000439 [asks] => 9000.00000000 ) [ETC] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [ETCETH] => Array ( [bid] => 0.03600000 [bids] => 460.15000000 [ask] => 0.03699600 [asks] => 30.00000000 ) [ETCBTC] => Array ( [bid] => 0.00181200 [bids] => 6.90000000 [ask] => 0.00183700 [asks] => 2.72000000 ) [MTHBTC] => Array ( [bid] => 0.00001400 [bids] => 400.00000000 [ask] => 0.00001467 [asks] => 615.00000000 ) [MTHETH] => Array ( [bid] => 0.00027316 [bids] => 399.00000000 [ask] => 0.00029096 [asks] => 24939.00000000 ) [ENGBTC] => Array ( [bid] => 0.00006927 [bids] => 2896.00000000 [ask] => 0.00007040 [asks] => 75.00000000 ) [ENGETH] => Array ( [bid] => 0.00138220 [bids] => 1111.00000000 [ask] => 0.00142990 [asks] => 2010.00000000 ) [DNTBTC] => Array ( [bid] => 0.00001053 [bids] => 11295.00000000 [ask] => 0.00001065 [asks] => 8272.00000000 ) [ZECBTC] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [ZECETH] => Array ( [bid] => 0.00000000 [bids] => 0.00000000 [ask] => 0.00000000 [asks] => 0.00000000 ) [BNTBTC] => Array ( [bid] => 0.00033500 [bids] => 15.00000000 [ask] => 0.00033996 [asks] => 679.00000000 ) [ASTBTC] => Array ( [bid] => 0.00004133 [bids] => 9513.00000000 [ask] => 0.00004528 [asks] => 4170.00000000 ) [ASTETH] => Array ( [bid] => 0.00083830 [bids] => 4296.00000000 [ask] => 0.00084900 [asks] => 999.00000000 ) [DASHBTC] => Array ( [bid] => 0.04651200 [bids] => 0.25000000 [ask] => 0.04659000 [asks] => 1.00000000 ) [DASHETH] => Array ( [bid] => 0.90420000 [bids] => 63.96400000 [ask] => 0.94375000 [asks] => 0.36900000 ) ) ``` </details> #### Place a LIMIT order ```php $quantity = 1; $price = 0.0005; $order = $api->buy("BNBBTC", $quantity, $price); ``` ```php $quantity = 1; $price = 0.0006; $order = $api->sell("BNBBTC", $quantity, $price); ``` #### Place a MARKET order ```php $quantity = 1; $order = $api->marketBuy("BNBBTC", $quantity); ``` ```php $quantity = 0.01; $order = $api->marketSell("ETHBTC", $quantity); ``` <details> <summary>View Response</summary> ``` ( [symbol] => BNBBTC [orderId] => 7652393 [clientOrderId] => aAE7BNUhITQj3eg04iG1sY [transactTime] => 1508564815865 [price] => 0.00000000 [origQty] => 1.00000000 [executedQty] => 1.00000000 [status] => FILLED [timeInForce] => GTC [type] => MARKET [side] => BUY ) ``` </details> #### Place a STOP LOSS order ```php // When the stop is reached, a stop order becomes a market order $type = "STOP_LOSS"; // Set the type STOP_LOSS (market) or STOP_LOSS_LIMIT, and TAKE_PROFIT (market) or TAKE_PROFIT_LIMIT $quantity = 1; $price = 0.5; // Try to sell it for 0.5 btc $stopPrice = 0.4; // Sell immediately if price goes below 0.4 btc $order = $api->sell("BNBBTC", $quantity, $price, $type, ["stopPrice"=>$stopPrice]); print_r($order); ``` #### Place an ICEBERG order ```php // Iceberg orders are intended to conceal the true order quantity. $type = "LIMIT"; // LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT $quantity = 1; $price = 0.5; $icebergQty = 10; $order = $api->sell("BNBBTC", $quantity, $price, $type, ["icebergQty"=>$icebergQty]); print_r($order); ``` #### Getting 24hr ticker price change statistics for a symbol ```php $prevDay = $api->prevDay("BNBBTC"); print_r($prevDay); echo "BNB price change since yesterday: ".$prevDay['priceChangePercent']."%".PHP_EOL; ``` #### Complete Account Trade History ```php $history = $api->history("BNBBTC"); print_r($history); ``` <details> <summary>View Response</summary> ``` Array ( [0] => Array ( [id] => 831585 [orderId] => 3635308 [price] => 0.00028800 [qty] => 4.00000000 [commission] => 0.00200000 [commissionAsset] => BNB [time] => 1504805561369 [isBuyer] => 1 [isMaker] => [isBestMatch] => 1 ) [1] => Array ( [id] => 1277334 [orderId] => 6126625 [price] => 0.00041054 [qty] => 16.00000000 [commission] => 0.00800000 [commissionAsset] => BNB [time] => 1507059468604 [isBuyer] => 1 [isMaker] => [isBestMatch] => 1 ) [2] => Array ( [id] => 1345995 [orderId] => 6407202 [price] => 0.00035623 [qty] => 30.00000000 [commission] => 0.01500000 [commissionAsset] => BNB [time] => 1507434311489 [isBuyer] => 1 [isMaker] => 1 [isBestMatch] => 1 ) ) ... (more) ``` </details> #### Get Market Depth ```php $depth = $api->depth("ETHBTC"); print_r($depth); ``` #### Get Open Orders ```php $openorders = $api->openOrders("BNBBTC"); print_r($openorders); ``` #### Get Order Status ```php $orderid = "7610385"; $orderstatus = $api->orderStatus("ETHBTC", $orderid); print_r($orderstatus); ``` #### Cancel an Order ```php $response = $api->cancel("ETHBTC", $orderid); print_r($response); ``` #### Market History / Aggregate Trades ```php $trades = $api->aggTrades("BNBBTC"); print_r($trades); ``` #### Get all account orders; active, canceled, or filled. ```php $orders = $api->orders("BNBBTC"); print_r($orders); ``` #### Get Kline/candlestick data for a symbol ```php //Periods: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M $ticks = $api->candlesticks("BNBBTC", "5m"); print_r($ticks); ``` <details> <summary>View Response</summary> ``` [1508560200000] => Array ( [open] => 0.00019691 [high] => 0.00019695 [low] => 0.00019502 [close] => 0.00019503 [volume] => 0.13712290 ) [1508560500000] => Array ( [open] => 0.00019502 [high] => 0.00019693 [low] => 0.00019501 [close] => 0.00019692 [volume] => 1.03216357 ) [1508560800000] => Array ( [open] => 0.00019692 [high] => 0.00019692 [low] => 0.00019689 [close] => 0.00019692 [volume] => 0.22270990 ) ... (more) ``` </details> ## WebSocket API #### miniTicker return the latest candlestick information for every symbol ```php $api->miniTicker(function($api, $ticker) { print_r($ticker); }); ``` <details> <summary>View Response</summary> ``` [18] => Array ( [symbol] => ONTBNB [close] => 0.37649000 [open] => 0.30241000 [high] => 0.38112000 [low] => 0.29300000 [volume] => 975240.72000000 [quoteVolume] => 326908.77744250 [eventTime] => 1523395389582 ) [19] => Array ( [symbol] => WANBTC [close] => 0.00063657 [open] => 0.00054151 [high] => 0.00063900 [low] => 0.00053900 [volume] => 4443618.00000000 [quoteVolume] => 2637.76413131 [eventTime] => 1523395389551 ) ``` </details> #### Realtime Complete Chart Updates via WebSockets ```php $api->chart(["BNBBTC"], "15m", function($api, $symbol, $chart) { echo "{$symbol} chart update\n"; print_r($chart); }); ``` <details> <summary>View Response</summary> ``` [1508560200000] => Array ( [open] => 0.00019691 [high] => 0.00019695 [low] => 0.00019502 [close] => 0.00019503 [volume] => 0.13712290 ) [1508560500000] => Array ( [open] => 0.00019502 [high] => 0.00019693 [low] => 0.00019501 [close] => 0.00019692 [volume] => 1.03216357 ) [1508560800000] => Array ( [open] => 0.00019692 [high] => 0.00019692 [low] => 0.00019689 [close] => 0.00019692 [volume] => 0.22270990 ) ... (more) ``` </details> #### Get latest candlestick data only ```php $api->kline(["BTCUSDT", "EOSBTC"], "5m", function($api, $symbol, $chart) { //echo "{$symbol} ({$interval}) candlestick update\n"; $interval = $chart->i; $tick = $chart->t; $open = $chart->o; $high = $chart->h; $low = $chart->l; $close = $chart->c; $volume = $chart->q; // +trades buyVolume assetVolume makerVolume echo "{$symbol} price: {$close}\t volume: {$volume}\n"; }); ``` #### Trade Updates via WebSocket ```php $api->trades(["BNBBTC"], function($api, $symbol, $trades) { echo "{$symbol} trades update".PHP_EOL; print_r($trades); }); ``` #### Get ticker updates for all symbols via WebSocket ```php $api->ticker(false, function($api, $symbol, $ticker) { print_r($ticker); }); ``` #### Get ticker updates for a specific symbol via WebSocket ```php $api->ticker("BNBBTC", function($api, $symbol, $ticker) { print_r($ticker); }); ``` #### Realtime updated depth cache via WebSockets ```php $api->depthCache(["BNBBTC"], function($api, $symbol, $depth) { echo "{$symbol} depth cache update".PHP_EOL; //print_r($depth); // Print all depth data $limit = 11; // Show only the closest asks/bids $sorted = $api->sortDepth($symbol, $limit); $bid = $api->first($sorted['bids']); $ask = $api->first($sorted['asks']); echo $api->displayDepth($sorted); echo "ask: {$ask}".PHP_EOL; echo "bid: {$bid}".PHP_EOL; }); ``` <details> <summary>View Response</summary> ``` asks: 0.00020649 1,194 0.24654906 0.00020600 375 0.07725000 0.00020586 4 0.00823440 0.00020576 1 0.00205760 0.00020564 226 0.04647464 0.00020555 38 0.00781090 0.00020552 98 0.02014096 0.00020537 121 0.02484977 0.00020520 46 0.09439200 0.00020519 29 0.05950510 0.00020518 311 0.06381098 bids: 0.00022258 5,142 1.14450636 0.00020316 7 0.00142212 0.00020315 82 0.01665830 0.00020314 16 0.00325024 0.00020313 512 0.10400256 0.00020238 5 0.01011900 0.00020154 1,207 0.24325878 0.00020151 1 0.02015100 0.00020150 3 0.60450000 0.00020140 217 0.04370380 0.00020135 1 0.02013500 ask: 0.00020518 bid: 0.00022258 ``` </details> #### User Data: Account Balance Updates, Trade Updates, New Orders, Filled Orders, Cancelled Orders via WebSocket ```php $balance_update = function($api, $balances) { print_r($balances); echo "Balance update".PHP_EOL; }; $order_update = function($api, $report) { echo "Order update".PHP_EOL; print_r($report); $price = $report['price']; $quantity = $report['quantity']; $symbol = $report['symbol']; $side = $report['side']; $orderType = $report['orderType']; $orderId = $report['orderId']; $orderStatus = $report['orderStatus']; $executionType = $report['orderStatus']; if ( $executionType == "NEW" ) { if ( $executionType == "REJECTED" ) { echo "Order Failed! Reason: {$report['rejectReason']}".PHP_EOL; } echo "{$symbol} {$side} {$orderType} ORDER #{$orderId} ({$orderStatus})".PHP_EOL; echo "..price: {$price}, quantity: {$quantity}".PHP_EOL; return; } //NEW, CANCELED, REPLACED, REJECTED, TRADE, EXPIRED echo "{$symbol} {$side} {$executionType} {$orderType} ORDER #{$orderId}".PHP_EOL; }; $api->userData($balance_update, $order_update); ``` <details> <summary>View Response</summary> ``` Order update [symbol] => BNBETH [side] => BUY [orderType] => LIMIT [quantity] => 2.00000000 [price] => 0.00623005 [executionType] => NEW [orderStatus] => NEW [rejectReason] => NONE [orderId] => 4102532 [clientOrderId] => ULtH25RPmICFH0jvsQiq8y [orderTime] => 1508637831437 [eventTime] => 1508637831440 BNBETH BUY LIMIT ORDER #4102532 (NEW) ..price: 0.00623005, quantity: 2.00000000 Balance update [BTC] => Array ( [available] => 0.18167974 [onOrder] => 0.00000000 ) [LTC] => Array ( [available] => 0.00000000 [onOrder] => 0.00000000 ) [ETH] => Array ( [available] => 26.68739238 [onOrder] => 2.55103500 ) ...(more) ``` </details> #### Withdraw ```php $asset = "BTC"; $address = "1C5gqLRs96Xq4V2ZZAR1347yUCpHie7sa"; $amount = 0.2; $response = $api->withdraw($asset, $address, $amount); print_r($response); ``` #### Withdraw with addressTag ```php //Required for coins like XMR, XRP, etc. $address = "44tLjmXrQNrWJ5NBsEj2R77ZBEgDa3fEe9GLpSf2FRmhexPvfYDUAB7EXX1Hdb3aMQ9FLqdJ56yaAhiXoRsceGJCRS3Jxkn"; $addressTag = "0e5e38a01058dbf64e53a4333a5acf98e0d5feb8e523d32e3186c664a9c762c1 "; $amount = 0.1; $response = $api->withdraw($asset, $address, $amount, $addressTag); print_r($response); ``` #### Get All Withdraw History ```php $withdrawHistory = $api->withdrawHistory(); print_r($withdrawHistory); ``` #### Get Withdraw History for a specific asset ```php $withdrawHistory = $api->withdrawHistory("BTC"); print_r($withdrawHistory); ``` #### Get Deposit Address ```php $depositAddress = $api->depositAddress("VEN"); print_r($depositAddress); ``` #### Get All Deposit History ```php $depositHistory = $api->depositHistory(); print_r($depositHistory); ``` ### Troubleshooting If you get the following errors, please synchronize your system time. ``` signedRequest error: {"code":-1021,"msg":"Timestamp for this request was 1000ms ahead of the server's time."} signedRequest error: {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."} balanceData error: Please make sure your system time is synchronized, or pass the useServerTime option. ``` #### useServerTime ```php //Call this before running any functions $api->useServerTime(); ``` #### Installing on Windows Download and install composer: 1. https://getcomposer.org/download/ 2. Create a folder on your drive like C:\Binance 3. Run command prompt and type `cd C:\Binance` 4. ```composer require jaggedsoft/php-binance-api``` 5. Once complete copy the vendor folder into your project. #### Config file in home directory If you dont wish to store your API key and secret in your scripts, load it from your home directory ```bash mkdir -vp ~/.config/jaggedsoft/ cat > ~/.config/jaggedsoft/php-binance-api.json << EOF { "api-key": "<api key>", "api-secret": "<secret>" } EOF ``` #### Config file in home directory to operate on testnet Testnet have its own credentials, see the [testnet documentation page](https://testnet.binance.vision/) for more details. ```bash mkdir -vp ~/.config/jaggedsoft/ cat > ~/.config/jaggedsoft/php-binance-api.json << EOF { "api-key": "<testnet api key>", "api-secret": "<testnet secret>", "use-testnet": true } EOF ``` #### Config file in home directory with curl options ```bash mkdir -vp ~/.config/jaggedsoft/ cat > ~/.config/jaggedsoft/php-binance-api.json << EOF { "api-key": "<api key>", "api-secret": "<secret>", "curlOpts": { "CURLOPT_SSL_VERIFYPEER": 0, "INVALID_CONSTANT_NAME": 42 } } EOF ``` Optionally add proxy configuration ```bash mkdir -vp ~/.config/jaggedsoft/ cat > ~/.config/jaggedsoft/php-binance-api.json << EOF { "api-key": "<api key>", "api-secret": "<secret>", "proto": "https", "address": "proxy.domain.com", "port": "1080" } EOF ``` custom location ```php $api = new Binance\API( "myfile.json" ); ``` #### Basic stats: Get api call counter ```php $api->getRequestCount(); ``` #### Basic stats: Get total data transferred ```php $api->getTransfered(); ``` #### Security - Disable downloading of CA Bundles You can disable the downloading of the CA Bundle: ```php $api = new Binance\API( "somefile.json" ); $api->caOverride = true; ``` ### Documentation > There are also numerous other formats available here: https://github.com/jaggedsoft/php-binance-api/tree/gh-pages [![Vitality](https://github.com/user-attachments/assets/0981aae2-3e12-4b57-8d2f-c5ae2b3b8b1c)](https://vitalitycrypto.com/) ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=ccxt/php-binance-api&type=Date)](https://www.star-history.com/#ccxt/php-binance-api&Date) ## Contribution - Give us a star :star: - Fork and Clone! Awesome - Select existing [issues](https://github.com/jaggedsoft/php-binance-api/issues) or create a [new issue](https://github.com/jaggedsoft/php-binance-api/issues/new) and give us a PR with your bugfix or improvement after. We love it ❤️

Crypto & Blockchain
642 Github Stars