币币交易

公共

安全类型: None

测试连接

GET https://openapi.xxx.xx/sapi/v1/ping

测试REST API的连通性

}

服务器时间

GET https://openapi.xxx.xx/sapi/v1/time

获取服务器时间

{
    "timezone": "GMT+08:00",
    "serverTime": 1595563624731
}

币对列表

GET https://openapi.xxx.xx/sapi/v1/symbols

市场支持的币对集合esponse:

名称类型例子描述timelong1595563624731当前时间(Unix Timestamp, 毫秒ms)bidslist如下订单薄买盘信息askslist如下订单薄卖盘信息bids和asks所对应的信息代表了订单薄的所有价格以及价格对应的数量的信息, 由最优价格从上倒下排列名称类型例子描述' 'float131.1价格' 'float2.3当前价格对应的数量GEThttps://openapi.xxx.com/sapi/v1/ticker\

{
    "symbols": [
        {
            "quantityPrecision": 3,
            "symbol": "sccadai",
            "pricePrecision": 6,
            "baseAsset": "SCCA",
            "quoteAsset": "DAI"
        },
        {
            "quantityPrecision": 8,
            "symbol": "btcusdt",
            "pricePrecision": 2,
            "baseAsset": "BTC",
            "quoteAsset": "USDT"
        },
        {
            "quantityPrecision": 3,
            "symbol": "bchusdt",
            "pricePrecision": 2,
            "baseAsset": "BCH",
            "quoteAsset": "USDT"
        },
        {
            "quantityPrecision": 2,
            "symbol": "etcusdt",
            "pricePrecision": 2,
            "baseAsset": "ETC",
            "quoteAsset": "USDT"
        },
        {
            "quantityPrecision": 2,
            "symbol": "ltcbtc",
            "pricePrecision": 6,
            "baseAsset": "LTC",
            "quoteAsset": "BTC"
        }
    ]
}

权重(IP/UID): 1

Response:

行情

安全类型: None

订单薄

GET https://openapi.xxx.xx/sapi/v1/depth

市场订单薄深度信息

Query Parameters

{
  "bids": [
    [
      "3.90000000",   // 价格
      "431.00000000"  // 数量
    ],
    [
      "4.00000000",
      "431.00000000"
    ]
  ],
  "asks": [
    [
      "4.00000200",  // 价格
      "12.00000000"  // 数量
    ],
    [
      "5.10000000",
      "28.00000000"
    ]
  ]
}

权重(IP/UID): 5

Response:

bids和asks所对应的信息代表了订单薄的所有价格以及价格对应的数量的信息, 由最优价格从上倒下排列

行情ticker

GET https://openapi.xxx.xx/sapi/v1/ticker

24小时价格变化数据

Query Parameters

{
    "high": "9279.0301",
    "vol": "1302",
    "last": "9200",
    "low": "9279.0301",
    "rose": "0",
    "time": 1595563624731
}

权重(IP/UID): 5

Response:

最近成交

GET https://openapi.xxx.xx/sapi/v1/trades

Query Parameters

{
    "list":[
        {
            "price":"3.00000100",
            "qty":"11.00000000",
            "time":1499865549590,
            "side":"BUY"
        }
    ]
}

权重(IP/UID): 5

Response:

K线/蜡烛图数据

GET https://openapi.xxx.xx/sapi/v1/klines

Query Parameters

[
    {
        "high": "6228.77",
        "vol": "111",
        "low": "6228.77",
        "idx": 1594640340,
        "close": "6228.77",
        "open": "6228.77"
    },
    {
        "high": "6228.77",
        "vol": "222",
        "low": "6228.77",
        "idx": 1587632160,
        "close": "6228.77",
        "open": "6228.77"
    },
    {
        "high": "6228.77",
        "vol": "333",
        "low": "6228.77",
        "idx": 1587632100,
        "close": "6228.77",
        "open": "6228.77"
    }
]

权重(IP/UID): 1

Response:

交易

安全类型: TRADE

交易下方的接口都需要签名和API-Key验证

创建新订单

POST https://openapi.xxx.xx/sapi/v1/order

Query Parameters

Request Body

{
    'symbol': 'LXTUSDT', 
    'orderId': '150695552109032492', //Long类型的订单号
    'clientOrderId': '157371322565051',
    'transactTime': '1573713225668', 
    'price': '0.005452', 
    'origQty': '110', 
    'executedQty': '0', 
    'status': 'NEW',
    'type': 'LIMIT', 
    'side': 'SELL',
    "orderIdString": "1642655717519015937" //字符串类型的订单号,推荐使用这个

}

权重(IP/UID): 5

Response:

创建测试订单

POST https://openapi.xxx.xx/sapi/v1/order/test

创建和验证新订单, 但不会送入撮合引擎

Headers

Request Body

{
    // Response
}

权重(IP/UID): 1



批量下单

POST https://openapi.xxx.xx/sapi/v1/batchOrders

Headers

Request Body

{
    "idsString": [ //字符串类型的订单id(推荐使用)
        "165964665990709251",
        "165964665990709252",
        "165964665990709253"
    ],
    "ids": [
        165964665990709251,
        165964665990709252,
        165964665990709253
    ]
}

权重(IP/UID): 10

Resquest orders field:

Resquest:

订单查询

GET https://openapi.xxx.xx/sapi/v1/order

Query Parameters

Headers

{
    'orderId': '499890200602846976', 
    'clientOrderId': '157432755564968', 
    'symbol': 'BHTUSDT', 
    'price': '0.01', 
    'origQty': '50', 
    'executedQty': '0', 
    'avgPrice': '0', 
    'status': 'NEW', 
    'type': 'LIMIT', 
    'side': 'BUY', 
    'transactTime': '1574327555669'
}

权重(IP/UID): 1

Response:

撤销订单

POST https://openapi.xxx.xx/sapi/v1/cancel

Headers

Request Body

{
    'symbol': 'BHTUSDT', 
    'clientOrderId': '0', 
    'orderId': '499890200602846976', 
    'status': 'CANCELED'
}

权重(IP/UID): 5

Response:

批量撤销订单

POST https://openapi.xxx.xx/sapi/v1/batchCancel

一次批量最多10个订单

Headers

Request Body

{
    "success": [
        165964665990709251,
        165964665990709252,
        165964665990709253
    ],
    "failed": [ //取消失败一般是因为订单不存在或订单状态已经到终态
        165964665990709250  
    ]
}

权重(IP/UID): 10



当前订单

GET https://openapi.xxx.xx/sapi/v1/openOrders

Query Parameters

Headers

[
    {
        'orderId': '499902955766523648', 
        'symbol': 'BHTUSDT', 
        'price': '0.01', 
        'origQty': '50', 
        'executedQty': '0', 
        'avgPrice': '0', 
        'status': 'NEW', 
        'type': 'LIMIT', 
        'side': 'BUY', 
        'time': '1574329076202'
        },...
]

权重(IP/UID): 1

Response:

交易记录

GET https://openapi.xxx.xx/sapi/v1/myTrades

Query Parameters

Headers

[
  {
    "symbol": "ETHBTC",
    "id": 100211,
    "bidId": 150695552109032492,
    "askId": 150695552109032493,
    "price": "4.00000100",
    "qty": "12.00000000",
    "time": 1499865549590,
    "isBuyer": true,
    "isMaker": false,
    "feeCoin": "ETH",
    "fee":"0.001",
    "bidUserId":23334,
    "askUserId":44112
  },...
]

权重(IP/UID): 1

Response:

账户

安全类型: USER_DATA

账户信息

GET https://openapi.xxx.xx/sapi/v1/account

Headers

权重(IP/UID): 1

Last updated