Skip to main content

Prerequisites

  • Python 3.11 or newer.
  • An API key in SECAPI_API_KEY.

Run a complete first request

Create first_request.py:
Expect a current filing identity and request ID. The values are live; retain the accession number and filing URL if a later process needs to locate the same source filing.

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; override base_url only for an environment you control.
  • Pass api_version after validating the exact operation; log Request-Id and SECAPI-Version around 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.
Next: SDK reliability, error code catalog, or API reference.