Pre-computed market data for
FastAPI apps.

TickerDB Python SDK + FastAPI. Pre-computed market data in your API endpoints, no infrastructure.

Install the SDK.

One dependency. No MCP server, no WebSocket connections — just a Python package that calls the TickerDB HTTP API.

terminal
$ pip install tickerdb

Two endpoints, five minutes.

Initialize the async client once, await methods in your route handlers, and return the data payload directly.

python
from fastapi import FastAPI
from tickerdb import AsyncTickerDB

app = FastAPI()
client = AsyncTickerDB("tdb_your_api_key")

@app.get("/summary/{ticker}")
async def get_summary(ticker: str):
    result = await client.summary(ticker)
    return result["data"]

@app.get("/summary-events/{ticker}")
async def get_summary_events(ticker: str, field: str = "rsi_zone", band: str = "deep_oversold"):
    result = await client.summary(ticker, field=field, band=band)
    return result["data"]

Track state changes effortlessly.

Most market data APIs return point-in-time snapshots. TickerDB tracks state transitions — your agent sees what changed, not just what is.

python
@app.get("/watchlist/changes")
async def watchlist_changes():
    result = await client.watchlist_changes()
    # each change includes from/to state transitions
    # e.g. trend: "uptrend" → "downtrend"
    return result["data"]
json
{
  "timeframe": "daily",
  "run_date": "2026-03-28",
  "changes": {
    "AAPL": [
      {
        "field": "rsi_zone",
        "from": "neutral",
        "to": "oversold"
      },
      {
        "field": "trend_direction",
        "from": "uptrend",
        "to": "downtrend"
      }
    ]
  },
  "ticker_context": {
    "AAPL": {
      "last_changed_date": "2026-03-28"
    }
  },
  "tickers_checked": 2,
  "tickers_changed": 1
}

Keep market-data I/O async from edge to edge.

FastAPI gets its throughput from an async request path, so use AsyncTickerDB inside async route handlers instead of wrapping the synchronous client in a thread pool. A dependency also gives you one place to read configuration, substitute a test client, or apply tenant-specific credentials without putting API keys in route code.

For public endpoints, expose a response model containing only the fields your frontend or agent needs. That keeps your contract stable as TickerDB adds fields, makes OpenAPI output useful, and prevents a full upstream response from becoming an accidental part of your API.

python dependencies.py
import os
from typing import Annotated
from fastapi import Depends
from tickerdb import AsyncTickerDB

def market_client() -> AsyncTickerDB:
    return AsyncTickerDB(os.environ["TICKERDB_API_KEY"])

MarketClient = Annotated[AsyncTickerDB, Depends(market_client)]

Feed an AI agent.

TickerDB's categorical-first output is designed for LLMs. Feed a summary directly into a prompt — the model already understands terms like "oversold" and "strong_uptrend" without extra context.

python
import anthropic
from tickerdb import AsyncTickerDB

client = AsyncTickerDB("tdb_your_api_key")
ai = anthropic.Anthropic()

@app.get("/briefing/{ticker}")
async def get_briefing(ticker: str):
    summary = (await client.summary(ticker))["data"]

    message = ai.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=1024,
        messages=[{
            "role": "user",
            "content": f"Analyze this market data for {ticker} and provide a brief:\n{summary}"
        }]
    )

    return {"analysis": message.content}

What you can call.

Every method returns a dict with `data` and `rate_limits`. No raw data to parse, no indicator math to maintain.

client.summary("AAPL")

Full technical + fundamental snapshot for a single asset.

client.search(filters={...})

Search across all assets with multi-field filters.

client.schema()

Discover all queryable fields and their types.

client.watchlist(["AAPL"])

Batch EOD summaries for a portfolio.

client.watchlist_changes()

State changes for your saved watchlist tickers.

client.create_webhook(url=...)

Create a webhook for watchlist change alerts.

client.list_webhooks()

List the webhooks on your account.

client.delete_webhook(id)

Delete a webhook you no longer need.

What your agent sees.

Every tool returns categorical facts — not raw OHLCV data. Your agent can branch on "oversold" without needing to know what RSI > 70 means.

json
{
  "ticker": "NVDA",
  "data_status": "eod",
  "as_of_date": "2026-04-11",
  "trend": {
    "direction": "strong_uptrend",
    "ma_alignment": "aligned_bullish"
  },
  "momentum": {
    "rsi_zone": "overbought",
    "macd_state": "expanding_positive",
    "direction": "accelerating"
  },
  "volatility": {
    "regime": "normal",
    "regime_trend": "stable"
  },
  "fundamentals": {
    "valuation_zone": "fair_value",
    "pe_vs_historical_zone": "premium",
    "last_earnings_surprise": "beat"
  }
}

Built for how agents consume data.

Market-state data, less prompt engineering

Responses like "rsi_zone": "oversold" are already in a format the model understands. No need to explain what RSI > 70 means.

Compact responses

Tool-call context windows are limited. TickerDB responses are a fraction of the tokens you'd need to pass raw OHLCV data.

Pre-computed data

No infrastructure to maintain. No cron jobs, no indicator math. TickerDB handles computation and syncing.

Start building.

Try for free. No credit card required.