Skip to content

secapi-ai/secapi-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SEC API Python SDK

secapi-client is the Python client for SEC API filings, filing sections, financial statements, ownership data, and factor data.

Documentation · Get an API key · Support · Status

Install

pip install secapi-client

Set your API key

Create an API key in the SEC API dashboard, then set it in your shell:

export SECAPI_API_KEY="secapi_live_..."

Make a request

Create first_request.py:

from secapi_client import SecApiClient

client = SecApiClient()
filing = client.agent_latest_filing(ticker="AAPL", form="10-K")

print(filing["accessionNumber"])
print(filing["filingUrl"])

Run python first_request.py. It prints the accession number and SEC source URL for Apple's latest matching 10-K. Those values change when a newer filing is available.

Configuration and compatibility

SecApiClient() reads SECAPI_API_KEY and the optional SECAPI_BASE_URL from the environment. SECAPI_API_BASE_URL is an alias. Pass bearer_token or set SECAPI_BEARER_TOKEN only for signed-in account endpoints; standard data requests use an API key.

Python 3.11 or newer is required. The legacy OMNI_DATASTREAM_API_KEY, OMNI_DATASTREAM_BEARER_TOKEN, OMNI_DATASTREAM_BASE_URL, and OMNI_DATASTREAM_API_BASE_URL environment variables remain supported.

Failures raise SecApiError, which includes the status, error code, and request ID. Include the request ID when opening a support issue.

See the API documentation for endpoint coverage, pagination, and retry behavior.

License

MIT

About

Python SDK for source-backed SEC filings and financial data

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages