How to know when to make an API call ?

Hello,

I would like to get in my application all the deposit and withdraw.

I’m using the GetFiatDepositWithdrawHistoryAsync method.
I have to call the method a few times, because it’s limited to 90 days.

Of course, after 2 or 3 calls, I get this error :
-1003: Too many requests; current request has limited.

What is the correct way to know how long I have to wait before making the API call ? I’ve read the documentation about limiting, but I didn’t find a way to know the time I have to wait between 2 API calls. And every method has a different weight …

I use C# and Binance dot Net, but the problem should be the same with other languages.

Many thanks in advance,
Julien

The limits section on the API document states:

General Info on Limits

  • The following intervalLetter values for headers:
    • SECOND => S
    • MINUTE => M
    • HOUR => H
    • DAY => D
  • intervalNum describes the amount of the interval. For example, intervalNum 5 with intervalLetter M means “Every 5 minutes”.
  • The /api/v3/exchangeInfo rateLimits array contains objects related to the exchange’s RAW_REQUESTS, REQUEST_WEIGHT, and ORDERS rate limits. These are further defined in the ENUM definitions section under Rate limiters (rateLimitType).

Therefore you need to query exchangeInfo endpoint to know the maximum value for each rate limit and calculate how many requests you can make within defined intervals to skip the error.