Rate limits
The Public Lead API limits requests per provider, not per key. Every active key of one provider shares the same allowance:
| Limit | Value |
|---|---|
| Per minute | 60 requests |
| Per day | 2000 requests |
429 Too Many Requests
When the limit is exceeded, the API returns a 429 status code. To handle it correctly:
- Read the
Retry-Afterheader in the response (how many seconds to wait). - Retry after that time has passed.
- If there is no
Retry-After— apply exponential backoff.
import time, requests
def post_with_retry(url, headers, json, max_retries=5):
delay = 1
for attempt in range(max_retries):
resp = requests.post(url, headers=headers, json=json, timeout=15)
if resp.status_code != 429:
return resp
retry_after = int(resp.headers.get("Retry-After", delay))
time.sleep(retry_after)
delay *= 2 # exponential backoff
resp.raise_for_status()
return resp
Failed keys are throttled by IP
Repeated 401s from one IP address are answered with 429 for a while. A valid
key from the same address is still accepted, so this never masks a real limit.
To stay under the limit
- Send leads as a stream rather than in a batch.
- Poll status at a reasonable interval (e.g. every 30–60 seconds), not too often.
- An
external_idresend for the same customer returns409, so a retry after a timeout is safe — but do not resend the same lead in a loop.