Skip to main content

Rate Limit Overview

  • Limit: 1000 requests per hour per API key
  • Window: Rolling 1-hour window
  • Scope: Applied per API key across all endpoints
Rate limits are applied per API key, so each key gets its own 1000 requests per hour allocation.

Rate Limit Headers

Every API response includes rate limit information in the response headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

Header Descriptions

X-RateLimit-Limit
integer
required
Maximum number of requests allowed per hour
X-RateLimit-Remaining
integer
required
Number of requests remaining in the current hour
X-RateLimit-Reset
integer
required
Unix timestamp when the rate limit resets

Rate Limit Exceeded Response

When you exceed the rate limit, you’ll receive a 429 status code with an error response:
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests"
  }
}

Best Practices

Implement Exponential Backoff

When you receive a 429 response, implement exponential backoff to retry your requests:
async function apiCallWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    try {
      const response = await fetch(url, options);
      
      if (response.status === 429) {
        // Rate limit exceeded, wait and retry
        const retryAfter = response.headers.get('Retry-After') || Math.pow(2, attempt);
        await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
        continue;
      }
      
      return response;
    } catch (error) {
      if (attempt === maxRetries - 1) throw error;
      await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 1000));
    }
  }
}

Monitor Your Usage

Track your API usage to avoid hitting rate limits:
class RateLimitMonitor {
  constructor() {
    this.requests = [];
    this.hourlyLimit = 1000;
  }
  
  canMakeRequest() {
    const now = Date.now();
    const oneHourAgo = now - (60 * 60 * 1000);
    
    // Remove requests older than 1 hour
    this.requests = this.requests.filter(timestamp => timestamp > oneHourAgo);
    
    return this.requests.length < this.hourlyLimit;
  }
  
  recordRequest() {
    this.requests.push(Date.now());
  }
  
  getRemainingRequests() {
    return Math.max(0, this.hourlyLimit - this.requests.length);
  }
}

Batch Operations

When possible, batch multiple operations to reduce the number of API calls:
Instead of making individual API calls for each vehicle, consider batching operations or using bulk endpoints when available.

Request Optimization Tips

Cache Responses

Cache frequently accessed data like location information:
class LocationCache {
  constructor(ttl = 300000) { // 5 minutes
    this.cache = new Map();
    this.ttl = ttl;
  }
  
  get(locationId) {
    const cached = this.cache.get(locationId);
    if (cached && Date.now() - cached.timestamp < this.ttl) {
      return cached.data;
    }
    return null;
  }
  
  set(locationId, data) {
    this.cache.set(locationId, {
      data,
      timestamp: Date.now()
    });
  }
}

Use Appropriate Endpoints

Choose the most efficient endpoint for your use case:
  • Use filtering parameters to reduce data transfer
  • Use specific endpoints instead of general ones when possible
  • Consider pagination for large datasets

Rate Limit Increase

If you need a higher rate limit for your use case, contact [email protected] with:
  • Your current usage patterns
  • Expected request volume
  • Business justification for the increase
Rate limit increases are evaluated on a case-by-case basis and may require a different pricing tier.

Monitoring and Alerts

Set up monitoring to track your API usage:
Monitor your API usage with:
  • Track requests per hour
  • Set up alerts when approaching limits
  • Monitor error rates and retry patterns
  • Log rate limit headers for analysis
Implement proper error handling for:
  • 429 rate limit responses
  • Network timeouts
  • Temporary service unavailability
  • Invalid responses