Rate Limits & Tiers
The Blocklens API uses rate limiting to ensure fair usage and high availability for all users. Rate limits are applied based on your subscription tier.
Subscription Tiers & API Access
| Tier | API Access | Rate Limit |
|---|---|---|
| Demo Access | ❌ Not Available | N/A |
| Free Account | ❌ Not Available | N/A |
| Pro Account | ✅ Full Access | 10k calls/day |
| Enterprise | ✅ Full Access | 100k calls/day |
Custom Limits
Custom rate limits are available for Enterprise clients with specific needs. Please contact us to discuss your requirements.
Hourly Breakdown
Rate limits are enforced on an hourly basis. The approximate hourly limits are:
- Pro Account: ~416 requests/hour
- Enterprise: ~4,166 requests/hour
How Rate Limiting Works
Rate limits are applied on a per-API-key basis. Each API key has its own independent counter. If you exceed the rate limit for your key, you will receive a 429 Too Many Requests HTTP status code.
Rate Limit Headers
Every API response includes headers to help you track your usage:
| Header | Description |
|---|---|
X-RateLimit-Limit | Total requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the current window resets |
Handling Rate Limits
import requests
import time
response = requests.get(
"https://api.blocklens.co/v1/prices",
headers={"X-API-Key": "your-api-key"}
)
if response.status_code == 429:
# Rate limited - wait and retry
reset_time = int(response.headers.get("X-RateLimit-Reset", 0))
wait_seconds = max(1, reset_time - int(time.time()))
print(f"Rate limited. Waiting {wait_seconds}s...")
time.sleep(wait_seconds)
Best Practices
- Monitor headers: Check
X-RateLimit-Remainingto proactively throttle requests - Implement backoff: Use exponential backoff when hitting rate limits
- Cache responses: Cache data that doesn't change frequently to reduce API calls
- Use date ranges: Request specific date ranges instead of maximum limits to reduce load