HERE Maps Routing: HTTP 429 Too many requests error

1.9k Views Asked by At

I have a python web app which uses the HERE Maps Routing API (V8) to get approx. 10-20 routes in one go. Periodically, I get a HTTP 429 response saying "Too Many Requests: Rate limit for this service has been reached". The requests to the API are called asynchronously, but I've set a rate limit of 10 requests per second as per the Freemium Plan Limits (https://developer.here.com/pricing#plan-details).

Is anyone able to confirm what the rate limit actually is, or how this error can be avoided?

Thanks!

1

There are 1 best solutions below

0
On

When using location features provided with HERE REST APIs you should optimize your application for rate limiting. Based on your plan and the services you use; the rate of API requests your client makes may be limited when service utilization is high.

How do I know if my requests will be limited?

  • While this depends on your plan and the services you use, it is best to ensure your application is optimized in any case to handle rate limiting when it occurs.

What happens when rate limiting occurs?

  • When a request is rate limited, the response status code will be HTTP 429 Too Many Requests

Suggested optimization approach: exponential back-off

While there are different approaches to optimize for rate limiting, we suggest utilizing an exponential back-off algorithm as it is a common and straightforward method. The specific implementation will depend on your application. Here is a summary of this approach:

  • Check for HTTP 429 response status codes as you send requests to the service.
  • When receiving a HTTP 429 status, wait for a set time (one second is typical) before making the next request.
  • Resume sending requests. If rate limiting occurs again, back-off by increasing the wait time by some factor.
  • Increase the back-off time factor exponentially, until requests are no longer rate limited.