Respecting Rate Limits
Wait and retry using response headers
When you call the HelloData API, every response includes rate limit headers.
To avoid hitting the limiter (or to recover quickly when you do), read the RateLimit header and wait the number of seconds specified by its t parameter before retrying.
Which header to use
We use the IETF RateLimit header format.
RateLimit: includes remaining requests (r) and seconds until reset (t)RateLimit-Policy: describes the policy (quotaqand windoww)
Example RateLimit header:
In that example, you should wait 12 seconds before retrying.
Python example
This example retries a request when it receives a 429 Too Many Requests, waiting t seconds from the RateLimit header before retrying.
TypeScript example
This example does the same thing using fetch (Node 18+).
Notes and best practices
- Proactively slow down when
ris low: if you’re nearr=0, add a small delay between requests. - Prefer concurrency limits over retries: cap parallel requests (e.g. with a semaphore / queue) so you don’t burst over the minute window.
- Always handle missing headers: use a small exponential backoff fallback if
RateLimitisn’t present for some reason.