API

Documentation

Version 1.0

Rate Limiting

To ensure the stability and availability of our API for all users, AutoTechJobs implements rate limiting on API requests. This page explains how our rate limiting works and how to handle rate limit errors.

Overview

Rate limits are applied on a per-API key basis. Different endpoints may have different rate limits depending on their resource intensity. When you exceed a rate limit, the API will return a 429 Too Many Requests response.

Important: Rate limits may vary based on your subscription plan. Higher tier plans have higher rate limits.

Rate Limit Headers

All API responses include headers that provide information about your current rate limit status:

HeaderDescription
X-RateLimit-LimitThe maximum number of requests you're permitted to make per hour
X-RateLimit-RemainingThe number of requests remaining in the current rate limit window
X-RateLimit-ResetThe time at which the current rate limit window resets in UTC epoch seconds

Example Headers

HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
X-RateLimit-Reset: 1617724800

Rate Limit Tiers

Rate limits vary based on your subscription plan. Here are the default rate limits for each plan:

PlanRate Limit (requests per hour)Burst Limit (requests per minute)
Free1,00060
Basic5,000120
Professional10,000300
EnterpriseCustomCustom

Some endpoints may have different rate limits due to their resource intensity. For example, search endpoints may have lower limits to prevent excessive load on our search infrastructure.

Handling Rate Limits

When you exceed a rate limit, the API will return a 429 Too Many Requests response with a JSON error body. The response will also include the rate limit headers mentioned above, which tell you when the rate limit will reset.

Example Rate Limit Response

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1617724800

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Please try again after 2025-04-10T21:00:00Z",
    "documentation_url": "https://api.autotechjobs.co.uk/docs/api/rate-limiting"
  }
}

Best Practices for Handling Rate Limits

  • Implement exponential backoff: When you receive a rate limit error, wait before retrying. Use an exponential backoff strategy to gradually increase the wait time between retries.
  • Monitor your usage: Keep track of the rate limit headers in API responses to monitor your usage and avoid hitting limits.
  • Cache responses: Cache API responses where appropriate to reduce the number of requests you need to make.
  • Batch requests: Where possible, batch multiple operations into a single API request.
  • Distribute requests evenly: Instead of making many requests at once, distribute them evenly over time.

Code Examples

Handling Rate Limits with Exponential Backoff (JavaScript)

async function fetchWithRetry(url, options = {}, maxRetries = 5) {
  let retries = 0;
  
  while (retries < maxRetries) {
    try {
      const response = await fetch(url, options);
      
      // Check if rate limited
      if (response.status === 429) {
        const resetTime = response.headers.get('X-RateLimit-Reset');
        const waitTime = resetTime ? (new Date(resetTime * 1000) - new Date()) : (1000 * Math.pow(2, retries));
        
        console.log(`Rate limited. Waiting ${waitTime/1000} seconds before retry.`);
        await new Promise(resolve => setTimeout(resolve, waitTime));
        retries++;
        continue;
      }
      
      return response;
    } catch (error) {
      const waitTime = 1000 * Math.pow(2, retries);
      console.log(`Error: ${error.message}. Retrying in ${waitTime/1000} seconds.`);
      await new Promise(resolve => setTimeout(resolve, waitTime));
      retries++;
      
      if (retries >= maxRetries) {
        throw new Error(`Maximum retries (${maxRetries}) exceeded.`);
      }
    }
  }
}

Increasing Your Rate Limits

If you find that the default rate limits are not sufficient for your use case, you have several options:

  • Upgrade your plan: Higher tier plans come with higher rate limits. Visit our pricing page to learn more about our plans.
  • Contact us: If you have specific needs that aren't covered by our standard plans, please contact us to discuss custom rate limits.
  • Optimize your API usage: Review our best practices to ensure you're using the API efficiently.