Overview
The High IQ API enforces rate limiting to protect against abuse and ensure fair usage across all clients. Rate limits are applied per-IP address, with different tiers for different operation types. Rate limiting is disabled in development mode and onlocalhost to allow unrestricted local testing.
Rate Limit Tiers
The API provides six pre-configured rate limit tiers, each designed for a specific class of operations:| Tier | Limit | Window | Use Case |
|---|---|---|---|
| Lenient | 300 requests | 1 minute | Read operations (strain data, search) |
| Moderate | 60 requests | 1 minute | Standard API operations |
| Strict | 10 requests | 1 minute | AI/expensive operations (recommendations) |
| Report | 5 requests | 1 hour | Report generation |
| Parse | 20 requests | 1 hour | Receipt/order parsing |
| Scanner | 10 requests | 10 minutes | Label scanning |
Tier Selection by Endpoint
- Lenient (300/min)
- Strict (10/min)
- Scanner (10/10min)
- Report (5/hr)
- Parse (20/hr)
Read-heavy endpoints that serve cached data:
GET /strains- Strain catalogGET /strains/search- Strain searchGET /strains/popular- Popular strainsGET /strains/slug/:slug- Strain detailGET /strains/slug/:slug/complete- Full strain dataGET /strains/by-terpene/:terpene- Terpene filteringGET /strains/by-type/:type- Type filtering
Rate Limit Headers
Every response includes rate limit headers so clients can track their current usage:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | ISO 8601 timestamp when the window resets |
429 Too Many Requests
When a rate limit is exceeded, the API returns a429 status code with a Retry-After header indicating how many seconds to wait:
Handling 429 Responses
Implement exponential backoff or respect theRetry-After header:
Rate Limit Key Generation
Rate limits are keyed based on request identity, falling back through several sources:| Client Type | Rate Limit Key |
|---|---|
| Identified request | User ID from context (if available) |
| Standard request | X-Forwarded-For IP address |
| No identifier | Fallback to "anonymous" (shared pool) |
API Key Rate Limiting
For external integrations using API keys, a configurable per-key rate limiter is available:Development Mode
Rate limiting is completely disabled when any of these conditions are true:NODE_ENV=development- Request host contains
localhost - Request host contains
127.0.0.1
Best Practices
Cache Responses
Cache API responses client-side to reduce unnecessary requests. Most strain data changes infrequently.
Respect Retry-After
Always check the
Retry-After header before retrying. Do not retry immediately.Use Bulk Endpoints
Prefer batch endpoints (like
/reports/stream/batch) over making many individual requests.Monitor Headers
Track
X-RateLimit-Remaining proactively and slow down requests before hitting the limit.