> ## Documentation Index
> Fetch the complete documentation index at: https://docs.secapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Libraries and SDKs

> Choose a SEC API integration surface and verify it with a cited filing artifact

SDKs and the CLI call the public SEC API. Pick the surface that matches where your code runs; use REST when you need direct control of the HTTP exchange, and MCP when a compatible client needs tool discovery rather than an application client.

<CardGroup cols={2}>
  <Card title="JavaScript SDK" icon="file-code-2" href="/javascript-sdk">TypeScript and JavaScript services, workers, and scripts.</Card>
  <Card title="Python SDK" icon="file-code" href="/python-sdk">Research scripts, notebooks, jobs, and Python services.</Card>
  <Card title="Go SDK" icon="binary" href="/go-sdk">Go services calling the REST contract.</Card>
  <Card title="Rust SDK" icon="cpu" href="/rust-sdk">Async Rust services with configurable HTTP behavior.</Card>
  <Card title="SEC API CLI" icon="terminal" href="/cli">Terminal inspection and shell automation.</Card>
  <Card title="Hosted MCP" icon="bot" href="/mcp-workflows">MCP-aware research and coding clients.</Card>
</CardGroup>

## Verify any client with one filing

After installation, make a single call for a known issuer and inspect the returned source record. The method and command names below are the supported first steps:

| Surface    | Filing call                                                                                    |
| ---------- | ---------------------------------------------------------------------------------------------- |
| JavaScript | `client.latestFiling({ ticker: "AAPL", form: "10-K" })`                                        |
| Python     | `client.latest_filing(ticker="AAPL", form="10-K")`                                             |
| Go         | `client.LatestFilingAgent(map[string]string{"ticker": "AAPL", "form": "10-K"})`                |
| Rust       | `client.latest_filing_with(&LatestFilingRequest::new().ticker("AAPL").form("10-K")).await?`    |
| CLI        | `secapi filings latest --ticker AAPL --form 10-K`                                              |
| REST       | `GET /v1/filings/latest?ticker=AAPL&form=10-K`                                                 |
| MCP        | Discover the latest-filing tool through `tools.search`, then inspect it with `tools.describe`. |

The successful result is not merely an HTTP 200. Preserve the returned accession number, form, filing date, filing URL, and request ID, then use those fields in any downstream citation. A filing's content and accession can change as issuers file.

## Lifecycle and errors

Set `SECAPI_API_KEY` in your runtime secret store. SDKs and the CLI read it for normal data calls and send it as `x-api-key`; browser-session bearer credentials are for documented signed-in account operations, not routine data access.

Set application-level deadlines and let one layer own retries. On `429`, honor `Retry-After` when supplied and reduce concurrency. Correct validation errors rather than retrying them, and do not blindly replay a mutation. Preserve `requestId`, source identifiers, and any returned provenance, freshness, materialization, or trace fields with each result.

Continue with [First request flows](/first-request-flows), then read [API overview](/api-overview) before adding pagination, caching, or background work.
