Rate Limits

The pd4castr API rate limits requests per client. When you exceed the limit, the API returns HTTP 429 Too Many Requests with a Retry-After header.

Automatic Retries

By default the SDK retries a 429 automatically, waiting for the Retry-After duration before retrying, up to three times. Bulk jobs self-throttle to the allowed rate with no extra code.

The max_retries client option changes the retry count, or set it to 0 to disable automatic retries:

from pd4castr_api_sdk import Client
 
client = Client(
    client_id="your-client-id",
    client_secret="your-client-secret",
    max_retries=0,
)

With retries disabled or exhausted, the SDK raises RateLimitError. It subclasses ApiError, and its retry_after attribute is the number of seconds to wait before retrying.

Next Steps

  • ReferenceClient options and exceptions