Rate Limiting

Overview

To ensure optimal performance and fair usage of our API, Trifft enforces rate limits on the number of requests that can be made within a specific time frame. Rate limiting helps prevent abuse and ensures that all users have equitable access to the API.

Rate Limits

  • Limit: 50 requests per 10 seconds.
  • Exceeding Limits: If the rate limit is exceeded, all new requests will be blocked.
  • Response Code: When requests are blocked due to exceeding the rate limit, the API will return a 429 Too Many Requests status code.
  • Blocking Duration: Once the rate limit is exceeded, all new requests will be blocked for the next 1 minute.

Example Scenario

If you send more than 50 requests within a 10-second window, any subsequent requests will receive a 429 status code. After hitting the limit, all further requests will be blocked for 1 minute before you can start making requests again.

Example Response

{
    "status": 429,
    "success": false,
    "error": {
        "code": 429,
        "message": "You have exceeded the rate limit of 50 requests in 10 seconds. Please wait for 1 minute before making new requests.",
        "exception": "RateLimitExceededException"
    }
}

Best Practices

To avoid hitting the rate limits, consider the following best practices:

  1. Implement Retry Logic: Ensure your application can handle 429 Too Many Requests responses by implementing retry logic with exponential backoff.
  2. Batch Requests: Where possible, use the Batch API to send multiple requests in a single call.
  3. Monitor Usage: Regularly monitor your API usage to ensure you are operating within the rate limits.
  4. Optimize Requests: Minimize the number of API requests by optimizing your application's logic to combine requests and reduce redundancy.

Contact Support

If you have specific use cases that require higher rate limits or need assistance with rate limiting, please contact our support team. We are here to help and can discuss potential solutions or custom rate limits based on your needs.