Skip to main content

Overview

DeepRecall enforces rate limits to ensure fair usage and maintain service quality for all users. Rate limits are applied per API key.

Standard Rate Limits

All API keys have the following rate limits:

Standard Limits

  • 60 requests per minute
  • 1,000 requests per hour
  • 10,000 requests per day
  • 50,000 requests per month
Contact us for custom quotas:

How Rate Limits Work

Rate limits are enforced using a sliding window algorithm:
  1. Per-Minute Limit - Maximum requests in any 60-second window
  2. Per-Hour Limit - Maximum requests in any 60-minute window
  3. Per-Day Limit - Maximum requests in any 24-hour window
  4. Monthly Quota - Total requests allowed per calendar month
All time windows are calculated using a sliding window, not fixed periods. This prevents burst traffic at period boundaries.

Checking Your Rate Limit Status

Every API response includes rate limit information:
Response Headers (Coming Soon)
X-RateLimit-Limit-Minute: 60
X-RateLimit-Remaining-Minute: 45
X-RateLimit-Reset-Minute: 1640000000

X-RateLimit-Limit-Hour: 1000
X-RateLimit-Remaining-Hour: 850

X-RateLimit-Limit-Day: 10000
X-RateLimit-Remaining-Day: 7200

Response Body

{
  "success": true,
  "data": [...],
  "rate_limit": {
    "limits": {
      "per_minute": 60,
      "per_hour": 1000,
      "per_day": 10000
    },
    "remaining_credits": 49500,
    "monthly_quota": 50000,
    "monthly_usage": 500
  }
}

Rate Limit Exceeded

When you exceed a rate limit, you’ll receive a 429 Too Many Requests response:
{
  "detail": {
    "error": "rate_limit_exceeded",
    "message": "Rate limit exceeded: 60 requests per minute",
    "details": {
      "limit_type": "minute",
      "limit": 60,
      "reset_at": "2025-12-19T17:45:30Z"
    },
    "help": "You've exceeded your rate limit. Wait for the limit to reset..."
  }
}

What To Do

1

Wait

Wait until the reset_at time before making more requests
2

Implement Retry Logic

Use exponential backoff to retry failed requests
3

Optimize Requests

Use pagination and filtering to reduce API calls
4

Request Higher Limits

If you consistently hit limits, contact us for custom quotas

Best Practices

1. Implement Exponential Backoff

import time
import requests

def make_request_with_retry(url, headers, max_retries=3):
    for attempt in range(max_retries):
        response = requests.get(url, headers=headers)
        
        if response.status_code == 429:
            # Rate limit hit - wait before retry
            wait_time = (2 ** attempt) + random.random()
            print(f"Rate limited. Waiting {wait_time:.2f}s...")
            time.sleep(wait_time)
            continue
        
        return response
    
    raise Exception("Max retries exceeded")

2. Cache Responses

Cache API responses to reduce redundant requests:
from functools import lru_cache
import requests

@lru_cache(maxsize=100)
def get_recalls(data_source, hours_ago):
    response = requests.get(
        f"https://api.deeprecall.io/v1/recalls/feed",
        headers={"X-API-Key": api_key},
        params={"data_sources": data_source, "hours_ago": hours_ago}
    )
    return response.json()

3. Use Pagination Efficiently

Request only the data you need:
# Good - Request exactly what you need
response = requests.get(
    "https://api.deeprecall.io/v1/recalls/feed",
    headers=headers,
    params={"limit": 10}  # Small limit for testing
)

# Better - Use cursor pagination for large datasets
cursor = None
while True:
    params = {"limit": 100}
    if cursor:
        params["cursor"] = cursor
    
    response = requests.get(url, headers=headers, params=params)
    data = response.json()
    
    # Process data...
    
    if not data['pagination']['has_more']:
        break
    
    cursor = data['pagination']['next_cursor']

4. Monitor Usage

Track your usage to avoid unexpected limit hits:
def check_remaining_quota(response):
    rate_limit = response.json().get('rate_limit', {})
    
    remaining = rate_limit.get('remaining_credits', 0)
    quota = rate_limit.get('monthly_quota', 0)
    
    usage_percent = ((quota - remaining) / quota) * 100
    
    if usage_percent > 90:
        print(f"⚠️  Warning: {usage_percent:.1f}% of monthly quota used!")
    
    return remaining

5. Optimize Filters

Use specific filters to get only the data you need:
# Instead of this (returns ALL sources)
curl "https://api.deeprecall.io/v1/recalls/feed"

# Do this (returns only what you need)
curl "https://api.deeprecall.io/v1/recalls/feed?data_sources=us_cpsc&hours_ago=24"

Monthly Quota Reset

Monthly quotas reset on the 1st day of each month at 00:00 UTC.
Unused quota does not roll over to the next month.

Monitoring Your Usage

API Response

Every API response includes usage information in the rate_limit field:
{
  "rate_limit": {
    "limits": {
      "per_minute": 60,
      "per_hour": 1000,
      "per_day": 10000
    },
    "remaining_credits": 49500,
    "monthly_quota": 50000,
    "monthly_usage": 500
  }
}
Monitor these fields to track your usage:
  • monthly_usage - API calls made this month
  • remaining_credits - Credits remaining in quota
  • monthly_quota - Your total monthly allocation

Usage Reports

Get detailed usage reports and monitoring:

Need Higher Limits?

Contact us to discuss custom rate limits for your use case:
Request custom rate limits and quotas:

FAQ

No. Only successful requests (status codes 200-299) count against your quota. Rate limit errors (429) and auth errors (401, 403) do not count.
Yes. Contact support if you have a legitimate temporary need (e.g., data migration, backfill). We can grant temporary increases on a case-by-case basis.
Your API calls will return 429 Too Many Requests until:
  • Your quota resets (next month)
  • You contact us to request additional quota
  • You purchase additional quota (enterprise plans only)
No. The /health endpoint is public and has no rate limits. It’s designed for monitoring services.
Each API key inherits the limits from your account plan. All keys under the same account share the same monthly quota.

Need Help?

For rate limit questions or custom limits: