Back to Home
GLOOOP
API Docs

Rate Limiting

Understand how rate limiting works in the Glooop API and how to handle rate limit errors in your application.

How It Works

The Glooop API uses a sliding window rate limiter to prevent abuse and ensure fair usage for all developers. Rate limits are applied per API key and reset every minute.

Example: If you have a FREE tier key (100 requests/minute) and make 50 requests at 12:00:00, you still have 50 requests remaining until 12:01:00. At 12:01:00, your limit resets to 100 requests again.

Rate Limit Tiers

TierRequests/MinutePriceUse Case
FREE100FreePersonal projects, testing, prototyping
DEVELOPER500$29/monthSmall apps, MVPs, low-traffic sites
BUSINESS2,000$99/monthProduction apps, medium traffic
ENTERPRISE10,000CustomHigh-volume integrations, enterprise apps

Rate Limit Headers

Every API response includes headers that tell you about your current rate limit status:

X-RateLimit-Limit

The maximum number of requests allowed per minute for your tier.

Example: 100

X-RateLimit-Remaining

The number of requests you have left in the current window.

Example: 95

X-RateLimit-Reset

Unix timestamp when the rate limit window resets.

Example: 1640000000

Example Response Headers

HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640000060

Handling Rate Limit Errors

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

Error Response

{
  "success": false,
  "message": "Rate limit exceeded. Limit: 100 requests per minute.",
  "statusCode": 429
}

JavaScript Example (with Retry Logic)

async function makeApiRequest(url, apiKey) {
  const response = await fetch(url, {
    headers: { 'X-API-Key': apiKey }
  });

  if (response.status === 429) {
    const resetTime = parseInt(response.headers.get('X-RateLimit-Reset'));
    const now = Math.floor(Date.now() / 1000);
    const waitTime = (resetTime - now) * 1000;

    console.log(`Rate limited. Waiting ${waitTime}ms...`);
    await new Promise(resolve => setTimeout(resolve, waitTime));

    // Retry the request
    return makeApiRequest(url, apiKey);
  }

  return response.json();
}

Python Example (with Retry Logic)

import requests
import time

def make_api_request(url, api_key):
    headers = {'X-API-Key': api_key}
    response = requests.get(url, headers=headers)

    if response.status_code == 429:
        reset_time = int(response.headers.get('X-RateLimit-Reset'))
        wait_time = reset_time - int(time.time())

        print(f'Rate limited. Waiting {wait_time} seconds...')
        time.sleep(wait_time)

        # Retry the request
        return make_api_request(url, api_key)

    return response.json()

Best Practices

Monitor Rate Limit Headers

Always check X-RateLimit-Remaining to know how many requests you have left. Proactively slow down as you approach your limit.

Implement Exponential Backoff

When you receive a 429 error, wait before retrying. Increase the wait time exponentially if you continue to get rate limited.

Cache Responses

Cache API responses when possible to reduce the number of requests. For example, cache deal listings for 5-10 minutes.

Use Pagination Wisely

Instead of fetching all data at once, use pagination to spread requests over time. Fetch only what you need, when you need it.

Upgrade When Needed

If you consistently hit rate limits, consider upgrading to a higher tier. Monitor your usage in the dashboard to understand your needs.

Need Higher Limits?

Upgrade your API key tier to get higher rate limits and support for production workloads.

Upgrade Your Tier