Shipment Tracking Unified API

I'm receiving a 429 error of "Too many requests", but I'm complying with the quota limit per day and spike arrest per second, what is wrong?

Created by: Jhonathan Ibanez

Modified on: Wed, 13 Dec, 2023 at 4:21 PM

Even though there is a spike arrest limit per second, this is further divided into millisecond intervals that you must consider when programming your calls to avoid 429 errors.

As a general rule, if a spike arrest with a quota of X calls per second, the system will convert the second to milliseconds and divide it by the number of calls per second restriction; then, only one call will be able to happen inside the interval of the resulting millisecond-interval.

For example, for a quota of 5,000 calls per day, with a spike arrest of 4 calls per second:
1 second = 1,000 milliseconds
1,000 milliseconds are divided into four intervals = resulting in four intervals of 250 milliseconds
Only one call can be triggered every 250 milliseconds

If the user tries to do two calls inside one of the 250-millisecond intervals, it will trigger a 429 error.
If the user does one call in the first interval, one call in the second interval, one call in the third interval, and two calls in the fourth interval, the last fifth call will result in a 429 error as a total of 5 calls were attempted in a period of 1 second.
J
Jhonathan is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.