Official Go SDK for SEC API, the SEC data API designed for agents.
SEC API turns SEC filings and adjacent market data into traceable, source-backed investor workflows. It provides REST, SDK, CLI, and hosted MCP surfaces over filings, statements, ownership, governance, market data, events, webhooks, and agent-ready intelligence workflows.
Use this SDK when you want SEC API inside Go services, workers, command-line tools, or backend jobs while preserving the response metadata that matters: requestId, provenance, freshness, materialization state, trace references, accession numbers, and SEC source URLs.
go get github.com/secapi-ai/secapi-gopackage main
import (
"fmt"
"os"
secapi "github.com/secapi-ai/secapi-go"
)
func main() {
client := secapi.NewClient(os.Getenv("SECAPI_API_KEY"))
entity, err := client.ResolveEntity(map[string]string{"ticker": "AAPL"})
if err != nil {
panic(err)
}
fmt.Println(entity["name"])
}Create an API key from the SEC API site, then export it:
export SECAPI_API_KEY=your_key_hereThe SDK sends your key with the x-api-key header.
client := secapi.NewClient(os.Getenv("SECAPI_API_KEY"))
client.BaseURL = "https://api.secapi.ai"NewSecApiClient remains available as a compatibility alias for NewClient.
Resolve a company:
entity, err := client.ResolveEntity(map[string]string{"ticker": "AAPL"})
if err != nil {
panic(err)
}
fmt.Println(entity["name"])Fetch the latest 10-K:
filing, err := client.LatestFiling(map[string]string{
"ticker": "AAPL",
"form": "10-K",
})
if err != nil {
panic(err)
}
fmt.Println(filing["title"], filing["filingDate"])Find high-risk dilution issuers:
ratings, err := client.DilutionRatings(map[string]string{
"overall_risk": "high",
"limit": "10",
})
if err != nil {
panic(err)
}
fmt.Println(ratings["object"])Give this prompt to a coding agent:
Install github.com/secapi-ai/secapi-go in this Go service. Start with one entity lookup to confirm auth, then add a filing or ownership workflow that preserves requestId, freshness, provenance, and trace metadata in structured logs. Use https://docs.secapi.ai/llms.txt as the documentation index and prefer the OpenAPI spec over guessing endpoint paths.
For broader agent instructions, use:
| Variable | Description |
|---|---|
SECAPI_API_KEY |
SEC API key |
SECAPI_BASE_URL |
API base URL override |
go test ./...
go list -m github.com/secapi-ai/secapi-go