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.
We use the IETF RateLimit header format.
RateLimit: includes remaining requests (r) and seconds until reset (t)RateLimit-Policy: describes the policy (quota q and window w)Example RateLimit header:
In that example, you should wait 12 seconds before retrying.
This example retries a request when it receives a 429 Too Many Requests, waiting t seconds from the RateLimit header before retrying.
This example does the same thing using fetch (Node 18+).
r is low: if you’re near r=0, add a small delay between requests.RateLimit isn’t present for some reason.