It is frustrating enough when there is a rate limit set, but, I totally understand the purpose of it. There are some one who is enjoying doing not-good things.

Well, it is workable when there is an actual rule about the rate limit, what Bunq said was "3 requests per 3 seconds". Math has never been my strong point, but I take this as "You cannot make more than 3 requests in every 3 seconds", which means "It is OK to make 1 request in every 1 second".

I though, let's make it safer, how about "1 request in every 2 seconds".

So I did this:

Every time before I make a request I check the last request time, if it has been 2 seconds later, then do it. Otherwise wait for some ms until 2 seconds is there.

Well, somehow Bunq disagreed with me. Bunq said the way I undestood "3 requests in 3 seconds" is totally wrong because I've got this:

I know my Math is not good but can anyone teach me "how is 1 request per 2 seconds exceeding 3 requests per 3 seconds"? Or there is another way to understand "3 requests in 3 seconds"?

Any help would be appreciated. Thanks everyone.

    10 days later

    Most API endpoints seem to have a built-in delay that prevents you from speeding. For example, you can get 200 transactions from the payments endpoint, but that typically takes 2-3 seconds. I've been running Python code for years and normal usage never triggers the rate limit.

    Trying to predict the rate limit might be harder then it seems. There is always network latency. For example you could send five requests over 10 seconds and they can all hit bunq at the same time.

    Why not build a retry in your code that waits 5 seconds whenever you get the rate limit exception?

      Write a Reply...