gexbot api

research

REST endpoint for on-demand gbR options chart assets, 3D volatility surfaces, and tabular CSV/JSON datasets across US optionable equities.

GET/research/{ticker}/{metric}Research Tier
Official Endpoint Specification

Research API Specification & Interactive Builder

The complete REST endpoint specification, accepted parameter schemas, response models, and interactive URL testing tools are maintained directly on the platform.

View Full API Specification & Builder on gexbot.com ↗

Endpoint Overview

The Research API computes on-demand Greek exposures, volatility surfaces, open interest profiles, and price-spread parity. It serves index options, ETFs, and all US optionable equities.

GET /research/{ticker}/{metric}

Architecture & Service Base URLs

  • API Gateway: /research/{ticker}/{metric}
  • Asset Storage & CDN: https://assets.gexbot.com/ (or https://r.gex.bot/). The url field of a descriptor already starts with gbR/.

Operating Hours & Data Cadence

  • Regular Market Hours (09:30–16:00 ET):
    • Evaluates live option market quotes using the gbR pricing model.
    • Caches requests on 15-minute floor intervals on-demand.
  • Index Option Extended Hours (16:00–16:15 ET):
    • Index options (such as SPX and NDX) trade until 16:15 ET.
    • Requests submitted at or after 16:15 ET include trades from this 15-minute post-close window.
  • Premarket Hours (Before 09:30 ET):
    • Open Interest (OI) refreshes daily at 08:00 ET.
    • Calculations use previous session quotes under the gbR model. The premarket cache refreshes once after 08:00 ET.
    • Option volume metrics remain disabled until market open at 09:30 ET.
  • After Hours, Final Snapshots & Weekends:
    • The final scheduled End-of-Day (EOD) snapshot generates every evening at 23:00 UTC (19:00 EDT / 18:00 EST).
    • After 17:00 ET, all after-hours queries return the stabilized closing snapshot from the session.
    • Queries on weekends and market holidays return the cached snapshot from the previous trading session.

Can I request data for a past date?

Most Research API metrics have no date parameter. They use the options chain that the cache holds at request time. The hv metric also supports view=history. It returns daily volatility records, not past options chains. See Daily volatility history.

For past options-chain snapshots, use the gexbot history endpoints:

  • EOD report (GET /hist/eod/{ticker}): the latest End-of-Day ZIP archive for one ticker.
  • Historical download (GET /hist/{ticker}/{package}/{category}/{date}): one day of history, with a Quant API key.

These endpoints serve a different data model. Their files are the Classic, State and Orderflow {package}/{category} snapshots, such as classic/gex_zero and state/delta_one. They do not serve the Research metrics or the skew, term and surface views. They have no strikes, view or DTE parameters, so the strike window of this endpoint does not apply to them. They need a gexbot API key. A Research API key cannot call them.


Option Expiration & Settlement Cadence

  • Settlement Timestamps:
    • AM-Settled Series: Standard monthly index contracts expire at 10:00 ET on their expiration date.
    • PM-Settled Series: Daily and weekly equity and index contracts expire at 16:00 ET on their expiration date.
  • Expired Series Filtering:
    • Contracts drop immediately from active expirations and calculations once the market clock reaches their expiration timestamp.
    • DTE resolution, exposure metrics, and API responses exclude expired contracts automatically.

Authentication & Headers

All requests require a Research API key (prefix research_). You can create one when your account has the Research add-on. The endpoint refuses gexbot keys, including Quant keys, with 403. Pass the key in the Authorization header as a Bearer token:

Authorization: Bearer <YOUR_API_KEY>
User-Agent: <YOUR_APP_NAME>/1.0
Accept: application/json
HeaderTypeRequiredDescription
AuthorizationstringYesBearer token format: Bearer <YOUR_API_KEY>.
User-AgentstringYesUnique identifier for your client application.
AcceptstringYesSet to application/json, or text/csv for the csv format.

Path Parameters

ParameterTypeRequiredExampleDescription
tickerstringYesSPX, NVDA, AAPLTicker symbol of the underlying asset (1 to 6 letters, not case-sensitive). Digits, dots and slashes are not accepted.
metricstringYesgex_oi, iv_mid, oiThe analytical metric or Greek exposure to calculate.

Metric Aliases

The API translates legacy and shorthand metric names to internal engines. Metric names are not case-sensitive.

Request AliasCanonical Engine MetricCategory
oiopen_interestMarket Data
parityput_call_parityMarket Data
gamma_wallgamma_wall_absMarket Data
vol_triggergamma_flipMarket Data
iv_askask_ivImplied Volatility
iv_midmid_ivImplied Volatility
iv_bidbid_ivImplied Volatility
extrinsictime_valueMarket Data

Max Pain (max_pain)

max_pain is a Market Data metric. It has no alias. For each expiration, it finds the strike where the total intrinsic value of all open calls and puts is lowest.

  • The metric ignores view. The default end_dte is 64.
  • An image format draws the max pain strike of each expiration as a line across the expirations.
  • json and csv return one row for each expiration, with the columns EXPIRATION_DATE, STRIKE_PRICE and MAX_PAIN.
  • STRIKE_PRICE is the max pain strike. MAX_PAIN is the total intrinsic value at that strike, in dollars: the sum of intrinsic value × open interest × 100 over the contracts of the expiration. It is not a price.

Query Parameters

The view and type values are case-sensitive. All other values are not. Only the value true (any case) turns a boolean on. Any other value is false. A start_dte or end_dte value that is not an integer resets both parameters to their defaults. For chart formats an empty expiration window moves to the nearest expiration.

ParameterTypeDefaultAccepted ValuesDescription
formatstringwebpwebp, png, jpeg, svg, pdf, json, csvResponse payload format. Image formats return an asset descriptor.
viewstringskewskew, term, surface, mirror, heatmap, what_if, historyChart visualization mode. mirror applies to iv_bid, iv_mid and iv_ask only. heatmap, what_if and history apply to the hv metric (heatmap also applies to exposure, open interest, volume and implied-volatility metrics). Other metrics fall back to skew.
typestringline (bar for oi, volume and exposure metrics; scatter for parity)bar, line, histogram, scatterSeries render style.
themestringdarkdark, lightColor palette for rendered chart images.
strikesinteger15 (50 for oi and volume, 30 for exposure metrics)Integer, minimum 5. Image formats clamp to 5-250. json and csv have no 250 ceiling.Number of listed strikes on each side of the spot price. The value counts strikes, not points or percent of price. One window applies to all expirations. The center is the spot of the requested ticker. For an index such as NDX, the center is the cash index spot, not the futures price. To translate it to a futures price, use indexconverter.com or gexbot.com/converter. The response omits each strike outside the window. For json and csv, a value of 30 or less can return every strike of the chain. This includes the defaults 15 and 30. A value above 30 returns that number of strikes on each side. A value larger than the chain returns the full chain.
rowsinteger500Integer 1-750Number of sessions in the hv heatmap or history view.
start_dteinteger0Integer 0-1000Start days-to-expiration boundary (inclusive).
end_dteinteger98 (365 for view=term, 64 for max_pain)Integer 0-1000End days-to-expiration boundary (inclusive).
expiration_filterstring* (all expirations)* (all), m (monthly), w (weekly), q (quarterly)Keeps only one expiration series. An unknown value takes *. Has no effect on json or csv output.
contract_filterstringallall, calls, putsFilters calculation contracts by option side.
moneyness_filterstringNone (ntm for iv_bid, iv_mid and iv_ask)otm, ntm, itm, atm, d10, d15, d20, d25Filters contracts by moneyness or delta bucket. Default is ntm for iv_bid, iv_mid and iv_ask.
contract_aggbooleantruetrue, falseWhen true, nets calls and puts into one value per strike. When false, keeps calls and puts as separate rows.
expiry_aggbooleanfalsetrue, falseWhen true, aggregates all expiries across each strike.
skew_adjbooleanfalsetrue, falseAdjusts Greek calculations for volatility skew.
limit_ybooleantruetrue, falseClamps the Y-axis scale to remove extreme statistical outliers. Send limit_y=false to disable the clamp.
seriesstringNonedeltas, moneyness, strikesFor IV term view, plots term structure across delta tiers.

Daily volatility history

Request GET /research/{ticker}/hv?view=history with format=json (history returns JSON only). Use rows (1 to 750, default 500) to set the number of sessions.

The response contains an iv_method map and rows in oldest-first order. Each row holds:

  • d: session date (YYYY-MM-DD).
  • src: row source (eod, backfill, or replay).
  • c: session close price, or null when unavailable.
  • hv5 through hv360: 17 historical volatility windows in percent.
  • iv4 through iv365: 14 implied volatility tenors in percent.
  • iv_dte: the DTE (or pair of DTEs) used for each IV tenor.
  • ivn7 through ivn360 (row version 4): the implied volatility of the one expiration nearest each cm tenor, in percent.
  • ivn_dte: the DTE of the expiration used for each ivn value.

The iv_method map marks each tenor as cm (constant maturity) or nearest. The cm method interpolates total variance between two expirations. At an edge, it uses the nearest expiration. The nearest method takes the expiration with the smallest distance in days from the tenor. At an equal distance, it takes the expiration with the lower implied volatility. Rows before version 4 do not have the ivn keys.


Response Schemas

1. Image Asset Descriptor Response

When format is webp, png, svg, jpeg, or pdf, the server returns a JSON object containing the relative asset URL:

{
  "url": "gbR/QUFQTF9za2V3X2NvbnRyYWN0X2FnZ18yMDI2MDcwOFQxNTQ4MDU.svg",
  "name": "QUFQTF9za2V3X2NvbnRyYWN0X2FnZ18yMDI2MDcwOFQxNTQ4MDU.svg",
  "content_type": "image/svg+xml",
  "description": "$AAPL skew 20260708T154805",
  "time_stamp": "20260708T154805",
  "model_ts": "2026-07-08T15:45:00-04:00",
  "model": "gbR"
}
FieldTypeDescription
urlstringRelative asset path. Resolve against https://r.gex.bot/ to fetch the file.
namestringAsset filename. Matches the last path segment of url.
content_typestringMIME type of the rendered file.
descriptionstringSummary containing ticker, metric, and generation timestamp.
time_stampstringGeneration timestamp in YYYYMMDDTHHMMSS format.
model_tsstring or nullISO-8601 timestamp of the options-chain snapshot the chart used.
modelstringVolatility model of the request. Default gbR.

2. Tabular Data Response (format=csv and format=json)

When format=csv the endpoint returns text/csv with Content-Disposition: attachment; filename="SPX_data.csv". When format=json it returns application/json: an array of row objects with the same columns, with Content-Disposition: attachment; filename="SPX_data.json".

  • Skew view columns: idx_strike_price, idx_expiration_date (absent when expiry_agg=true), idx_call_put_flag (absent when contract_agg=true, the default) and the metric id in upper case, for example GEX_OI.
  • Term view columns: idx_expiration_date, idx_call_put_flag (absent when contract_agg=true) and the metric.
  • Surface view: one row per strike and expiration with the metric.
  • gamma_flip, vol_trigger, gamma_wall and gamma_wall_abs return the gamma-flip table instead. The table has one row for each expiration, with the columns EXPIRATION_DATE, GAMMA FLIP, GAMMA WALL, CALL WALL and PUT WALL. It has no row for all expirations together.
  • time_value and extrinsic return the column EXTRINSIC_VALUE: the mid quote less intrinsic value, with a minimum of zero. An image format draws extrinsic value by strike (skew), by expiration (term) or as a surface.
  • parity and put_call_parity are images only. csv and json return 400.
  • skew_adj and expiration_filter have no effect on csv or json output.

Example header with contract_agg=false:

idx_strike_price,idx_expiration_date,idx_call_put_flag,GEX_OI

Sign of the GEX values

In gex_oi, gex_vol and gex_both rows, a call value is positive and a put value is negative. Do not negate the put rows. The API returns them negative.

  • With contract_agg=false, calls and puts are separate rows. The idx_call_put_flag column is C or P.
  • With contract_agg=true, the value at a strike is the call value plus the put value. This net value is negative when the put exposure is larger.

Gamma Flip from the rows

The Research chart draws the Gamma Flip at the strike where the cumulative Net GEX is lowest. Use the signed value, not the absolute value. To get the flip for all expirations together from gex_oi rows:

  1. Request format=json with expiry_agg=true and contract_agg=true. Use the same start_dte and end_dte as the chart. Set strikes to a value larger than the strike count of the chain, for example 100000.
  2. Sort the rows by idx_strike_price, from the lowest strike to the highest strike.
  3. Calculate the cumulative sum of GEX_OI.
  4. Find the row with the lowest cumulative value. Its idx_strike_price is the Gamma Flip.

The chart starts the cumulative sum at the lowest strike of the chain. Then it looks for the lowest value only in the strikes that it shows. A flip that you calculate from more strikes can thus be outside the chart window.

The GAMMA FLIP column of the gamma_flip table uses the same method for each expiration. It uses GEX_BOTH (open interest plus volume) and all strikes of the expiration. Thus it can be different from a flip that you calculate from gex_oi.


Error Handling & Rate Limits

HTTP StatusError ReasonResponse Body / Behavior
400 Bad RequestUnknown or restricted metric, or an invalid parameter.{"error": "invalid request"}. Other messages: Invalid ticker., Invalid metric., Ticker ZZZZ is not a valid symbol., GEX_OI does not support skew adjustment., PUT_CALL_PARITY is available as an image only. Request an image format., Volume-based metrics are unavailable during pre-market hours. Please wait for market open., User-Agent not found., Authorization header not found.
400 Bad RequestThe selected metric cannot appear as a surface.{"error": "The surface chart cannot show the <metric> metric."}
400 Bad RequestNo data is left after the filters. A metric with no value in the strike window gives the same result, for example a surface view when the Greeks are not available.{"error": "No data found after applying filters. Try widening your strike range or checking your moneyness/contract filters."}
401 UnauthorizedInvalid API key. A missing Authorization header returns 400.The response carries no {"error": ...} body.
403 ForbiddenThe key is not a Research API key.The response carries no {"error": ...} body.
403 ForbiddenThe requested format is not available to this key.{"error": "This research data format is not available for restricted commercial access."}
429 Too Many RequestsQuery quota exceeded for the current window.{"error": "Rate limit exceeded."}
500 Internal Server ErrorThe research service failed.{"error": "Failed to reach upstream research service."}, or a research-service message such as Failed to load data. or Failed to build chart.
503 Service UnavailableThe research service could not get the Greeks for the chain. It does not return a chart with Greeks missing. Send the request again later.{"error": "Server error."}

Code Examples

BASE_URL="<your host and version>"

# Request SVG chart asset descriptor
curl -X GET "$BASE_URL/research/SPX/gex_oi?format=svg&strikes=25&contract_agg=true" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "User-Agent: MyResearchApp/1.0" \
  -H "Accept: application/json"

# Request raw CSV dataset
curl -X GET "$BASE_URL/research/AAPL/gex_oi?format=csv&start_dte=0&end_dte=30" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "User-Agent: MyResearchApp/1.0" \
  -H "Accept: text/csv"
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "<your host and version>"
headers = {
    "Authorization": f"Bearer {API_KEY}",
    "User-Agent": "PythonClient/1.0",
    "Accept": "application/json",
}

# Fetch chart asset descriptor
url = f"{BASE_URL}/research/NVDA/iv_mid"
params = {
    "format": "webp",
    "view": "term",
    "start_dte": 0,
    "end_dte": 180
}

response = requests.get(url, headers=headers, params=params)
data = response.json()
image_url = f"https://assets.gexbot.com/{data['url']}"
print(f"Chart available at: {image_url}")
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = '<your host and version>';

async function fetchResearchCSV(ticker: string, metric: string) {
  const url = new URL(`${BASE_URL}/research/${ticker}/${metric}`);
  url.searchParams.set('format', 'csv');
  url.searchParams.set('start_dte', '0');
  url.searchParams.set('end_dte', '98');

  const res = await fetch(url.toString(), {
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'User-Agent': 'NodeApp/1.0',
      'Accept': 'text/csv',
    },
  });

  if (!res.ok) {
    throw new Error(`Request failed with status ${res.status}`);
  }

  const csvData = await res.text();
  return csvData;
}

On this page