---
name: datafirst-derivatives-api
description: Read dealer gamma exposure, key levels, Greeks exposures, order flow, tape, sweeps and volatility for US listed options from the DataFirst Derivatives API, live and for every finished session.
---

# DataFirst Derivatives API

Use this when a question needs options-market structure for a US symbol: where the gamma flip, call wall and put wall sit,
how exposure is distributed by strike and expiration, what premium flowed and which way, what traded (tape, sweeps), what
the chain's volatility says, or any of that at a past minute or over past sessions.

## How to call it
- Base URL `https://api.datafirsttrading.com`, header `Authorization: Bearer <key>`. Start with `GET /v1/me` (your rate, burst, history reach, limits).
- Live: `/v1/symbols/{symbol}/levels`, `/strikes`, `/heatmap`, `/contracts`, `/flow`, `/spot`, `/vol`, `/v1/tape`, `/v1/sweeps`.
- History: `/v1/sessions` first (the finished sessions you may read), then `/history/levels`, `/history/flow`, `/history/heatmap`,
  `/history/replay`, `/history/iv`, `/history/chain`, `/v1/trades`, `/v1/trades/stats`, the flow aggregates under `/v1/flow/*`.
- Symbols are the familiar tickers (SPY, SPX, NDX, AAPL); `expirations=N` or `term`; dates `YYYY-MM-DD`; `resolution=1s..30m` where offered.
- Units: USD, contracts, fractions; GEX is USD per 1 % move. Times are UTC.

## Rules
- Branch on a problem document's `code`, show its `detail` to a person. Retry only 429, 503, 504 and network errors, by the rule
  in /llms.txt. Never retry an unchanged 4xx.
- Respect `limits` from `/v1/me` (your key's own numbers): a few heavy reads at a time (chain files, session ranges, exports), and the address ceiling; a `429` carries `Retry-After`: wait that long.
- Market data from this API is licensed to the key's holder; do not redistribute it.
- The full reference is at /docs/api.md; one section per endpoint at /docs/endpoints/<name>.md; the OpenAPI document at /v1/openapi.json.
- The MCP server `python -m datafirst_mcp` gives one tool per endpoint plus `session_summary`, `replay_at` and `chart`.
