Query history with SQL
POST SELECT queries to the historical API — ClickHouse syntax for filters, aggregations, and window-style analysis on RawOptionTrades.
Run custom SQL against a multi-billion-row U.S. options warehouse — premium, Greeks, IV, and contract metadata — then promote the same logic against the live WebSocket feed.
Who this is for: quant researchers, systematic desks, and data scientists who need historical options prints via SQL (not only REST pagination) and a path from notebook backtests to production alerts.
Explore with SQL, validate features with chain snapshots, then wire production monitors on the same licensed dataset.
POST SELECT queries to the historical API — ClickHouse syntax for filters, aggregations, and window-style analysis on RawOptionTrades.
Use premium, size, side, DTE, Greeks, and IV fields that exist on both historical rows and live prints to avoid train/serve skew.
Pull full chains over REST for bid/ask, open interest, and IV surface context around a signal timestamp.
Stream the same field schema over WebSocket (~10M trades/day) for production scanners without switching vendors.
SELECT
toStartOfHour(timestamp) AS hour,
symbol,
sum(size * price * 100) AS premium,
avg(delta) AS avg_delta,
avg(implied_volatility) AS avg_iv,
count() AS trades
FROM RawOptionTrades
WHERE date BETWEEN '2025-06-01' AND '2025-06-30'
AND symbol IN ('AAPL', 'NVDA', 'TSLA')
GROUP BY hour, symbol
ORDER BY hour, premium DESC;Pair historical SQL with flow definitions and chain docs for end-to-end research.
Yes. OptionData’s historical API accepts SELECT queries over ClickHouse against stored U.S. option trades (2.8B+ rows from Feb 2025+), including premium, Greeks, and IV fields where available.
Yes for trade-print research and rule backtests on the stored tape. You define strategy logic in SQL or your notebook; OptionData provides the underlying prints and chain snapshots.
Use the same field semantics on the WebSocket feed for live scoring. One API key covers historical SQL, real-time flow, and option-chain REST.
Yes. Queries are SELECT-only with table allowlists, timeouts, and row/byte caps. Free trial SQL responses are capped (e.g. 10 rows) so you can validate connectivity before upgrading.