WikiRest Docs

Rate Limiting

Understand how rate limits protect the API from burst traffic and how to handle them in your application.

Rate Limiting vs Monthly Quota: These are separate concepts. Rate limiting controls how fast you can make requests (per minute). Monthly quotas control how many total requests you can make per month.

What is Rate Limiting?

Rate limiting restricts the number of requests you can make within a short time window (typically per minute). This prevents any single user from overwhelming the API with too many requests at once.

Rate Limits by Plan

All rate limits are configurable based on your subscription plan. Higher-tier plans receive higher limits to support production workloads.

Plan Rate Limit Monthly Quota
Free 10 req/sec 5,000/month
Starter ($29/mo) 25 req/sec 50,000/month
Growth ($99/mo) 50 req/sec 250,000/month
Business ($299/mo) 100 req/sec 1,000,000/month
Enterprise Custom Unlimited

Need higher limits? All rate limits scale with your plan. Growth at $99/mo gives you 50 req/sec, or upgrade to Business for 100 req/sec with 99.5% SLA. View all plans →

Rate Limit Headers

Every API response includes headers showing your current rate limit status:

Header Description
X-RateLimit-Limit Maximum requests allowed per minute
X-RateLimit-Remaining Requests remaining in current minute window
X-RateLimit-Reset Unix timestamp when the rate limit window resets

Example Response Headers

HTTP/1.1 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1704153660
Content-Type: application/json

When Rate Limits Are Exceeded

When you exceed your per-minute rate limit, the API returns a 429 Too Many Requests response:

HTTP/1.1 429 Too Many Requests
Retry-After: 45
Content-Type: application/json

{
  "error": "rate_limit_exceeded",
  "message": "Too many requests. Please slow down.",
  "retry_after": 45
}

The Retry-After header indicates how many seconds to wait before making another request.

Handling Rate Limits

1. Respect the Retry-After Header

When you receive a 429, wait for the specified time before retrying:

import time
import requests

def make_request(url, headers):
    response = requests.get(url, headers=headers)

    if response.status_code == 429:
        retry_after = int(response.headers.get("Retry-After", 60))
        print(f"Rate limited. Waiting {retry_after}s...")
        time.sleep(retry_after)
        return make_request(url, headers)  # Retry

    return response

2. Implement Exponential Backoff

For robust handling, use exponential backoff:

import time

def make_request_with_backoff(url, headers, max_retries=5):
    for attempt in range(max_retries):
        response = requests.get(url, headers=headers)

        if response.status_code != 429:
            return response

        # Exponential backoff: 1s, 2s, 4s, 8s, 16s
        wait_time = min(2 ** attempt, 60)
        print(f"Rate limited. Retry {attempt + 1}/{max_retries} in {wait_time}s")
        time.sleep(wait_time)

    raise Exception("Max retries exceeded")

3. Spread Out Requests

If you need to make many requests, spread them out over time:

import time

def batch_requests(urls, headers, delay=0.5):
    """Make requests with a delay between each."""
    results = []
    for url in urls:
        response = requests.get(url, headers=headers)
        results.append(response.json())
        time.sleep(delay)  # Wait 500ms between requests
    return results

Rate Limiting vs Monthly Quota

Aspect Rate Limiting Monthly Quota
Purpose Prevent burst traffic Control total usage
Time window Per second Per month
Resets Every second Billing cycle
Error code 429 with short Retry-After 429 with long Retry-After
Solution Slow down requests Wait or upgrade

Learn more about monthly quotas →

Tips for Staying Within Limits

  • Cache responses: Wikipedia content doesn't change often. Cache results locally.
  • Batch requests: Use limit=50 instead of making 5 requests with limit=10.
  • Use webhooks: For the /changes endpoint, poll periodically instead of continuously.
  • Monitor headers: Track X-RateLimit-Remaining to adjust your request rate.

Need Higher Rate Limits?

All rate limits are adjustable based on your plan. Choose the tier that matches your application's needs:

Free

10 req/sec

Perfect for testing and personal projects.

Starter $29

25 req/sec

For small projects and MVPs.

Popular

Growth $99

50 req/sec

5x higher limits for growing apps.

View pricing →

Business $299

100 req/sec

Production workloads with 99.5% SLA.

View pricing →

Was this page helpful?

Help us improve our documentation