200: retain the issuer identity, accession number, form, filing date, filing URL, and request ID when returned. A latest-filing result is time-dependent, so verify the returned filing identity before using it as evidence.
Choose REST when your application owns HTTP and response parsing; an SDK or CLI when it already fits your runtime; and hosted MCP when an MCP client needs discovered SEC API tools. Each path should produce the same kind of source record, but their client setup and retry ownership differ.
REST: establish the filing record
Set the key in your server-side environment. Machine requests usex-api-key.
JavaScript SDK: use the same workflow
Install the SDK, then keepSECAPI_API_KEY in the server-side environment.
filing; see JavaScript SDK for a runnable error-handling example.
CLI: verify the same path from a terminal
secapi <command> --help for the installed command version, and see the CLI reference for configuration and diagnostic commands.
Hosted MCP: discover before you call
Configure the hosted server in your MCP client, then let the client discover its current tool catalog instead of hard-coding tool names as a compatibility contract.When a first request stops
Correct400 validation errors from the route or tool schema. For 401 or 403, verify the credential and auth flow; machine data requests use x-api-key. Stop for a 402 billing condition. For 429, honor Retry-After when present and reduce parallel work before a bounded retry. Preserve the request ID with the failed attempt, then use Request diagnostics.
