General API Question:

In the docs, I read under the hard limits section that the Binance API has a “1,200 request weight per minute (keep in mind that this is not necessarily the same as 1,200 requests)” as well as 20 per second.

Does this mean that if I am looking for price data I can only request 1,200 lines of data per minute (1,200 bars on a single timeframe / currency pair), or is this how many times I can request this data within a second / minute? Any help would be greatly appreciated!!!

Does this mean that if I am looking for price data I can only request 1,200 lines of data per minute (1,200 bars on a single timeframe / currency pair), or is this how many times I can request this data within a second / minute?

No, this is incorrect. Each endpoint of the Binance Exchange APIs has a weight attribute, ex: /api/v3/klines (Binance API Documentation) has a weight of 1 per request. The client is allowed to send 1200 (formula: floor(1200/weight)) kline requests per minute to the API.

The second limit then constrains the client from sending more than 20 requests per second, irrespective of the weight of the endpoint. Therefore, the client is now allowed to consume all 1200 weight, via the kline endpoint, within a second.

So I did some more reading of the Binance Docs, if I wanted historical price data for a pair, how far back can I download price data from? Can I get minute chart data all the way back to 2017 etc? I saw you as well as the docs recommend Kline/Candlestick Streams from the websocket to get price data. Is this a good way to get somewhat live data every minute for example? Is it also possible to only request the last minute of data at a certain time? Finally, when calling the websocket for kline price data, is there still call limits per minute for example?

Sorry for all of these questions, I did my best to read the docs just want some better understanding.

if I wanted historical price data for a pair, how far back can I download price data from? Can I get minute chart data all the way back to 2017 etc?

You can obtain all historical kline information since the start of listing.

Is this a good way to get somewhat live data every minute for example?

The websocket API is intended to stay up-to-date with live changes, while the REST API is intended to fetch the initial state or patch historical data.

Is it also possible to only request the last minute of data at a certain time?

Not via the websocket API. The websocket is a push only interface.

Finally, when calling the websocket for kline price data, is there still call limits per minute for example?

There are no call limits. There is also no limit on the number of open connections a client may have, however each connection is limited to 1024 streams.

1 Like