All API endpoints are rate limited to 60 requests per minute per API key.
Every response includes these headers:
| Header | Description |
|---|
X-RateLimit-Limit | Maximum requests allowed per minute (60) |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
When you hit the limit, the response is 429 Too Many Requests with an additional header:
| Header | Description |
|---|
Retry-After | Seconds to wait before retrying |
{ "error": "Rate limit exceeded. Try again in 60 seconds." }
Handling 429 responses
Use exponential backoff when you receive a 429. The Retry-After header tells you the minimum wait time.
import time
import requests
def search_with_retry(name: str, api_key: str, max_retries: int = 3):
url = "https://api.getcurrent.ca/v1/search"
headers = {"Authorization": f"Bearer {api_key}"}
for attempt in range(max_retries):
response = requests.post(url, headers=headers, json={"name": name})
if response.status_code == 429:
retry_after_header = response.headers.get("Retry-After")
try:
retry_after = int(retry_after_header) if retry_after_header is not None else 60
except (TypeError, ValueError):
retry_after = 60
wait = retry_after * (2 ** attempt) # exponential backoff
time.sleep(wait)
continue
return response.json()
raise Exception("Max retries exceeded")
Reducing unnecessary requests
Searches are saved automatically. Use GET /search/{id} to retrieve a previous result instead of running a new search. The searchId is in every response under meta.searchId.
If you’re building a system that needs to display the same result multiple times (e.g. a dashboard), cache the response locally and use GET /search/history to list past searches rather than re-running them.