Prerequisites
- Python 3.11 or newer.
- An API key in
SECAPI_API_KEY.
Run a complete first request
Createfirst_request.py:
Errors and retry behavior
SecApiError exposes an HTTP status, code, request_id, and any supplied retry details. The client has a bounded retry policy and observes Retry-After when present. A 429 can be retried even when it follows a mutating request; treatment of other failures depends on the HTTP method and retry options.
For a 401, check the environment variable and use API-key authentication for data endpoints. For 429, let the client wait or honor the returned interval in your own policy. Before a mutation whose replay is unsafe, construct the client with retry=False or ensure the operation is idempotent.
Production notes
- The default client uses
https://api.secapi.ai; overridebase_urlonly for an environment you control. - Pass
api_versionafter validating the exact operation; logRequest-IdandSECAPI-Versionaround failures. - Disable SDK retries when a queue, job runner, or service mesh already owns retry behavior.
- Endpoint fields and response views are not interchangeable. Consult the reference before parsing optional metadata.

