---
title: "Stock market API in Python: quotes, options flow, dark pools and SEC filings | Tradytics"
description: "Install pip install tradytics (zero dependencies, Python 3.8+) to pull US stock quotes, historical bars, options chains, stitched options flow, dealer gamma, dark pools, fundamentals and SEC filings from one client."
url: "https://tradytics.com/learn/stock-market-api-python"
image: "https://tradytics.com/api/v2/og/learn.png?id=stock-market-api-python"
---

# Stock market API in Python: quotes, options flow, dark pools and SEC filings

By [Faizan Ahmad](https://tradytics.com/learn/about-tradytics-research). Updated 2026-11-24.

**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](https://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](https://tradytics.com/docs/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.

## Get the Tradytics API

Stock data, company research, options flow, dark pools, dealer exposure, prediction markets and more through REST and MCP. Free gets 5 calls a minute and 50 a day. Plus gets 10 a minute and 1,000 a day. Pro gets 300 a minute and 50,000 a day.

[Read the API docs](https://tradytics.com/docs)

Using Claude, ChatGPT or Cursor? [Connect Tradytics MCP free](https://tradytics.com/docs/mcp).

- [Tradytics Learn](https://tradytics.com/learn)
- [Insider trading, 13F institutional holdings and Congress trades API](https://tradytics.com/learn/insider-trading-api)
- [Stock market API in JavaScript and TypeScript (Node, Bun, Deno)](https://tradytics.com/learn/stock-market-api-javascript)
- [Pay-per-call stock market data API with x402 (USDC on Base)](https://tradytics.com/learn/x402-market-data-api)
- [Stock fundamentals, revenue segments and earnings transcripts API](https://tradytics.com/learn/stock-fundamentals-api)
- [Options chain, Greeks, open interest and dealer gamma API](https://tradytics.com/learn/options-chain-api)
- [SEC filings API: 10-K, 10-Q, 8-K sections and semantic passage search](https://tradytics.com/learn/sec-filings-api)
- [Read the data without JavaScript](https://tradytics.com/learn/stock-market-api-python?snapshot=1)
