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

# Rate Limits

> Understanding API rate limits and quotas

## Global Rate Limit

All API endpoints share a global rate limit of **80 requests per minute** per API key.

<Note>
  Rate limits are keyed by API key, not IP address. This allows you to use the API through proxies or distributed systems.
</Note>

## Endpoint-Specific Limits

In addition to the global limit, each endpoint has its own rate limit:

### User Management

* `POST /api/dev/set_trade_url` - 1/minute
* `GET /api/dev/set_user_agent` - 1/minute
* `GET /api/dev/get_balance` - 2/minute
* `GET /api/dev/get_linked_trade_urls` - 1/minute

### Listing Management

* `POST /api/dev/create_listing` - 5/minute
* `PATCH /api/dev/listing` - 5/minute
* `DELETE /api/dev/listing` - 5/minute
* `DELETE /api/dev/listings` - 1/minute

### Buy Order Management

* `POST /api/dev/create_buy_order` - 5/minute
* `PATCH /api/dev/buy_order` - 5/minute
* `DELETE /api/dev/buy_order` - 5/minute
* `DELETE /api/dev/buy_orders` - 1/minute

### Trade Management

* `GET /api/dev/load_pending` - 1/minute
* `GET /api/dev/load_pending_buy_orders` - 1/minute

## Rate Limit Headers

API responses include headers to help you track your rate limit status:

```
X-RateLimit-Limit: 80
X-RateLimit-Remaining: 75
X-RateLimit-Reset: 1704067200
```

## Handling Rate Limits

### 429 Too Many Requests

When you exceed a rate limit, the API returns a `429` status code:

```json theme={null}
{
  "error": "Rate limit exceeded",
  "retry_after": 30
}
```

**Best practices:**

1. Implement exponential backoff
2. Cache responses when possible
3. Batch operations where supported
4. Monitor rate limit headers

### Example: Retry Logic

```javascript theme={null}
async function apiRequest(url, options) {
  const response = await fetch(url, options);

  if (response.status === 429) {
    const retryAfter = parseInt(response.headers.get('Retry-After')) || 60;
    await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
    return apiRequest(url, options); // Retry
  }

  return response;
}
```

## Batch Limits

Some endpoints accept batch operations with item limits:

<CardGroup cols={2}>
  <Card title="Listings & Buy Orders" icon="layer-group">
    **100 items** maximum per request
  </Card>

  <Card title="Bulk Operations" icon="boxes-stacked">
    Use batch endpoints to maximize efficiency
  </Card>
</CardGroup>

<Tip>
  The `set_user_agent` endpoint has a 1/minute rate limit and expires after 10 minutes. Call it every 5-9 minutes to maintain automated status.
</Tip>
