Official Python client for the Earnings Feed API — SEC filings, insider transactions, and institutional holdings.
pip install earningsfeedfromearningsfeedimportEarningsFeedclient=EarningsFeed("your_api_key")
# Get recent 10-K and 10-Q filingsfilings=client.filings.list(forms=["10-K", "10-Q"], limit=10)
forfilinginfilings.items:
print(f"{filing.form_type}: {filing.company_name} - {filing.title}")
# Get a company profileapple=client.companies.get(320193)
print(f"{apple.name} ({apple.primary_ticker})")- Type hints — Full type annotations for IDE autocomplete
- Pydantic models — Validated response objects
- Pagination helpers —
.iter()methods for automatic pagination - Context manager — Use with
withstatement for automatic cleanup
# List filings with filtersfilings=client.filings.list(
ticker="AAPL",
forms=["10-K", "10-Q", "8-K"],
status="final",
limit=25,
)
# Iterate through all filings (auto-pagination)forfilinginclient.filings.iter(ticker="AAPL", forms="8-K"):
print(filing.title)
# Get filing details with documentsdetail=client.filings.get("0000320193-24-000123")
fordocindetail.documents:
print(f"{doc.doc_type}: {doc.filename}")# Recent insider purchasespurchases=client.insider.list(
ticker="AAPL",
direction="buy",
codes=["P"], # Open market purchaseslimit=50,
)
fortxninpurchases.items:
print(f"{txn.person_name}: {txn.shares} shares @ ${txn.price_per_share}")
# Large sales across all companiesfortxninclient.insider.iter(direction="sell", min_value=1_000_000):
print(f"{txn.company_name}: ${txn.transaction_value:,.0f}")# Who owns Apple?holdings=client.institutional.list(
ticker="AAPL",
min_value=1_000_000_000, # $1B+ positions
)
forhinholdings.items:
print(f"{h.manager_name}: {h.shares:,} shares (${h.value:,})")
# Track a specific fundforhinclient.institutional.iter(manager_cik=1067983): # Berkshireprint(f"{h.issuer_name}: {h.shares:,} shares")# Get company profilecompany=client.companies.get(320193)
print(f"{company.name}")
print(f"Ticker: {company.primary_ticker}")
print(f"Industry: {company.sic_codes[0].description}")
# Search companiesresults=client.companies.search(q="software", state="CA", limit=10)
forcompanyinresults.items:
print(f"{company.name} ({company.ticker})")fromearningsfeedimport (
EarningsFeed,
AuthenticationError,
RateLimitError,
NotFoundError,
)
client=EarningsFeed("your_api_key")
try:
filing=client.filings.get("invalid-accession")
exceptNotFoundError:
print("Filing not found")
exceptRateLimitErrorase:
print(f"Rate limited. Resets at: {e.reset_at}")
exceptAuthenticationError:
print("Invalid API key")withEarningsFeed("your_api_key") asclient:
filings=client.filings.list(limit=10)
# Connection automatically closed when exiting the blockFull API documentation: earningsfeed.com/api/docs
MIT