Rate limits
The Product Hunt API enforces rate limits to ensure fair use and platform stability. Rate limit information is included in the response headers of every API request.
Understanding rate limits
Rate limits control how many API requests you can make in a given time period. The Product Hunt API uses a fair-use policy to prevent abuse while allowing legitimate applications to function normally.
Rate limit information is provided in the HTTP response headers of every API request. You can check these headers to understand your current usage and remaining quota.
Response headers
Every API response includes rate limit headers that show your current usage:
| Header | Description |
|---|---|
RateLimit-Limit | The maximum number of requests allowed in the current time window |
RateLimit-Remaining | The number of requests remaining in the current time window |
RateLimit-Reset | The Unix timestamp when the rate limit window resets |
Example response headers:
RateLimit-Limit: 1000
RateLimit-Remaining: 999
RateLimit-Reset: 1234567890
Handling rate limits
When you reach your rate limit, the API returns a 429 Too Many Requests response. At this point, you should stop making requests and wait until the rate limit window resets.
To handle rate limits gracefully in your application:
- Check the headers - Before making requests, check the
RateLimit-Remainingheader to see if you have quota available. - Implement backoff - If you receive a
429response, wait until theRateLimit-Resettime before retrying. - Batch requests - Combine multiple queries into a single GraphQL request to reduce the number of API calls.
# Example: Checking rate limit headers with curl
curl -i https://api.producthunt.com/v2/api/graphql \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"query": "{ viewer { id } }"}'
# Response includes:
# RateLimit-Limit: 1000
# RateLimit-Remaining: 999
# RateLimit-Reset: 1234567890
Best practices
Batch your queries - Use GraphQL's ability to request multiple resources in a single query. This reduces the number of API calls and helps you stay within rate limits.
Cache results - Cache API responses locally to avoid making redundant requests for the same data.
Implement exponential backoff - If you receive a rate limit error, wait before retrying. Start with a short wait time and increase it exponentially with each retry.
Monitor your usage - Keep track of your API usage and adjust your application's behavior if you're approaching the rate limit.
GraphQL allows you to request exactly the data you need in a single query. Use this to your advantage to minimize the number of API calls your application makes.
Increasing your rate limit
By default, the Product Hunt API applies fair-use rate limits to all applications. If your application requires faster access without rate limits, contact hello@producthunt.com with details about your use case.
Attempting to circumvent rate limits through multiple accounts or other means may result in your application being blocked from the API.
See also
- API overview, introduction to the Product Hunt API
- Authentication, how to authenticate with the API