Stock market API in Python: quotes, options flow, dark pools and SEC filings
By Faizan Ahmad. Updated .
The official Tradytics Python SDK (pip install tradytics) gives Python 3.8+ developers zero-dependency access to US stock quotes, historical bars, options chains, stitched options flow, dealer gamma, ranked dark pools, company fundamentals, SEC semantic search, earnings transcripts and prediction markets. Every endpoint works on the Free tier (50 calls a day, no credit card), with built-in pagination, retries and live streaming.
Install and authenticate
pip install tradytics
export TRADYTICS_API_KEY="tdy_..."
Get a free API key at tradytics.com/developer/keys. Pass it via TRADYTICS_API_KEY or directly as Client("tdy_...").
Core Python recipes
from tradytics import Client
client = Client()
# 1. Quotes and historical OHLCV + VWAP bars
quotes = client.stocks.quotes(symbol="AAPL,NVDA,SPY")
bars = client.stocks.bars(symbol="SPY", timeframe="5m", limit=100)
# 2. Stitched OPRA options flow and dealer gamma
flow = client.options.flow(symbol="NVDA", min_premium=1000000, opening=True)
gamma = client.options.exposure(symbol="SPY", greek="gamma", dte=0)
# 3. Ranked dark pool prints and levels
prints = client.darkpool.prints(symbol="AAPL", max_rank=10)
levels = client.darkpool.levels(symbol="AAPL")
# 4. Fundamentals, transcripts and semantic SEC filing search
income = client.fundamentals.income_statement(symbol="AAPL", period="quarter", limit=8)
risks = client.filings.search(q="supply chain risks", symbol="AAPL", form="10-K")
Auto-pagination and live streaming
# Iterate through every page automatically
for row in client.paginate(client.options.flow, symbol="TSLA", min_premium=500000, from_="2026-10-01"):
print(row["time"], row["type"], row["strike"], row["premium_usd"])
# Stream new options prints live (polls every 2 seconds, yields each print once)
for row in client.stream(client.options.flow, min_premium=250000):
print(row["symbol"], row["side"], row["premium_usd"])
Running the Python MCP server
If you are building a Python AI agent (LangChain, CrewAI, Agno or OpenAI Agents SDK), install the zero-dependency Python MCP bridge (pip install tradytics-mcp or uvx tradytics-mcp) or connect directly to https://tradytics.com/mcp. Full method reference in SDK libraries.
Common questions
Does the Tradytics Python SDK require pandas or requests?
No. It uses only the Python 3.8+ standard library (urllib) and returns plain JSON dicts/lists that load straight into pandas, Polars or Pydantic models.
How does the Python client handle rate limits?
HTTP 429 per-minute limits and 5xx errors are retried up to three times honoring Retry-After; daily quota errors raise TradyticsError cleanly with status, code and request ID.