Skip to main content

Prerequisites

  • Go 1.23 or newer.
  • An API key in SECAPI_API_KEY.

Run a first request

Create main.go:
Expect the current matching filing’s accession number, date, and SEC URL. Those values are live. Store them with any derived work; do not use a latest-filing response as a permanent fixture.

Special Situations workflow

The client has helpers for a current roster and detail, filing-event activity, disclosed calendar dates, aggregate counts, archived weekly issues, Markdown exports, underwriting packs, and monitor creation. Each call returns an error; handle it at the boundary that owns the request.
Current detail can change as filings arrive; an issue is an immutable historical publication. Retain source identifiers and request IDs with derived output, and review the underlying filing before relying on a disclosed term or date. See Special Situations workflows for the REST and CLI workflow.

Errors, retries, and limits

The client returns an APIError for API failures. Capture its HTTP status, error code, and request ID in application logs. Its retry layer honors Retry-After; a 429 can be retried even when it follows a mutating request, while treatment of other failures depends on the HTTP method. Before a mutation whose replay is unsafe, disable client retries with client.RetryConfig.MaxRetries = 0 or ensure the operation is idempotent. Keep one bounded retry owner in the service. Typed request helpers cover common paths, but the map-based methods remain the direct path to the REST contract. Check the relevant API reference for accepted parameters and response fields before adding a query parameter.

Production notes

  • Create the client with a key from a server-side secret source; do not ship it in a binary or frontend.
  • Use contexts, timeouts, and one retry owner in your service.
  • Log request identity and filing provenance separately from business output.
  • Treat agent response helpers as compact endpoint projections. Use the default endpoint shape when your use case needs fields not present in the compact response.
Next: API conventions, SDK reliability, or API reference.