Skip to main content

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​

TierAPI AccessRate Limit
Demo Access❌ Not AvailableN/A
Free Account❌ Not AvailableN/A
Pro Account✅ Full Access10k calls/day
Enterprise✅ Full Access100k 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:

HeaderDescription
X-RateLimit-LimitTotal requests allowed in the current window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix 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-Remaining to 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