how to query current api limit usage by using binance-connector-python

Hi,

Is there an API to call to get current API usage limit? Seems I could not find any information from google. Is it assumed that it is developer’s responsibility to count the API limit usage?

Thanks.

Hi, there is no endpoint to query the IP usages, however the value is returned from each response. If you check the headers from the response, there are a few metrics showing the values.

In the library, you can display the value by setting:


from binance.spot import Spot as Client

client = Client(show_limit_usage=True)
print(client.time())

1 Like

thanks!

ExchangeInfo → rateLimits

[
  {
    "rateLimitType": "REQUEST_WEIGHT",
    "interval": "MINUTE",
    "intervalNum": 1,
    "limit": 2400
  },
  {
    "rateLimitType": "ORDERS",
    "interval": "MINUTE",
    "intervalNum": 1,
    "limit": 1200
  },
  {
    "rateLimitType": "ORDERS",
    "interval": "SECOND",
    "intervalNum": 10,
    "limit": 300
  }
]
1 Like