Skip to main content

Limits

LimitValue
Requests per minute100 per API key
Max items per page100
Rate limits are enforced per API key. If you exceed the limit, you will receive a 429 Too Many Requests response.

Rate-Limit Response

{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Please retry after 60 seconds."
  }
}
The Retry-After header is included in 429 responses indicating how many seconds to wait before retrying.

Handling Rate Limits

1

Detect the 429 status

Check for HTTP status 429 in every response before processing the body.
2

Read the Retry-After header

Wait the number of seconds specified in Retry-After before retrying.
3

Use exponential backoff

If Retry-After is not present, implement exponential backoff starting at 1 second.
4

Avoid polling loops

For high-frequency use cases, prefer webhooks over polling the signal feed. See Webhooks.

Example: Retry with Backoff

import time
import requests

def fetch_signals(api_key: str, retries: int = 3) -> dict:
    headers = {"Authorization": f"Bearer {api_key}"}
    delay = 1

    for attempt in range(retries):
        response = requests.get(
            "https://app.getlima.ai/api/v1/signals",
            headers=headers
        )
        if response.status_code == 429:
            retry_after = int(response.headers.get("Retry-After", delay))
            time.sleep(retry_after)
            delay *= 2
            continue
        response.raise_for_status()
        return response.json()

    raise Exception("Exceeded retry limit")

Pagination vs. Rate Limits

When paginating through large result sets, space out requests to stay within the 100 req/min limit. With limit=100 per page, you can safely fetch up to 100 pages per minute — more than enough for most use cases. See API Reference Overview for pagination details.