Skip to main content

TickerDB for Python

PyPI version Python versions

Market data for AI agents. Technicals, fundamentals, SEC filings, insider trades and macro, ready to search and backtest. This is the official Python client for the TickerDB API.

  • 10,000+ tickers. US stocks, ETFs and crypto, daily and weekly.
  • Full-market screening. Filter every stock on any field and any date, in one call.
  • Point in time. Each date only uses data that was public by then, without lookahead bias.
  • Direct from the SEC. Built from SEC EDGAR filings: 10-K, 10-Q, 8-K, Form 4, 13F and N-PORT.

Work 6.2x faster, on 55% fewer tokens. TickerDB does the computing for you: trends, patterns and valuations for every stock, with their history, as named bands (momentum_rsi_zone = "oversold") plus raw values. So there's no pipeline to build. You just ask for what you want. See the benchmarks.

pip install "tickerdb[pandas]"
import tickerdb

tickerdb.login()                      # once: approve in the browser, the key is saved
db = tickerdb.TickerDB()

db.summary("AAPL")["trend"]["direction"]          # 'strong_uptrend'

# Screen the whole market, as a DataFrame
db.search(
    filters=[{"field": "momentum_rsi_zone", "op": "eq", "value": "oversold"},
             {"field": "market_cap_usd", "op": "gt", "value": 10e9}],
    fields=["ticker", "sector", "momentum_rsi_value"],
).to_frame()

# Every daily bar since 2019, across pages
bars = tickerdb.frame(db.iter_ohlcv("AAPL", start="2019-01-01", order="asc"))

The key

TickerDB() looks for a key in this order: the api_key argument, the TICKERDB_API_KEY environment variable, then the key tickerdb.login() saved (~/.config/tickerdb/config.json, on Windows %APPDATA%\tickerdb\config.json). You can also create a key in the dashboard.

Methods

One method per endpoint, with the endpoint's parameters as keyword arguments. Your editor shows each one's parameters and allowed values.

Method Endpoint What it returns
summary(ticker) /v1/summary/{ticker} One asset's full snapshot; also a past date, a date range, or band events
ohlcv(ticker) /v1/ohlcv/{ticker} Daily or weekly price bars
search() /v1/search Assets matching filters, on the latest or any past date
universe(fields) /v1/universe Chosen fields for every asset on one date
history() /v1/history Chosen fields for many assets over a date range
market() /v1/market Market and macro fields per date
diff(tickers) /v1/diff What changed for some tickers
statements(ticker), statement_lines() /v1/statements Financial statements from SEC filings, point in time
insiders(), insider_trades(insider), insider_holdings(insider) /v1/insiders Company insiders, 13F institutions, members of Congress
funds(), fund_holdings(fund), fund_holders(ticker) /v1/funds Fund holdings from SEC N-PORT filings
indexes(), index_members(index) /v1/indexes Index membership on a date
models(), model(slug), model_history(slug), model_holdings(slug), model_trades(slug), models_holdings() /v1/models TickerDB's open-source trading models
watchlist(), watchlist_add(tickers), watchlist_remove(tickers), watchlist_diff() /v1/watchlist Your watchlist and what changed for it
schema(), status(), account() The field list, release times, your plan and usage

Lists can be Python lists (fields=["ticker", "sector"]), dates can be date objects, and filters are a list of {"field", "op", "value"} dicts. The endpoint pages in the docs describe every parameter and response.

Results

Every method returns a Result: the response's JSON as a dict, with three additions.

result = db.ohlcv("AAPL", limit=5)
result["bars"]        # the JSON, as documented
result.rows           # the rows, whatever the endpoint calls them
result.to_frame()     # the rows as a pandas DataFrame
result.usage          # {'limit': 200000, 'used': 42, 'remaining': 199958, ...}

Paging

Endpoints that page have an iter_... twin that returns every row, fetching pages as you go:

for trade in db.iter_insider_trades("jeffrey-p-bezos", start="2024-01-01"):
    ...

panel = tickerdb.frame(db.iter_history(
    tickers=["AAPL", "MSFT", "NVDA"],
    fields=["trend_direction", "momentum_rsi_zone", "fundamentals_pe_ratio"],
    timeframe="weekly", start="2019-01-01",
))

max_rows= stops early. history() with thousands of tickers is sent as a POST by itself.

Fields

from tickerdb import fields

fields.find("rsi zone")                        # ['momentum_rsi_zone', 'momentum_rsi_zone_prev', ...]
fields.TICKER["momentum_rsi_zone"].values      # ('deep_oversold', 'oversold', 'neutral_low', ...)

fields.TICKER, fields.MARKET and fields.MODEL list every field with its type, band values and description. db.schema(search="bull flag") asks the API instead, with full descriptions.

Search builder

db.query().eq("trend_direction", "strong_uptrend").gte("market_cap_usd", 2e9) \
    .member_of("sp500").select("ticker", "sector").sort("market_cap_usd").limit(50).execute()

Errors

try:
    db.summary("AAPL", date="2015-01-02")
except tickerdb.PlanRestrictedError as error:      # the date is before your plan's history
    print(error.message, error.upgrade_url)
except tickerdb.TickerDBError as error:            # any API error
    print(error.status_code, error.error_type, error.message)

InvalidRequestError (400), AuthenticationError (401), InsufficientCreditsError (402), PlanRestrictedError (403), NotFoundError (404), RateLimitError (429) and ServiceUnavailableError (503) all subclass TickerDBError. Network errors and 429, 502, 503 and 504 are retried twice before they are raised (max_retries=). Only successful responses cost credits.

Async

from tickerdb import AsyncTickerDB

async with AsyncTickerDB() as db:
    summary = await db.summary("AAPL")
    async for bar in db.iter_ohlcv("AAPL", start="2019-01-01"):
        ...

How this library stays current

The methods and the field tables are generated from TickerDB's own OpenAPI document, which the API builds from its routes: https://api.tickerdb.com/v1/openapi.json. A copy is in this repository as openapi.json.

python scripts/generate.py --update    # fetch the newest document and regenerate
python -m pytest                       # the tests compare the library with the document
python -m pytest -m live               # a few real calls (needs a key)

A push to main with a new version in src/tickerdb/_version.py is published to PyPI by .github/workflows/publish.yml.

Upgrading from 0.2

1.0 is a rewrite for the current API, and it breaks 0.2 code.

  • Methods return the response itself, not {"data": ..., "rate_limits": ...}. Use result[...] and result.usage.
  • base_url no longer includes /v1.
  • ForbiddenError is now PlanRestrictedError; DataUnavailableError is ServiceUnavailableError.
  • Field names are the API's current ones (db.schema() lists them).

License

MIT

Metadata

Release files for tickerdb 1.0.0

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

Source distribution (sdist)

Source distribution for tickerdb 1.0.0
File Size Uploaded Provenance Actions
tickerdb-1.0.0.tar.gz 136.2 kB With provenance Details for tickerdb-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 201.6 kB

Release files / tickerdb-1.0.0.tar.gz

Download URL tickerdb-1.0.0.tar.gz
Size 136.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e1b3382da8f6a460a599c4865139553805f07c586f4a37ab0f02b41ca06318e6
BLAKE2b-256 checksum
How to use checksums
b9b2de73832f12dd04b26b75e4e788d504f0fd881476e10f3c8feb9c9b694a93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / tickerdb-1.0.0-py3-none-any.whl

Download URL tickerdb-1.0.0-py3-none-any.whl
Size 65.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7536502347c972b66d2b324eb54783a53d5383afa33c7bb3ee7ce750404d7ff
BLAKE2b-256 checksum
How to use checksums
d2a511459c620903e4b5e87ee092819f289ad5d10053a5101dea47a17bc1d8ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for tickerdb 1.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tickerdb-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

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.

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