Back to blog

Market Structure API: Full-Chain GEX in One GET

Introducing the Market Structure API—precomputed symbol snapshots with Gamma Exposure by strike and expiry, Gamma Flip, OI walls, Max Pain, IV context, session flow, and five-minute intraday GEX.

5 min readOptionData
market-structuregexgamma-exposureapiresttutorial
STRATEGYOptionData blogFeedFilterScoreAlertSPY $1.2MQQQ $860KNVDA $2.1M

Today we're shipping the Market Structure API, the fourth member of the OptionData family alongside the realtime WebSocket feed, historical SQL, and the option-chain REST endpoint. One GET, one symbol, and you get a precomputed full-chain positioning snapshot: dealer-style Gamma Exposure (GEX), open-interest walls, Gamma Flip, Max Pain, volatility context, session flow, and an optional five-minute intraday GEX summary.

No SQL. No socket to keep open. No assembling strikes yourself.

What you get

Ask for a root (for example SPY or AAPL) and receive a self-contained JSON document:

One snapshot, four layers

  • Structure: call/put GEX · walls · Gamma Flip · Max Pain · strikes × expirations

  • Intraday GEX: full-chain call_gex / put_gex · spot · ~5 min refresh in session

  • Flow: call/put premium · bullish/bearish DEX · trade counts

  • Symbol meta: prices · IV30 · IV rank/percentile · skew · term slope · sector

It is the same OPRA-licensed U.S. equity options dataset that powers our other APIs, shaped for positioning dashboards instead of a trade stream or a filterable contract list.

When to reach for it

OptionData now gives you four ways into one dataset. Pick the shape that fits the job:

JobProduct
Live prints and flow alertsRealtime · WebSocket
Custom research over the tapeHistorical · SQL
Filterable contract quotes & GreeksOption Chain · REST
GEX, walls, Max Pain, IV regime on the whole chainMarket Structure · REST

Where it fits: levels and walls for breakout validation, gamma squeeze setups, and desk-style “where is the zero gamma?” views without recomputing exposure from raw chains every request.

Quick start

Grab your API key

Sign in, start your free Pro trial, and copy your API key from the dashboard. The same key works for realtime, historical SQL, option chain, and market structure.

GET a symbol

Authenticate with Bearer and pass the option root in the path.

curl "https://www.optiondata.io/api/v1/market-structure/SPY" \
  -H "Authorization: Bearer YOUR_API_KEY"

Optional historical snapshot:

curl "https://www.optiondata.io/api/v1/market-structure/SPY?date=2026-07-24" \
  -H "Authorization: Bearer YOUR_API_KEY"

Read structure and levels

Use data.structure for GEX by strike/expiry and levels, data.symbol_meta for IV context, data.flow for session premium, and data.intraday_gex when the five-minute summary is present.

The request

GET https://www.optiondata.io/api/v1/market-structure/:symbol
PieceNotes
Path symbolUnderlying option root (SPY, SPXW, AAPL, …). Uppercased server-side.
Query dateOptional YYYY-MM-DD for a retained historical snapshot. Omit for the active/latest snapshot.
AuthAuthorization: Bearer YOUR_API_KEY (apikey_… from the portal).

Included with the Pro plan (trialing or active). Rate limits match other HTTP data APIs (about 60 requests per 60 seconds per key; 429 + Retry-After when exceeded).

Response shape (v1)

Top-level:

{
  "data": {
    "symbol": "SPY",
    "symbol_meta": { },
    "flow": { },
    "intraday_gex": { "spot": 0, "call_gex": 0, "put_gex": 0 },
    "structure": {
      "spot": 0,
      "call_oi": 0,
      "put_oi": 0,
      "call_gex": 0,
      "put_gex": 0,
      "scopes": { "all": { }, "zero_dte": { }, "weekly": { }, "monthly": { } },
      "max_pain_curve": [ ],
      "expirations": [ ]
    }
  },
  "meta": {
    "effective_date": "2026-07-24",
    "structure_as_of": "2026-07-24T20:15:00.000Z",
    "flow_as_of": "2026-07-24T20:15:00.000Z",
    "intraday_gex_as_of": "2026-07-24T20:15:00.000Z"
  }
}

Highlights

  • structure.call_gex / put_gex — full-chain dollar GEX for a 1% move. Put GEX is signed negative under a documented dealer-short-put convention. Net GEX ≈ call_gex + put_gex.
  • scopes — levels for all, zero_dte, weekly, monthly (Gamma Flip, Max Pain, call/put GEX walls, call/put OI walls).
  • expirations[] — strike-level call/put OI and GEX grouped by expiration (the “board” for heatmaps).
  • intraday_gex — lightweight full-chain GEX + spot; can refresh about every five minutes in the regular session when available.
  • meta.structure_as_of — when structural walls / flip / max pain / strike GEX were last built (does not tick with every flow refresh).

Model, not inventory

Dealer positioning is a model, not reported dealer inventory. Treat walls and flip as decision aids, not ground truth about market-maker books.

Python example

import requests

r = requests.get(
    "https://www.optiondata.io/api/v1/market-structure/SPY",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    timeout=30,
)
r.raise_for_status()
body = r.json()
structure = body["data"]["structure"]
meta = body["meta"]

print(body["data"]["symbol"], "spot", structure["spot"])
print("net GEX (model)", structure["call_gex"] + structure["put_gex"])
print("structure as of", meta["structure_as_of"])
print("expirations", len(structure["expirations"]))

Market Structure vs Option Chain

Market StructureOption Chain
Best forPositioning: GEX, walls, flip, max pain, IV regimeContract list: bid/ask, OI, IV, Greeks per strike
ShapeOne symbol snapshotArray of contracts (filterable)
MethodGET /api/v1/market-structure/:symbolPOST /api/option-chain
HistoryRetained sessions (from ~2026-02-20+)Same mart family / session coverage

Use both: structure for the map, chain for the individual contracts on that map.

Coverage and freshness

  • Snapshot history grows with U.S. trading sessions (from about 2026-02-20 forward).
  • Structural fields update on structure builds; flow and intraday_gex can move more often in session.
  • For trade-by-trade history back to 2025-02-18, use Historical SQL (≥15-minute delay). For live prints, use the WebSocket.

One key, four APIs

Included in Pro

Market Structure is included with the Pro plan alongside realtime WebSocket, Historical SQL, and Option Chain. One API key authenticates all four. 14-day free trial; no credit card required to start.

One dataset, four ways in

The realtime feed tells you what is trading now. Historical SQL answers deep questions about the past. Option Chain gives you the board of contracts. Market Structure gives you the positioning map on that board—GEX, walls, and flip—without recomputing exposure from scratch.

Ready to try it? Open the Market Structure page, run a symbol in the playground, and start a free trial.


Run it with the OptionData API. Start a 14-day free trial (no credit card). One key covers Realtime WebSocket, Historical SQL, Option Chain REST, and Market Structure.

OptionData API

You can run this strategy programmatically with the OptionData API. Use Historical SQL for backtests and screens, and the Realtime WebSocket for live flow.

Run this strategy with the OptionData API
Use Historical SQL and Realtime WebSocket to automate the ideas in this guide.
curl -X POST https://www.optiondata.io/api/historical/sql \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "api_key=YOUR_KEY" \
--data-urlencode "sql=SELECT * FROM RawOptionTrades ORDER BY time DESC LIMIT 10"