> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gomry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate Limits

> Understand API rate limiting and best practices

# Rate Limits

The Gomry API enforces rate limits to ensure fair usage and service stability.

## Current Limits

| Scope | Limit |
| - | - |
| Per IP address | **60 requests per 10 seconds** |

When you exceed the rate limit, the API returns a `429 Too Many Requests` response:

```json theme={null}
{
  "error": "Rate limit exceeded. Try again shortly."
}
```

## Best Practices

> [card] Batch where possible
>
> Use list endpoints with pagination instead of fetching resources one by one.

> [card] Cache responses
>
> Cache API responses on your end to reduce the number of requests, especially for data that doesn't change frequently (events, ticket classes).

> [card] Use exponential backoff
>
> When you receive a `429`, wait before retrying. Double the wait time on each subsequent retry.

> [card] Spread requests over time
>
> If syncing large datasets, spread requests evenly rather than bursting all at once.

## Retry Strategy Example

```javascript theme={null}
async function fetchWithRetry(url, headers, maxRetries = 3) {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    const response = await fetch(url, { headers });

    if (response.status !== 429) return response;

    const delay = Math.pow(2, attempt) * 1000; // 1s, 2s, 4s
    await new Promise((r) => setTimeout(r, delay));
  }

  throw new Error("Rate limit exceeded after retries");
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.