Historical GEX Per Strike API — Access Options Gamma Exposure Data Programmatically
How to access historical gamma exposure (GEX) data per strike through an API. Learn why historical GEX per strike matters for backtesting, regime analysis, and building quantitative options strategies.
If you have worked with gamma exposure data, you already know the value of real-time GEX. You can see where dealers are positioned, where the call wall sits, and whether the market is in a positive or negative gamma regime. (If this is new to you, start with our complete guide to gamma exposure.)
But real-time GEX only tells you what is happening right now. To build trading strategies, validate hypotheses, or train models, you need to know what happened before. You need historical GEX per strike — the full gamma exposure surface across every strike and expiration, captured at regular intervals over weeks, months, or years.
This data barely existed until recently. Most platforms show you today's GEX chart and nothing else. There is no archive, no downloadable history, no API endpoint that returns last Tuesday's per-strike gamma. That is starting to change.
What Is Historical GEX Per Strike?
Historical GEX per strike is a time series of gamma exposure values calculated at each option strike price for a given underlying, recorded at regular intervals (typically end-of-day or intraday snapshots).
The gamma exposure at a single strike price, calculated as the gamma of all open contracts at that strike multiplied by open interest and the contract multiplier. It represents the dollar-value of dealer hedging pressure concentrated at that specific price level.
A single snapshot of per-strike GEX gives you a bar chart — tall bars at strikes where dealers have heavy exposure, small bars where they do not. A historical series of these snapshots gives you a heatmap that shows how dealer positioning evolved over time. You can see call walls form, migrate, and dissolve. You can watch the gamma flip point shift as new options are listed and old ones expire.
A three-dimensional representation of gamma exposure: strike price on one axis, time on another, and GEX magnitude on the third. The surface reveals structural patterns in dealer positioning that are invisible in single-day snapshots.
The standard calculation at each strike k and timestamp t is:
Where the sum runs over all expiration dates j at strike k. This collapses the expiration dimension and gives you the total dealer hedging pressure at each strike for a given point in time.
Why Historical GEX Per Strike Matters
Real-time GEX data tells you the current state of the game. Historical GEX data tells you the rules of the game — the patterns, the tendencies, the edge cases that only show up when you look at thousands of observations.
Backtesting Gamma-Aware Strategies
You cannot backtest a strategy that uses GEX levels if you do not have historical GEX levels. It sounds obvious, but this is the single biggest blocker for quantitative traders who want to incorporate gamma exposure into their models.
Consider a simple strategy: sell SPY iron condors when net GEX is positive and the call wall is within 2% of spot, then exit before OPEX. To know whether this has positive expectancy, you need historical per-strike GEX to reconstruct the call wall location, the net GEX regime, and the gamma flip point for every trading day in your backtest window.
- Backtest gamma-regime strategies with real data
- Validate call wall / put wall as support and resistance
- Measure how gamma flip accuracy varies by market regime
- Train ML models on dealer positioning features
- Identify seasonal patterns in gamma structure (OPEX cycles, earnings)
- Forward-test only — months or years to validate
- Rely on anecdotal observations from live trading
- Cannot quantify edge or measure statistical significance
- No way to train or evaluate predictive models
- Cannot reproduce or audit past research
Regime Analysis and Research
Academic and professional researchers use historical GEX to study market microstructure. Questions that require historical per-strike data include:
- How does the gamma flip point predict realized volatility over the next 1, 5, and 20 days?
- Do call walls act as statistically significant resistance levels?
- How does dealer gamma exposure change in the three days before OPEX vs. the three days after?
- Is there a measurable relationship between the concentration of gamma at a single strike and price pinning at expiration?
- How does GEX structure differ during low-VIX vs. high-VIX environments?
None of these questions can be answered with a single day's data. You need the full per-strike history.
Feature Engineering for Quantitative Models
For systematic and algorithmic traders, historical GEX per strike is a feature source. Common derived features include:
| Feature | Derivation | Use Case |
|---|---|---|
| Net GEX regime | Sum of all per-strike GEX | Volatility regime classification |
| GEX concentration ratio | Top-3 strikes' GEX / total GEX | Pinning probability estimation |
| Call wall distance | (Call wall strike - spot) / spot | Resistance proximity signal |
| GEX skew | Call GEX - Put GEX above spot | Directional hedging bias |
| Gamma flip velocity | Daily change in flip point | Regime transition detector |
| GEX decay rate | Change in total GEX into OPEX | Expiration impact forecasting |
These features are impossible to construct without per-strike granularity. Aggregate-only GEX data (a single net number per day) is insufficient — you need the full strike distribution.
What Historical GEX Per Strike Data Looks Like
A well-structured historical GEX per strike dataset includes the following fields for each record:
{
"symbol": "SPY",
"date": "2026-02-14",
"spot": 598.42,
"strikes": [
{
"strike": 570,
"call_gex": 12450000,
"put_gex": -34200000,
"net_gex": -21750000,
"call_oi": 8420,
"put_oi": 15300
},
{
"strike": 575,
"call_gex": 18900000,
"put_gex": -28700000,
"net_gex": -9800000,
"call_oi": 12100,
"put_oi": 11800
},
{
"strike": 580,
"call_gex": 45600000,
"put_gex": -22100000,
"net_gex": 23500000,
"call_oi": 22400,
"put_oi": 9600
}
// ... all strikes
],
"summary": {
"net_gex": 1842000000,
"gamma_flip": 585.00,
"call_wall": 600,
"put_wall": 575
}
}
Each record captures the full per-strike breakdown for a given symbol and date. The summary block provides the derived levels (flip, walls) that most traders care about, while the strikes array gives you the raw material to compute any custom metric.
For intraday historical data, add a timestamp field. Intraday snapshots (e.g. every 15 or 30 minutes) let you study how GEX levels shift throughout the trading day — particularly useful for analyzing 0DTE gamma dynamics.
Accessing Historical GEX Per Strike via API
Most GEX data providers only offer real-time data. A handful provide historical access, but typically as flat files or dashboard-only views — not a programmatic API that returns structured JSON you can plug into your code.
FlashAlpha is building historical GEX per strike as an API-first dataset. The endpoint follows the same pattern as the existing real-time GEX API but accepts date parameters:
import requests
# Historical GEX per strike for SPY on a specific date
resp = requests.get(
"https://lab.flashalpha.com/v1/exposure/gex/SPY",
params={"date": "2026-02-14"},
headers={"X-Api-Key": "YOUR_KEY"}
)
data = resp.json()
# Access per-strike breakdown
for strike in data["strikes"]:
print(f"Strike {strike['strike']}: net GEX = {strike['net_gex']:,.0f}")
# Access summary levels
print(f"Call Wall: ${data['summary']['call_wall']}")
print(f"Put Wall: ${data['summary']['put_wall']}")
print(f"Gamma Flip: ${data['summary']['gamma_flip']}")
For date range queries, a batch endpoint returns multiple days in a single request — critical for backtesting workflows that need months of data without making hundreds of individual API calls:
# Historical GEX over a date range
resp = requests.get(
"https://lab.flashalpha.com/v1/exposure/history/SPY",
params={"from": "2026-01-01", "to": "2026-02-28"},
headers={"X-Api-Key": "YOUR_KEY"}
)
history = resp.json()
# Build a pandas DataFrame for analysis
import pandas as pd
rows = []
for day in history["data"]:
for s in day["strikes"]:
rows.append({
"date": day["date"],
"strike": s["strike"],
"net_gex": s["net_gex"],
"call_gex": s["call_gex"],
"put_gex": s["put_gex"]
})
df = pd.DataFrame(rows)
print(f"Loaded {len(df)} strike-day records")
print(f"Date range: {df['date'].min()} to {df['date'].max()}")
Historical GEX per strike is on the FlashAlpha roadmap for Q3 2026. The real-time per-strike GEX API is available now. If you want early access to the historical dataset, request early access or check the API documentation for current availability.
Building a GEX Heatmap from Historical Per-Strike Data
One of the most powerful visualizations you can build with historical GEX per strike data is a GEX heatmap — a 2D plot with time on the x-axis, strike price on the y-axis, and color intensity representing the magnitude of gamma exposure at each point.
import matplotlib.pyplot as plt
import numpy as np
# Pivot the DataFrame into a heatmap matrix
pivot = df.pivot_table(
index="strike",
columns="date",
values="net_gex",
fill_value=0
)
fig, ax = plt.subplots(figsize=(14, 8))
im = ax.pcolormesh(
pivot.columns.astype(str),
pivot.index,
pivot.values,
cmap="RdYlGn",
shading="auto"
)
ax.set_xlabel("Date")
ax.set_ylabel("Strike Price")
ax.set_title("SPY Historical GEX Per Strike Heatmap")
plt.colorbar(im, label="Net GEX ($)")
plt.tight_layout()
plt.show()
This heatmap reveals patterns that are invisible in daily snapshots:
- Call wall migration — watch the brightest green band drift upward during rallies as new call strikes are opened
- Gamma collapse at OPEX — see the sharp drop in intensity on expiration Fridays as contracts settle
- Put wall buildup before earnings — protective put buying creates negative GEX clusters below spot
- 0DTE gamma spikes — if using intraday data, concentrated gamma appears and vanishes within hours
Historical GEX in Backtesting: A Practical Example
Here is a concrete example of how historical GEX per strike data feeds into a backtest. The strategy is straightforward: sell short-term SPY put spreads when the gamma regime is positive and the put wall provides a defined floor.
import pandas as pd
def backtest_gamma_put_spreads(gex_history, price_data):
"""
Entry: sell put spread when net GEX > 0 and
put wall is within 3% below spot
Exit: close at expiration (weekly)
"""
trades = []
for date, gex in gex_history.iterrows():
spot = price_data.loc[date, "close"]
net_gex = gex["net_gex"]
put_wall = gex["put_wall"]
# Entry conditions
if net_gex <= 0:
continue
if (spot - put_wall) / spot > 0.03:
continue
# Sell put at put_wall strike, buy put 5 strikes below
short_strike = put_wall
long_strike = put_wall - 5
# Record the trade for P&L calculation
trades.append({
"entry_date": date,
"spot_at_entry": spot,
"short_strike": short_strike,
"long_strike": long_strike,
"net_gex": net_gex,
"put_wall": put_wall
})
return pd.DataFrame(trades)
Without historical GEX per strike, you cannot reconstruct the put_wall value for each date — and the entire strategy is untestable. This is the core problem that historical GEX data solves.
Challenges with Historical GEX Data
Historical GEX per strike is not a simple dataset to produce or consume. Understanding the challenges helps you avoid pitfalls.
Data Volume
A single symbol like SPY can have 200+ active strikes across multiple expirations. Capturing per-strike GEX for 500 symbols daily generates millions of records per month. For intraday snapshots, multiply by 13 (one per 30-minute interval in a 6.5-hour trading day). This is why most providers do not offer the data — it is expensive to compute, store, and serve.
Methodology Consistency
GEX calculations involve assumptions — dealer positioning (are dealers always short?), sign convention (call gamma positive or negative?), and whether to use trade volume or open interest. If the methodology changes mid-series, your backtest results are unreliable. When evaluating a historical GEX data source, confirm that the calculation methodology has been consistent over the full history.
Survivorship and Symbol Changes
Options are listed and delisted. Symbols change (mergers, ticker changes). Strike prices that existed a year ago may no longer be active. A robust historical GEX dataset must account for the strikes that existed at the time, not backfill with today's available strikes.
Look-Ahead Bias
End-of-day GEX snapshots reflect the full day's trading. If your backtest uses end-of-day GEX to make decisions that would have been made during the day, you are introducing look-ahead bias. For intraday strategies, you need intraday GEX snapshots with proper timestamps — and your backtest should only use data available at the time of the simulated decision.
FlashAlpha's historical GEX API will include metadata for each snapshot — the exact calculation timestamp, methodology version, and data source — so you can build backtests with full audit trails.
Comparing Historical GEX Data Sources
The market for historical gamma exposure data is still maturing. Here is how the main approaches compare:
| Source Type | Per-Strike | API Access | History Depth | Limitation |
|---|---|---|---|---|
| Free GEX dashboards | Sometimes | No | Current day only | No historical data at all |
| Premium GEX platforms | Yes | Limited | 30-90 days | Dashboard-only, no programmatic access |
| Raw OPRA data + DIY | Yes | Self-built | Years | Requires infrastructure, licensing, and expertise to compute GEX |
| FlashAlpha Historical GEX API | Yes | REST API | Growing (Q3 2026 launch) | Newer dataset, history depth expanding |
The DIY approach — buying raw options data from OPRA or CBOE and computing your own GEX — gives you full control but requires significant engineering effort. You need to handle options pricing models (Black-Scholes or binomial), dividend and interest rate adjustments, and the infrastructure to process terabytes of tick data. Most quant teams that go this route spend weeks just on the data pipeline before writing a single line of strategy code.
An API-first historical GEX service eliminates that infrastructure cost. You get the same per-strike data in structured JSON, ready to plug into pandas, R, or any language — without managing data pipelines.
Use Cases Beyond Backtesting
Historical GEX per strike data serves several quantitative workflows beyond simple strategy backtesting:
Volatility Regime Classification
By studying historical net GEX alongside realized volatility, you can build classifiers that predict the volatility regime for the next 1-5 days. Research shows that transitions through the gamma flip (positive to negative or vice versa) are among the strongest predictors of short-term volatility changes.
OPEX Impact Analysis
Historical per-strike data lets you quantify how much gamma expires on each OPEX, and how the resulting "gamma unpin" affects subsequent price action. You can build models that predict post-OPEX volatility based on the amount and distribution of expiring gamma.
Event Studies
How does GEX structure change around FOMC announcements? Earnings? CPI releases? Historical data lets you run proper event studies — aligning the GEX surface to event dates and measuring average structural changes in dealer positioning before and after.
Risk Management
Portfolio managers can use historical GEX to stress-test positions against different gamma regimes. If your portfolio historically underperforms during negative-gamma periods, you can use real-time GEX as a hedge trigger — but only if you have the historical data to establish that relationship first.
Getting Started with GEX Data
Whether you are waiting for the historical dataset or ready to start with real-time data, here is how to begin incorporating gamma exposure into your workflow:
-
Explore real-time GEX visually
Use the FlashAlpha GEX tool to get comfortable reading per-strike gamma exposure charts. Identify the call wall, put wall, and gamma flip for SPY and a few single-name stocks you trade.
-
Query the real-time GEX API
Use the GEX API endpoint to pull structured per-strike data into your code. Start building the data pipeline that will later consume historical data.
-
Start archiving
While waiting for the full historical dataset, you can start archiving daily GEX snapshots from the real-time API. A simple cron job that calls the endpoint at market close and saves the response to a database gives you a growing history you can backtest against immediately.
-
Build your features
Define the GEX-derived features you want to use in your models (net GEX, call wall distance, GEX concentration, flip velocity). Test them on your growing archive before the full history is available.
Explore per-strike gamma exposure with the GEX Tool, read the API documentation, or request early access to the historical GEX per strike API.