如何使用 Binance API 检索所有市场对的列表,如 ETH/BTC? [英] How to retrieve a list of all market pairs like ETH/BTC using Binance API?

查看:21
本文介绍了如何使用 Binance API 检索所有市场对的列表,如 ETH/BTC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个与加密交易相关的项目,我需要选择一个币安交易所的市场对,并根据对选择我必须显示各种结果,如当前价格、24 小时价格变化、24 小时交易量和最后该市场对的 10 个交易历史.我已经浏览了 Binance Rest API 文档:https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md ,并且找不到可以帮助我检索市场列表的端点对.有没有我不知道的文件?

I am working on a project relevant to crypto trading where I need to select a market pair of Binance Exchange and based on the pair choice I have to show various results like current price, 24 Hr price change, 24 Hr Volume and last 10 trade history of that market pair. I have gone through Binance Rest API Docs: https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md ,and can't find the endpoint which can help me retrieve a list of market pairs. Is there any documentation I am unaware about?

谢谢.

推荐答案

您正在寻找 /exchangeInfo 公共端点.

You are looking for the /exchangeInfo public endpoint.

https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md :

交换信息

GET/api/v1/exchangeInfo

当前交易所交易规则和交易品种信息

Current exchange trading rules and symbol information

所有硬币对的结果 symbols 数组:

Resulting symbols array of all coin pairs:

...
"symbols": [{
"symbol": "ETHBTC",
"status": "TRADING",
"baseAsset": "ETH",
"baseAssetPrecision": 8,
"quoteAsset": "BTC",
"quotePrecision": 8,
"orderTypes": [
  // These are defined in the `ENUM definitions` section under `Order types (orderTypes)`.
  // All orderTypes are optional.
],
"icebergAllowed": false,
"filters": [
  // There are defined in the `Filters` section.
  // All filters are optional.
]
}]
...

这篇关于如何使用 Binance API 检索所有市场对的列表,如 ETH/BTC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆