Prerequisites
- Node.js 18 or newer.
- An API key in a trusted server-side environment.
Run a complete first request
Createfirst-request.mjs:
Use the response correctly
agentLatestFiling() sets view=agent. This is a smaller, endpoint-supported response shape; it is not a guarantee that every default-response field is included. When you need the full endpoint response, use latestFiling() and inspect the operation reference.
Keep the returned accession number, filing URL, and request ID with any derived output. They connect a result to its source filing and API request.
Special Situations workflow
Use the publishedsituations namespace helpers for a current roster, a filtered roster by EDGAR form, current detail, a filing timeline, and a compact summary.
detail as current data. Keep source identifiers and request IDs with any derived output, and review the underlying filing before relying on a disclosed term or date. See Special Situations workflows and the REST reference for the complete published API surface.
Errors and retries
The SDK throwsSecApiError with an HTTP status, code, requestId, and, when supplied, retry guidance. Its retry policy is bounded and honors Retry-After. A 429 can be retried even when it follows a mutating request; treatment of other failures depends on the HTTP method and request options.
Do not add another concurrent retry loop. Before a mutation whose replay is unsafe, disable SDK retries with new SecApiClient({ retry: false }) or ensure the operation is idempotent and use an idempotency key.
Production notes
- Keep
SECAPI_API_KEYin server-only configuration. - Set
apiVersionexplicitly after testing the endpoint behavior you depend on; log the responseSECAPI-Version. - Use
retry: falsewhen your infrastructure already owns retries. - Paginate list endpoints with the SDK iterator rather than assuming one page is complete.

