Build a GEX Dashboard with an API: Gamma Exposure Monitor for Developers | FlashAlpha
gex · 16 min read

Build a GEX Dashboard with an API: Gamma Exposure Monitor for Developers

Build a runnable Python GEX dashboard with saved samples, then try live AAPL, full-chain SPY or historical replay. Includes a notebook, correct response parsing, expiry discovery and access checks.

T
Tomasz Dobrowolski Quant Engineer
Mar 29, 2026
Updated Oct 15, 2026
16 min read
GEX GammaExposure API Dashboard Python DeveloperGuide OptionsAnalytics
Run the finished example first

Download the GEX dashboard, notebook and sample responses (ZIP). Extract all files together, run python dashboard.py, and open dashboard.html. Python 3.10 or later is the only requirement for the script. The default run uses a saved historical SPY sample, requires no key, and makes no network requests.

You will build a standalone HTML monitor with net GEX, a per-strike chart, reported gamma flip, call and put walls, timestamps, input provenance and a complete strike table. The same script can explicitly request live data or Alpha replay. It performs one refresh per run; it is a starting point for an internal monitor, not a production streaming service.

Choosing a vendor first? Read the options data API workflow comparison. If you want to see levels without writing code, the Free GEX guide separates public snapshots from authenticated API access.

1. Run the Dashboard Without a Key

  1. Download and extract the ZIP. Keep dashboard.py, gex.json, levels.json and manifest.json in the same folder.
  2. Open a terminal in that folder. Run the command below; on Windows, py may be your Python launcher.
  3. Open dashboard.html in a browser. The adjacent dashboard.responses.json preserves the request context and both payloads.
python dashboard.py
# Windows launcher alternative: py dashboard.py

Expected saved output: SPY at 2026-03-05T15:30:00 Eastern, underlying price 679.46, net GEX −14,504,525,330.20 dollars per 1% move, gamma flip 687.171655677348, call wall 685 and put wall 675. The script checks fixture hashes before parsing. These are historical sample values, not today's market.

Saved SPY per-strike net GEX: negative exposure concentrated near spot, with spot and the reported gamma flip marked.
Actual chart from the saved response. Blue bars are positive, red bars negative; dashed lines mark spot and the reported flip. The chart narrows to ±15% of spot; headline totals retain the full requested chain.

Open the complete dashboard preview. It includes the text table and provenance panels. The pack also includes evaluation.ipynb for Jupyter and evaluation.csv for documenting a provider comparison.

2. Parse GEX and Levels as Separate Responses

The GEX endpoint returns net_gex, net_gex_label, gamma_flip, underlying_price, as_of and strikes. Walls come from /v1/exposure/levels/{symbol}, inside its nested levels object. A single GEX request does not supply the entire dashboard.

# Response parsing used by the downloaded script, after validation:
spot = gex["underlying_price"]
net_gex = gex["net_gex"]
strikes = gex["strikes"]
key_levels = levels["levels"]
call_wall = key_levels.get("call_wall")
put_wall = key_levels.get("put_wall")
gamma_flip = gex.get("gamma_flip")
# The flip and its certification must come from the GEX response.
# Walls cover all expirations; levels has no expiration filter.
# Keep None as "Not published". Do not turn it into a zero-dollar level.

The complete script rejects invalid numbers, empty strike arrays, missing timestamps and mismatched symbols. It sorts strikes numerically and escapes displayed text. A null wall remains absent. Different as_of values produce a warning because two live requests are not an atomic snapshot. Preserve both timestamps instead of pretending they were sampled simultaneously.

Match the scope to the metric. GEX accepts an expiration filter; levels always covers all expirations. In the single-expiry starter, totals, bars, gamma flip and gamma_flip_status come from GEX. Call and put walls are explicitly labeled all-expiration context. A missing GEX flip stays missing even if levels reports a full-chain flip. Each endpoint's actual parameters and expiration scope are saved separately.

3. Switch to an Eligible Live Request

Create an API key in your profile and set FLASHALPHA_API_KEY in your terminal environment. Keep it out of the script, notebook, browser JavaScript and version control. With remaining Free allowance, run:

python dashboard.py --live

This selects AAPL and performs three requests: /v1/options/AAPL, GEX for the earliest listed expiration after today, and levels across all expirations. The selected date is sent only to GEX. Expirations are objects with an expiration field, not a list of date strings. The code excludes today's expiry, uses a conservative UTC-date cutoff near US midnight, and stops if no eligible date exists. It does not hard-code an expiry that will become invalid.

To select another listed future expiry, add --expiration YYYY-MM-DD, replacing the placeholder with a date actually returned by discovery. The script validates it against that list. To change symbol, use --symbol NVDA. ETF and index symbols need Basic and above even when you filter to one expiry.

WorkflowAccessCalls per run
Saved SPY exampleNo account; bundled replay only0
AAPL, one expiry after todayFree, 5 requests/day3 including expiry discovery
SPY, one expiry after todayBasic, 250 requests/day3 including expiry discovery
SPY full chain or supported CME futuresGrowth, 2,500 requests/day2 without discovery
Own historical decision timestampAlpha, supported archive routes and coverage2
# Growth+: aggregate all expirations, without an expiration parameter
python dashboard.py --live --symbol SPY --full-chain

# Alpha: Eastern wall-clock, without Z or a UTC offset
python dashboard.py --historical --symbol SPY --at 2026-03-05T15:30:00

New accounts need Growth and above for 0DTE; this starter intentionally excludes it from expiry discovery. Historical requests use the historical host and do not discover dates from today's live chain. Follow the historical sample and coverage checks before changing replay dates. For gold, the GLD versus GC workflow uses the same script with instrument-specific units.

4. Stop Cleanly on Access, Quota and Data Errors

  • 401: check the key. No response body or authentication header is written to the output.
  • 403: check symbol class, expiry and endpoint access. An upgrade is relevant only if the requested workflow requires it.
  • 404 or empty chain: check symbol, expiry and historical coverage.
  • 429: stop and inspect quota plus Retry-After. The script prints the returned retry interval and does not loop.
  • Timeout, invalid JSON or wrong schema: stop with an explanation. Failed live requests never silently become saved sample data.

Every authenticated request consumes allowance. Running the default live example twice uses six requests; compare that with the 5-request Free daily allowance. A 20-symbol monitor with GEX and levels refreshed 78 times uses 3,120 requests before metadata or retries. Cache metadata, choose a deliberate cadence, and compare the request budget with current plans before scheduling it.

5. Explain Gamma Flip Without Inventing a Trading Signal

A per-strike GEX chart groups exposure at the current underlying price. A gamma flip is an underlying-price boundary found by repricing aggregate gamma across hypothetical prices. Crossing zero in the bars, or in their cumulative sum, is a different operation and does not reconstruct that boundary.

net_gex_label describes the total's sign. It is not interchangeable with the API's certified regime. Read gamma_flip_status where present: an unverified numeric root, a withheld level, or an uncertified side at spot can require an unknown regime. The older bundled fixture lacks this status, so the dashboard displays the reported level and warns that it does not infer a certified regime. See the gamma-flip methodology.

Structural exposure applies settled OI and fixed calls-positive/puts-negative signs. Actual dealer positions are not observed. Positive-gamma inventory can imply selling into rises and buying declines; negative-gamma inventory reverses that hedge response. A structural sign alone does not prove those inventories, predict the next return, or make a wall guaranteed support or resistance.

6. Extend the Monitor Deliberately

Add refresh scheduling only after the one-run flow works. Keep the key on a server, log each request's symbol, parameters, response time and provenance, retain the last valid response with its original timestamp, and distinguish stale data from a new observation. FlashAlpha plans cover internal use; FlashAlpha does not offer redistribution, public embedding or resale. If a ready-made screen is the real goal, compare GEXRadar and Quant Data before building your own.

Frequently Asked Questions

Yes, for an individual equity such as AAPL and one listed expiration after today. The live starter makes three calls, within the 5-request Free daily allowance when enough allowance remains. SPY single-expiry requests need Basic and above; full-chain aggregation needs Growth and above.

No. This example requests GEX and levels separately. Read all-expiration walls from the nested levels object; the expiration filter applies only to GEX. Preserve each response timestamp and scope.

No. Gamma flip is a repriced aggregate underlying-price boundary. Use the published level and certification status; preserve unknown or missing values.

No. The default example uses a saved historical replay at March 5, 2026, 15:30 Eastern. Live mode is an explicit authenticated option and produces different data.

Start with the downloadable example, inspect its saved output, then request a symbol and expiry your key supports. Keep timestamps, nulls, units and provenance visible as you extend it.

Live Market Pulse

Get fast visibility into market shifts with full-chain analytics over low-latency REST and MCP polling.

Intelligent Screening

Screen millions of option pairs per second using your custom EV rules, filters, and setups.

Export-Ready

Export structured signals to your own execution stack or broker integration - FlashAlpha delivers the analytics, you keep control of order routing.

Join the Community

Discord

Engage in real time conversations with us!

Twitter / X

Follow us for real-time updates and insights!

GitHub

Explore our open-source SDK, examples, and analytics resources!