Skip to main content

filingrail — Python client for the SEC EDGAR REST API

A thin, async-and-sync Python client for the Filingrail API on RapidAPI. Wraps the 7 v1 endpoints, returns typed dataclasses, no Pydantic dependency.

Install

Live on PyPI (2026-06-04): pypi.org/project/filingrail.

pip install filingrail

Get an API key

Subscribe on RapidAPI: https://rapidapi.com/hudson-enterprises-llc-hudson-enterprises-llc-default/api/filingrail. Free tier = 50 calls/day, no card. Pro $9/mo for 5,000 calls.

Quickstart (sync)

from filingrail import FilingrailClient

with FilingrailClient(api_key="YOUR_X_RAPIDAPI_KEY") as client:
    # Resolve a ticker to its CIK
    [aapl] = client.search_companies("AAPL", limit=1)
    print(aapl.cik, aapl.name)  # 320193 Apple Inc.

    # Latest financials (balance sheet + income statement + cash flow)
    statements = client.get_financials("AAPL", limit=3)
    for s in statements:
        print(s.statement_type, s.period_end, s.line_items.get("total_assets"))

    # Recent insider trades
    trades = client.get_insider_trades("AAPL", limit=5)
    for t in trades:
        print(t.transaction_date, t.insider_name, t.shares, t.price_per_share)

    # Berkshire Hathaway's 13F holdings (CIK 1067983)
    holdings = client.get_13f_holdings(1067983, limit=10)
    for h in holdings:
        print(h.issuer_name, h.value_usd)

Quickstart (async)

import asyncio
from filingrail import AsyncFilingrailClient

async def main():
    async with AsyncFilingrailClient(api_key="YOUR_X_RAPIDAPI_KEY") as client:
        statements = await client.get_financials("MSFT")
        for s in statements:
            print(s.statement_type, s.period_end)

asyncio.run(main())

Environment variable

Set RAPIDAPI_KEY (or X_RAPIDAPI_KEY) and api_key becomes optional:

import os
os.environ["RAPIDAPI_KEY"] = "..."

from filingrail import FilingrailClient
client = FilingrailClient()

All endpoints

Method Endpoint
search_companies(q, limit) /v1/search/companies
get_recent_filings(form_type, cik, limit) /v1/filings/recent
get_financials(ticker_or_cik, limit) /v1/companies/{id}/financials
get_financials_history(ticker_or_cik, period, limit, statement_type, line_item) /v1/companies/{id}/financials/history
get_insider_trades(ticker_or_cik, since, limit) /v1/companies/{id}/insider-trades
get_8k_events(ticker_or_cik, since, limit) /v1/companies/{id}/8k-events
get_13f_holdings(institution_cik, quarter, limit) /v1/institutions/{cik}/13f-holdings
health() /health

Errors

All non-2xx responses raise FilingrailError(message, status, detail). The detail is the parsed body when available, so you can pull out RapidAPI's specific error messages.

from filingrail import FilingrailClient, FilingrailError

try:
    client = FilingrailClient(api_key="wrong")
    client.search_companies("AAPL")
except FilingrailError as e:
    print(f"status={e.status} message={e}")

Why this exists

You could call httpx.get("https://filingrail.p.rapidapi.com/v1/...", headers=...) directly. The SDK saves you:

  • typed responses (autocomplete in your IDE)
  • no boilerplate for the RapidAPI auth headers
  • consistent error handling
  • example queries that match the canonical patterns documented in the RapidAPI listing's Docs tab

License

MIT

Metadata

Release files for filingrail 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for filingrail 0.1.1
File Size Uploaded Provenance Actions
filingrail-0.1.1.tar.gz 8.7 kB Without provenance Details for filingrail-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for filingrail 0.1.1
File Interpreter ABI Platform Actions
filingrail-0.1.1-py3-none-any.whl Python 3 none any Details for filingrail-0.1.1-py3-none-any.whl

Total release size: 16.2 kB

Release files / filingrail-0.1.1.tar.gz

Download URL filingrail-0.1.1.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9bd4953aa060dc602f64f9e0bde966a516d4eb11b99b756f995d1ad047dee9cd
BLAKE2b-256 checksum
How to use checksums
1c26cfc8f934ff6ec2fb4c8d7541d9e9e3a3d561f79513861430189e62762196
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / filingrail-0.1.1-py3-none-any.whl

Download URL filingrail-0.1.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96e59d756d14262d8a1a3722e8d4579d18aff944fc1a68758740f9cf2af36478
BLAKE2b-256 checksum
How to use checksums
6d1eeaf5a04119cc4f7dfdff6ca4c52d27bd172e0ca12ad50ffeb5e9f84743ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for filingrail 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page