输入/搜索内容
入门
平台基础
编写策略
开发工具
回测系统
进阶专题
数据与研究
扩展API接口
AI接入
创建ApiKey
验证方式
扩展API接口详解
GetAccount
GetNodeList
DeleteNode
GetExchangeList
GetPlatformList
GetStrategyList
GetRobotGroupList
GetRobotList
GetRobotDetail
GetRobotLogs
NewRobot
RestartRobot
StopRobot
CommandRobot
DeleteRobot
PluginRun
pub
扩展API接口返回码
实盘状态码

获取平台支持的交易所列表,以及每个交易所需要填写的配置项。

示例

列出支持的交易所Id和名称(概要信息)。

python
# api() 见「签名验证」页面的Python示例 r = api('GetExchangeList', True) for e in r['data']['result']['exchanges']: print(e['eid'], e['name'])

返回值

类型描述

object

成功时data.result.exchanges为交易所数组,字段见下方属性表。

参数

名称类型必填描述

isSummary

bool

是

true只返回概要信息,不含meta、stocks;false返回完整信息。

属性

名称类型描述

exchanges[].eid

string

交易所Id,例如Futures_Binance;实盘配置中直接传入交易所配置时用它。

exchanges[].name

string

显示名称,写作中文|英文。

exchanges[].category

string

分类。

exchanges[].meta

string

交易所配置项的元数据(JSON文本),只在isSummary为false时返回;实盘配置中meta的字段名取自这里。

exchanges[].stocks

string

常用交易对,逗号分隔,只在isSummary为false时返回。

备注

返回示例(isSummary为false)
json
{ "code": 0, "data": { "result": { "exchanges": [{ "category": "加密货币||Crypto", "eid": "Futures_Binance", "id": 74, "logo": "/upload/asset/d8d84b23e573e9326b99.svg", "meta": "[...]", "name": "币安期货|Futures_Binance", "priority": 200, "stocks": "BTC_USDT,ETH_USDT,ETH_USD", "website": "https://accounts.binance.com/zh-TC/register?ref=45110270" }] }, "error": null } }

其中meta是JSON文本,解析后为配置项数组:

json
[ {"desc": "Access Key", "qr": "apiKey", "required": true, "type": "string", "name": "AccessKey", "label": "Access Key"}, {"encrypt": true, "qr": "secretKey", "name": "SecretKey", "required": true, "label": "Secret Key", "type": "password", "desc": "Secret Key"} ]

返回示例(isSummary为true)
json
{ "code": 0, "data": { "result": { "exchanges": [{ "category": "加密货币||Crypto", "eid": "Futures_Binance", "id": 74, "logo": "/upload/asset/d8d84b23e573e9326b99.svg", "name": "币安期货|Futures_Binance", "priority": 200, "website": "https://accounts.binance.com/zh-TC/register?ref=45110270" }] }, "error": null } }