# Rate Limiting

## Overview

To ensure equitable access and maintain performance for all users, the Global Data API enforces rate limiting on all endpoints. This section provides details on how rate limiting works, its default configurations, and how to manage and respond to rate limit constraints.

## Default Rate Limit Configuration

By default, the rate limit for the API is set to **600 requests per minute**. This is calculated using a rolling average method, where the number of requests is averaged over a 1-minute interval.

## Adjusting Your Rate Limit

If there are operational needs that necessitate a higher request rate, adjustments can be made on a case-by-case basis. To initiate a review or request a change in your rate limit:

1. Contact Global Data support.
2. Provide a clear reason for the requested change, along with any data or justification that supports your use case.

Once your request is reviewed, the support team will contact you with a decision or request further information.

## Exceeding Rate Limit & Response Handling

When the rate limit is surpassed, the API will respond with a `HTTP/1.0 429 Too Many Requests` status. In such scenarios, applications should implement a back-off strategy, waiting for a reasonable duration before retrying. 

The following response headers provide additional details on rate limits:

- **x-ratelimit-limit**: The maximum number of allowable requests in the current time window (e.g., per minute).
  
- **x-ratelimit-remaining**: Indicates the number of requests left within the current time window.

For example:

```
x-ratelimit-limit: 600
x-ratelimit-remaining: 599
```

The above headers indicate a limit of 600 requests per minute, with 599 requests still available for use.

## Best Practices

- **Implement Rate Limit Handling**: Always incorporate rate limit error handling in your application logic. This can be done by checking the HTTP status and parsing the provided headers to decide when to retry.

- **Spread Out Requests**: If feasible, distribute your API requests evenly over time to avoid hitting rate limits during peak usage times.

- **Monitor Usage**: Use the provided rate limit headers to monitor your application's API usage and adjust its behavior accordingly.

Following these guidelines will ensure a smooth interaction with the Global Data API and prevent unnecessary disruptions due to rate limiting.
