Query basis
If startTime and endTime are not sent, the most recent data is returned. Only the data of the latest 30 days is available.
Weight: 1
Request parameters.
Test connectivity to the Rest API and get the current server time.
Weight: 1
Get compressed, aggregate trades. Market trades that fill in 100ms with the same price and the same taking side will have the quantity aggregated.
support querying futures trade histories that are not older than one year
If both startTime
and endTime
are sent, time between startTime
and endTime
must be less than 1 hour.
If fromId
, startTime
, and endTime
are not sent, the most recent aggregate trades will be returned.
Only market trades will be aggregated and returned, which means the insurance fund trades and ADL trades won't be aggregated.
Sending both startTime
/endTime
and fromId
might cause response timeout, please send either fromId
or startTime
/endTime
Weight: 20
Request parameters.
Kline/candlestick bars for a specific contract type. Klines are uniquely identified by their open time.
Contract type: PERPETUAL CURRENT_QUARTER NEXT_QUARTER
1000 | 10
The difference between startTime
and endTime
can only be up to 200 days
Between startTime
and endTime
, the most recent limit
data from endTime
will be returned:
If startTime
and endTime
are not sent, current timestamp will be set as endTime
, and the most recent data will be returned.
If startTime
is sent only, the timestamp of 200 days after startTime
will be set as endTime
(up to the current time)
If endTime
is sent only, the timestamp of 200 days before endTime
will be set as startTime
Weight: based on parameter LIMIT
LIMIT | weight |
---|---|
[1,100) | 1 |
[100, 500) | 2 |
[500, 1000] | 5 |
1000 | 10
Request parameters.
Current exchange trading rules and symbol information
Weight: 1
Get Funding Rate History of Perpetual Futures
empty array will be returned for delivery symbols.
Weight: 1
Request parameters.
Query funding rate info for symbols that had FundingRateCap/ FundingRateFloor / fundingIntervalHours adjustment
Weight: 0
Query index price and mark price
Weight: 10
Request parameters.
Kline/candlestick bars for the index price of a pair. Klines are uniquely identified by their open time.
1000 | 10
The difference between startTime
and endTime
can only be up to 200 days
Between startTime
and endTime
, the most recent limit
data from endTime
will be returned:
If startTime
and endTime
are not sent, current timestamp will be set as endTime
, and the most recent data will be returned.
If startTime
is sent only, the timestamp of 200 days after startTime
will be set as endTime
(up to the current time)
If endTime
is sent only, the timestamp of 200 days before endTime
will be set as startTime
Weight: based on parameter LIMIT
LIMIT | weight |
---|---|
[1,100) | 1 |
[100, 500) | 2 |
[500, 1000] | 5 |
1000 | 10
Request parameters.
Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
1000 | 10
The difference between startTime
and endTime
can only be up to 200 days
Between startTime
and endTime
, the most recent limit
data from endTime
will be returned:
If startTime
and endTime
are not sent, current timestamp will be set as endTime
, and the most recent data will be returned.
If startTime
is sent only, the timestamp of 200 days after startTime
will be set as endTime
(up to the current time)
If endTime
is sent only, the timestamp of 200 days before endTime
will be set as startTime
Weight: based on parameter LIMIT
LIMIT | weight |
---|---|
[1,100) | 1 |
[100, 500) | 2 |
[500, 1000] | 5 |
1000 | 10
Request parameters.
Query symbol Long/Short Ratio
If startTime and endTime are not sent, the most recent data is returned. Only the data of the latest 30 days is available.
Weight: 1
Request parameters.
Kline/candlestick bars for the mark price of a symbol. Klines are uniquely identified by their open time.
1000 | 10
The difference between startTime
and endTime
can only be up to 200 days
Between startTime
and endTime
, the most recent limit
data from endTime
will be returned:
If startTime
and endTime
are not sent, current timestamp will be set as endTime
, and the most recent data will be returned.
If startTime
is sent only, the timestamp of 200 days after startTime
will be set as endTime
(up to the current time)
If endTime
is sent only, the timestamp of 200 days before endTime
will be set as startTime
Weight: based on parameter LIMIT
LIMIT | weight |
---|---|
[1,100) | 1 |
[100, 500) | 2 |
[500, 1000] | 5 |
1000 | 10
Request parameters.
Get older market historical trades.
Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won't be returned.
Weight: 20
Request parameters.
Get present open interest of a specific symbol.
Weight: 1
Request parameters.
Query open interest stats
If startTime and endTime are not sent, the most recent data is returned. Only the data of the latest 30 days is available.
Weight: 1
Request parameters.
Query orderbook on specific symbol
Weight: Adjusted based on the limit:
Limit | Weight |
---|---|
5, 10, 20, 50 | 2 |
100 | 5 |
500 | 10 |
1000 | 20 |
Request parameters.
Premium index kline bars of a symbol. Klines are uniquely identified by their open time.
If startTime and endTime are not sent, the most recent klines are returned.
Weight: based on parameter LIMIT
LIMIT | weight |
---|---|
[1,100) | 1 |
[100, 500) | 2 |
[500, 1000] | 5 |
> 1000 | 10 |
Request parameters.
Query index price constituents
Weight: 1
Request parameters.
Get recent market trades
Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won't be returned.
Weight: 5
Request parameters.
Best price/qty on the order book for a symbol or symbols.
Symbol and pair cannot be sent together If a pair is sent,tickers for all symbols of the pair will be returned If either a pair or symbol is sent, tickers for all symbols of all pairs will be returned
Weight: 2 for a single symbol, 5 when the symbol parameter is omitted
Request parameters.
Latest price for a symbol or symbols.
Symbol and pair cannot be sent together If a pair is sent,tickers for all symbols of the pair will be returned If either a pair or symbol is sent, tickers for all symbols of all pairs will be returned
Weight: 1 for a single symbol, 2 when the symbol parameter is omitted
Request parameters.
Taker Buy Volume: the total volume of buy orders filled by takers within the period. Taker Sell Volume: the total volume of sell orders filled by takers within the period.
If startTime and endTime are not sent, the most recent data is returned. Only the data of the latest 30 days is available.
Weight: 1
Request parameters.
Test connectivity to the Rest API.
Weight: 1
24 hour rolling window price change statistics.
Symbol and pair cannot be sent together If a pair is sent,tickers for all symbols of the pair will be returned If either a pair or symbol is sent, tickers for all symbols of all pairs will be returned
Weight: 1 for a single symbol, 40 when the symbol parameter is omitted Careful when accessing this with no symbol.
Request parameters.
The proportion of net long and net short accounts to total accounts of the top 20% users with the highest margin balance. Each account is counted once only. Long Account % = Accounts of top traders with net long positions / Total accounts of top traders with open positions Short Account % = Accounts of top traders with net short positions / Total accounts of top traders with open positions Long/Short Ratio (Accounts) = Long Account % / Short Account %
If startTime and endTime are not sent, the most recent data is returned. Only the data of the latest 30 days is available.
Weight: 1
Request parameters.
The proportion of net long and net short positions to total open positions of the top 20% users with the highest margin balance. Long Position % = Long positions of top traders / Total open positions of top traders Short Position % = Short positions of top traders / Total open positions of top traders Long/Short Ratio (Positions) = Long Position % / Short Position %
If startTime and endTime are not sent, the most recent data is returned. Only the data of the latest 30 days is available.
Weight: 1
Request parameters.
MarketDataApi - object-oriented interface MarketDataApi