API Reference

BBO

Subscribe

Rate Limit: 1 requests per 1 seconds per IP

Request

{  
    "action":"SUBSCRIBE",  
    "args":[  
        {  
            "channel":"BBO",  
            "instId":"BINANCE_SPOT_BTC_USDT"  
        },  
        {  
            "channel":"BBO",  
            "instId":"OKX_SPOT_BTC_USDT"  
        },{  
            "channel":"BBO",  
            "instId":"BINANCE_PERP_BTC_USDT"  
        },  
        {  
            "channel":"BBO",  
            "instId":"OKX_PERP_BTC_USDT"  
        }
    ]  
}
 
Field nameTypeNecessaryRemarks
actionStringYAction
argsArrayYSubscribe param,there can be no more than 20 instId parameters per subscribe
> channelStringYChannel name
> instIdStringYUnique identifier

Response

{  
    "event": "SUBSCRIBE",  
    "args": [  
        {  
            "channel":"BBO",  
            "instId":"BINANCE_SPOT_BTC_USDT"  
        },  
        {  
            "channel":"BBO",  
            "instId":"OKEX_SPOT_BTC_USDT"  
        },{  
            "channel":"BBO",  
            "instId":"BINANCE_PERP_BTC_USDT"  
        },  
        {  
            "channel":"BBO",  
            "instId":"OKX_PERP_BTC_USDT"  
        }   
    ],  
    "code": 0  
}
 
FieldTypeRemarks
eventStringEvent
codeStringCode
argsArrayData
> channelStringChannel
> instIdStringUnique identifier

BBO example:

{
    "instId": "BINANCE_SPOT_BNB_USDT",
    "publicChannelTypeEnum": "BBO",
    "exchangeTs": 1701048908942000000,
    "localTs": 1701048908944715333,
    "seqNum": 685893995,
    "symbol": "BNBUSDT",
    "exchange": "BINANCE_SPOT",
    "bid":
    {
        "price": 231.6,
        "qty": 282.5720000000001
    },
    "ask":
    {
        "price": 231.7,
        "qty": 407.454
    }
}
FieldTypeRemarks
instIdStringUnique identifier
publicChannelTypeEnumStringPublicChannelType, example: ORDER_BOOK
exchangeTsLongExchange timestamp
localTsLongLocal timestamp
seqNumLongMessage sequence number
symbolStringTrading symbol , example: BTCUSDT
exchangeStringExchange
bidObjectBid best price and quantity
> priceDoublePrice
> qtyDoubleQuantity
askObjectAsk price and quantity
> priceDoublePrice
> qtyDoubleQuantity

Unsubscribe

Rate Limit: 1 requests per 1 seconds per IP

Request

{  
    "action":"UNSUBSCRIBE",  
    "args":[  
        {  
            "channel":"BBO",  
            "instId":"BINANCE_SPOT_BTC_USDT"  
        },  
        {  
            "channel":"BBO",  
            "instId":"OKX_SPOT_BTC_USDT"  
        },{  
            "channel":"BBO",  
            "instId":"BINANCE_PERP_BTC_USDT"  
        },  
        {  
            "channel":"BBO",  
            "instId":"OKX_PERP_BTC_USDT"  
        }   
    ]  
}
 
Field nameTypeNecessaryRemarks
actionStringYAction
argsArrayYData
> channelStringYChannel name
> instIdStringYUnique identifier

Response


 {  
    "event": "UNSUBSCRIBE",  
    "args": [  
        {  
            "channel":"BBO",  
            "instId":"BINANCE_SPOT_BTC_USDT"  
        },  
        {  
            "channel":"BBO",  
            "instId":"OKX_SPOT_BTC_USDT"  
        },{  
            "channel":"BBO",  
            "instId":"BINANCE_PERP_BTC_USDT"  
        },  
        {  
            "channel":"BBO",  
            "instId":"OKX_PERP_BTC_USDT"  
        }   
    ],  
    "code": 0  
}
FieldTypeRemarks
eventStringEvent
codeStringCode
argsArrayData
> channelStringChannel name
> instIdStringUnique identifier