@secapi/cli is the command-line interface for SEC API. Use it to retrieve filings, filing sections, statements, issuer data, and account information from a terminal, script, or agent runner.
Documentation · Pricing · Get an API key · Support · Status
npm install -g @secapi/cli
export SECAPI_API_KEY="secapi_live_..."
secapi filings latest --ticker AAPL --form 10-KThe command writes JSON to stdout. The response identifies the filing and includes its form, filing date, accession number, and SEC source URL. Carry those identifiers into the work that follows; a later filing can change a latest-filing result. Use --json=false in an interactive terminal when a compact human-readable summary is preferable.
secapi --help
secapi filings latest --help
secapi examples
secapi doctordoctor checks the selected API origin, credential source, API health, and account context without printing credential values. examples prints starter workflows. Commands accept --base-url <url> for a one-off local, staging, or proxy origin.
For CI and agent runners, keep credentials out of command arguments. Set SECAPI_API_KEY, or pipe a key with --api-key-stdin:
printf '%s' "$SECAPI_API_KEY" | secapi health --api-key-stdinConfigure the hosted MCP server for a supported agent client:
secapi mcp install --client claude-code
secapi init --client cursor --print
secapi agent-context --output secapi-cli-context.jsonagent-context produces a machine-readable command inventory. --print shows generated configuration without writing it. Run secapi init --help for the current client list.
Use --response-mode compact when you want the smallest useful payload. Compact catalog responses still include readiness/proof summaries. Add --include trust only when you need the full trust/provenance envelope plus full methodology/materialization/revision/source-rights objects for citations or checks. For catalog/tool-discovery calls, first narrow with --category; --limit is available on factor list commands such as factors extreme-moves, not factors catalog. The full trust envelope can be larger than a simple picker payload.
The CLI reads SECAPI_API_KEY, SECAPI_BEARER_TOKEN, and the optional SECAPI_BASE_URL. It defaults to https://api.secapi.ai. SECAPI_PROFILE and SECAPI_CONFIG_FILE select a no-secret profile file; profiles store environment-variable names, not credential values.
The preferred executable is secapi. omni-sec is installed as a compatibility alias with the same commands. Discover the full surface with secapi help all; unknown commands and options fail locally with suggestions.
Run secapi support bundle to create a redacted local diagnostics packet for a support handoff. Include its request ID when contacting SEC API support.
MIT