Skip to main content

Prerequisites

  • Node.js 18 or newer.
  • An API key in a trusted server-side environment.

Run a complete first request

Create first-request.mjs:
Expect an accession number, filing date, SEC filing URL, and request ID. The accession and date are live values and will change after a newer filing.

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 published situations namespace helpers for a current roster, a filtered roster by EDGAR form, current detail, a filing timeline, and a compact summary.
Treat 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 throws SecApiError 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_KEY in server-only configuration.
  • Set apiVersion explicitly after testing the endpoint behavior you depend on; log the response SECAPI-Version.
  • Use retry: false when your infrastructure already owns retries.
  • Paginate list endpoints with the SDK iterator rather than assuming one page is complete.
Next: SDK reliability, Python SDK, or API conventions.