Official Python SDK for ko.io — source-traced SEC & market data for AI agents and quants
Project description
ko-edgar
Official Python SDK for ko.io — source-traced SEC & market data for AI agents and quants. 13F institutional holdings (85M+ rows, 2013→today), insider trades, Congress trading, crypto ETF exposure, macro indicators, and a white-labeled EDGAR filings gateway.
pip install ko-edgar
Quickstart
Works out of the box in keyless demo mode — no signup required:
from ko_edgar import KoClient
ko = KoClient() # demo mode; or KoClient(api_key="ko_live_...")
# Who is Berkshire Hathaway holding right now?
for holding in ko.institutions.holdings("1067983", per_page=10):
print(holding["ticker"], holding["holding_value"])
# Which institutions hold NVDA?
for holder in ko.stocks.holders("NVDA"):
print(holder["name"], holder["shares_held"])
# What did Congress trade recently?
for trade in ko.congress.trades(sort="recent", per_page=10):
print(trade["member_name"], trade["ticker"], trade["transaction_type"])
Get a free API key (200 calls/day, no credit card) at ko.io/console, then:
ko = KoClient(api_key="ko_live_...") # or set KO_API_KEY env var
Async
from ko_edgar import AsyncKoClient
async with AsyncKoClient() as ko:
result = await ko.stocks.activity("NVDA", quarters=8)
Pagination
from ko_edgar import KoClient, paginate
ko = KoClient()
for trade in paginate(ko.congress.trades, ticker="NVDA", per_page=100):
...
Results and errors
Every method returns an ApiResult: iterate it for rows, or use
result.data / result.meta for the raw envelope. result.truncated tells
you when the plan's row cap trimmed the response.
from ko_edgar import KoClient, PlanRequiredError, RateLimitError
ko = KoClient()
try:
yields = ko.macro.treasury_yields(days=90) # requires Pro
except PlanRequiredError:
print("macro data needs a Pro plan → https://ko.io/pricing")
except RateLimitError as e:
print(f"quota resets in {e.retry_after}s")
Escape hatch
Any /api/v1 endpoint not covered by a typed method:
ko.get("/api/v1/exec-compensation", ticker="AAPL", ceo_only=True)
Links
- Docs: https://ko.io/docs
- MCP server (same data inside Claude/Cursor/any agent): https://ko.io/mcp
- Repository: https://github.com/SharpLu/ko-mcp
MIT licensed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ko_edgar-0.1.0.tar.gz.
File metadata
- Download URL: ko_edgar-0.1.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ad137134274e65f27c3e6dc9cb8123bcad32a6f9e834eb22d35d0a10df11623
|
|
| MD5 |
7e5668f7dd0ccfeb8667cf525c1da123
|
|
| BLAKE2b-256 |
22e26e5d7d1f399391fe0103a6dfa6c7fd61dee2231f34b35e9bbbf6d63d571f
|
File details
Details for the file ko_edgar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ko_edgar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f30bbb88938ecc8c4fb666b7e6d5b8427cd1afe85d55d9e9727492098d94e2e
|
|
| MD5 |
3be36d2ab97ed79e9f1404deefe36cd5
|
|
| BLAKE2b-256 |
81a4225e64a2a3fab8733fbed2c596372019f8c8b237f0dfe3f6778d877cdcf7
|