Rate Limits

To ensure the stability and fair usage of our platform, we enforce rate limits on our public APIs. These limits help prevent abuse and ensure a reliable experience for all users. This document provides an overview of the rate limits applied to our APIs and best practices for handling them.

Rate Limiting Overview

Rate limits are set to control the number of requests a client can make to an API within a specified time frame. Each client is identified by their IP address. Exceeding these limits will result in the API returning a 429 Too Many Requests response.

Rate Limits for Our APIs

Authentication API

The endpoint for generating access token

  • Max Requests: 1000 requests per 5 minutes per IP

Meter Type APIs

These endpoints cover CRUD operations for meter types.

  • Max Requests: 5000 requests per 5 minutes per IP

Meter APIs

These endpoints cover CRUD operations for meters.

  • Max Requests: 10,000 requests per 5 minutes per IP

How Rate Limiting Works

Our rate limiting is based on the Token Bucket algorithm:

  • Token Bucket: Each client IP has a bucket that holds tokens (requests).

  • Capacity: The bucket can hold a maximum number of tokens.

  • Refill Rate: Tokens are added to the bucket at a specified rate within the defined time window.

If the bucket is empty (no tokens left), further requests will be denied until more tokens are added.

Handling Rate Limit Exceeded Errors

When you exceed the rate limit, the API responds with a 429 Too Many Requests status code. To handle these errors:

  • Implement Retry Logic: Use exponential backoff to retry requests after a delay.

  • Monitor Your Requests: Ensure your application does not exceed the rate limits by monitoring the number of requests made.