Skip to main content
The Pear API enforces rate limits to ensure fair usage and maintain performance for all users. Limits are applied per API key on a per-minute rolling window.

Rate limits by plan

PlanRequests per minuteBest for
Free60Prototyping and personal projects
Pro600Production applications
Enterprise6,000High-frequency data pipelines

Response headers

Every API response includes rate limit headers so you can monitor your usage in real time:
HeaderDescriptionExample
X-RateLimit-LimitYour maximum requests per minute.600
X-RateLimit-RemainingRequests remaining in the current window.542
X-RateLimit-ResetUnix timestamp (seconds) when the window resets.1705500060
Example response headers:
HTTP/1.1 200 OK
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 542
X-RateLimit-Reset: 1705500060
Content-Type: application/json

Handling 429 responses

When you exceed your rate limit, the API returns a 429 Too Many Requests status:
{
  "error": "rate_limited",
  "message": "Rate limit exceeded. Please wait before making another request."
}
The response still includes the rate limit headers. Use X-RateLimit-Reset to determine when you can resume making requests.

Retry with backoff

Here is how to handle rate limiting gracefully:
import requests
import time

def api_request(url, headers, params=None):
    while True:
        response = requests.get(url, headers=headers, params=params)

        if response.status_code == 429:
            reset_time = int(response.headers.get("X-RateLimit-Reset", 0))
            wait_seconds = max(reset_time - int(time.time()), 1)
            print(f"Rate limited. Waiting {wait_seconds}s...")
            time.sleep(wait_seconds)
            continue

        response.raise_for_status()
        return response.json()

Checking your rate limit status

Use the dedicated endpoint to check your current rate limit without consuming meaningful quota:
curl "http://localhost:8000/api/users/me/rate-limit" \
  -H "Authorization: Bearer mk_live_..."
{
  "plan": "pro",
  "limit": 600,
  "remaining": 542,
  "reset": 1705500060,
  "window": "1m"
}

Best practices

When paginating, use limit=200 (the maximum) to fetch more data per request. One request returning 200 items is much more efficient than four requests returning 50 each.
Market data changes frequently, but event metadata and categories are relatively stable. Cache these responses to avoid unnecessary API calls.
Instead of fetching all markets and filtering client-side, use query parameters (venue, status, min_volume, category) to get exactly what you need.
Check the X-RateLimit-Remaining header after each response. If it is getting low, slow down your request rate proactively rather than waiting for a 429.
If you need to make many requests, spread them evenly across the minute window rather than sending them all at once.

Monitoring usage

Track your API usage over time with the usage statistics endpoint:
curl "http://localhost:8000/api/users/me/usage?days=7" \
  -H "Authorization: Bearer mk_live_..."
This shows total requests, per-endpoint breakdown, and daily trends — useful for understanding your consumption patterns and planning capacity.