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 over a rolling 15-day window of U.S. option trades: premium, Greeks, IV, and contract metadata. Then promote the same logic against the live WebSocket feed.
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.
Reuse metric definitions across research and live processing. Historical premium, side, sentiment and DTE are derived; AGGREGATED stream events differ from individual RAW trades.
Pull full chains over REST for bid/ask, open interest, and IV surface context around a signal timestamp.
Map historical RAW fields to the WebSocket payload, including derived premium, side and sentiment. Choose RAW or AGGREGATED deliberately for production scanners.
SELECT
toStartOfHour(time) AS hour,
symbol,
sum(toFloat64(price) * size * 100) AS premium,
avg(delta) AS avg_delta,
avg(iv) AS avg_iv,
count() AS trades
FROM RawOptionTrades
WHERE date >= today() - 7
AND symbol = 'AAPL'
GROUP BY hour, symbol
ORDER BY hour, premium DESC
LIMIT 1000Pair historical SQL with flow definitions and chain docs for full research loop.
Yes. OptionData’s historical API accepts SELECT queries over ClickHouse against the past 15 days of U.S. option trades (a rolling 360-hour window), 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.