Max Pain Analysis API - Pain Curve, Dealer Alignment, Pin Probability | FlashAlpha
  1. Max Pain

Max Pain Analysis API

Max pain analysis for any US equity or ETF. Pain curve, OI breakdown, dealer alignment overlay (gamma flip, call/put walls), pin probability scoring, expected move context, and multi-expiry calendar.

New to max pain? Read our complete guide covering what max pain is and how it works. Also see: Max Pain Trading Strategies for pin risk and expiration setups.

Endpoint

GET /v1/maxpain/{symbol}
Auth required (X-Api-Key) Rate Limited: Yes Plan: Basic+

Parameters

Name In Type Required Default Description
symbol path string required - Underlying symbol (e.g. SPY, QQQ, AAPL)
expiration query date nearest Expiration date in yyyy-MM-dd format. Omit for full-chain analysis plus per-expiry breakdown. Invalid values return 400 invalid_expiration.
Works with CME futures. Pass ES=F or NQ=F and URL-encode the = as %3D - e.g. /v1/maxpain/ES%3DF. Options-on-futures are priced with Black-76 using the CME multiplier ($50/pt ES, $20/pt NQ); CME futures are Growth plan. See the futures hub.

Request

curl -H "X-Api-Key: YOUR_API_KEY" \
  "https://lab.flashalpha.com/v1/maxpain/SPY"
import requests

resp = requests.get(
    "https://lab.flashalpha.com/v1/maxpain/SPY",
    headers={"X-Api-Key": "YOUR_API_KEY"}
)
resp.raise_for_status()
data = resp.json()
print(f"Max Pain Strike: {data['max_pain_strike']}")
print(f"Pin Probability: {data['pin_probability']}/100")
print(f"Spot is {data['distance']['percent']}% {data['distance']['direction']} max pain")
print(f"Signal: {data['signal']}")
print(f"Dealer Alignment: {data['dealer_alignment']['alignment']}")
const resp = await fetch(
  "https://lab.flashalpha.com/v1/maxpain/SPY",
  { headers: { "X-Api-Key": "YOUR_API_KEY" } }
);
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
const data = await resp.json();
console.log(`Max Pain Strike: ${data.max_pain_strike}`);
console.log(`Pin Probability: ${data.pin_probability}/100`);
console.log(`Spot is ${data.distance.percent}% ${data.distance.direction} max pain`);
console.log(`Signal: ${data.signal}`);
console.log(`Dealer Alignment: ${data.dealer_alignment.alignment}`);

Try it live

Runs on live market data and uses 1 request from your daily quota.

GET

Response

{
  "symbol": "SPY",
  "underlying_price": 760.26,
  "as_of": "2026-10-30T13:46:16.3342927Z",
  "max_pain_strike": 765,
  "distance": {
    "absolute": 4.74,
    "percent": 0.62,
    "direction": "below"
  },
  "signal": "neutral",
  "expiration": "2026-10-30",
  "put_call_oi_ratio": 2.132,
  "pain_curve": [
    {
      "strike": 50,
      "call_pain": 0,
      "put_pain": 680550228500,
      "total_pain": 680550228500
    },
    {
      "strike": 55,
      "call_pain": 33500,
      "put_pain": 674403481000,
      "total_pain": 674403514500
    }
  ],
  "oi_by_strike": [
    {
      "strike": 50,
      "call_oi": 67,
      "put_oi": 69735,
      "total_oi": 69802,
      "call_volume": 0,
      "put_volume": 0
    },
    {
      "strike": 55,
      "call_oi": 2,
      "put_oi": 8040,
      "total_oi": 8042,
      "call_volume": 0,
      "put_volume": 0
    }
  ],
  "max_pain_by_expiration": [
    {
      "expiration": "2026-10-30",
      "max_pain_strike": 765,
      "dte": 0,
      "total_oi": 2462321
    },
    {
      "expiration": "2026-11-02",
      "max_pain_strike": 772,
      "dte": 3,
      "total_oi": 183535
    }
  ],
  "dealer_alignment": {
    "alignment": "converging",
    "description": "Max pain (765) near gamma flip (769.211836083682) between walls (760–800) - strong converging magnet.",
    "gamma_flip": 769.2118,
    "gamma_flip_status": "available",
    "call_wall": 800,
    "put_wall": 760
  },
  "regime": "negative_gamma",
  "expected_move": {
    "straddle_price": 3.89,
    "atm_iv": 24,
    "max_pain_within_expected_range": false
  },
  "pin_probability": 48,
  "endpoint_version": "2026.09.30",
  "data_as_of": {
    "node": "fa5",
    "equity_feed": "2026-10-30T13:46:16.008Z",
    "equity_options_feed": "2026-10-30T13:46:16Z",
    "index_feed": "2026-10-30T13:46:15.124Z",
    "index_options_feed": "2026-10-30T13:46:14Z",
    "futures_feed": "2026-10-30T13:46:15.271Z",
    "futures_options_feed": "2026-10-30T13:46:14.335Z",
    "flow_feed": "2026-10-30T13:46:00Z",
    "oi_feed": "2026-10-29T20:00:00Z",
    "macro_feed": "2026-10-29T21:00:20Z"
  }
}

Sending request…

See this endpoint on live data

Send this exact request and the real response shows up here, right next to the example.

Response Fields

Field Type Description
underlying_pricenumberCurrent spot price of the underlying
max_pain_strikenumberStrike where total option holder pain (intrinsic value) is minimized. See max pain
distanceobjectabsolute (dollars) and percent from spot, and direction (above, below or at): where spot sits relative to max pain
signalstringDirectional signal: bullish (spot at least 5% below max pain), bearish (spot at least 5% above max pain), or neutral
put_call_oi_rationumberTotal put OI divided by total call OI across the chain. See put/call OI ratio
regimestringpositive_gamma, negative_gamma, or unknown (direction undetermined: flip absent, unverified, or stressed sign uncertain near the certified level). See gamma regime
pin_probabilitynumber0-100 composite score: OI concentration, proximity to max pain, time to expiry, gamma magnitude. See pin risk
pain_curve[]arrayPain at each strike: call_pain, put_pain, total_pain (USD). See pain curve
oi_by_strike[]arrayPer-strike breakdown: call_oi, put_oi, total_oi, call_volume, put_volume. See highest OI strike
max_pain_by_expiration[]arrayMax pain strike for each available expiration with dte and total_oi
dealer_alignment.alignmentstringconverging, moderate, or diverging - how well max pain aligns with GEX levels. See dealer alignment
dealer_alignment.descriptionstringHuman-readable summary of dealer alignment context
dealer_alignment.gamma_flipnumberPrice level where dealer gamma flips from positive to negative. See gamma flip
dealer_alignment.call_wallnumberStrike with highest call GEX - acts as resistance. See call wall
dealer_alignment.put_wallnumberStrike with highest put GEX - acts as support. See put wall
expected_move.straddle_pricenumberATM straddle price in dollars. See expected move
expected_move.atm_ivnumberAt-the-money implied volatility (annualized %)
expected_move.max_pain_within_expected_rangebooleanWhether max pain strike falls within the expected move range
symbolstringUnderlying symbol
as_ofstringTimestamp of the data (ISO 8601, UTC)
distance.absolutenumberDollar distance from spot to max pain
distance.percentnumberPercentage distance from spot to max pain
distance.directionstringabove, below, or at - spot relative to max pain
expirationstringExpiration date (yyyy-MM-dd)
pain_curve[].strikenumberStrike price
pain_curve[].call_painnumberPain curve: call pain
pain_curve[].put_painnumberPain curve: put pain
pain_curve[].total_painnumberPain curve: total pain
oi_by_strike[].strikenumberStrike price
oi_by_strike[].call_oinumberCall open interest
oi_by_strike[].put_oinumberPut open interest
oi_by_strike[].total_oinumberOI by strike: total OI
oi_by_strike[].call_volumenumberCall volume
oi_by_strike[].put_volumenumberPut volume
max_pain_by_expiration[].expirationstringExpiration date (yyyy-MM-dd)
max_pain_by_expiration[].dtenumberDays to expiration
max_pain_by_expiration[].total_oinumberMax pain by expiration: total OI
max_pain_by_expiration[].max_pain_strikenumberStrike where total option holder pain (intrinsic value) is minimized. See max pain
dealer_alignmentobjectDealer alignment
dealer_alignment.gamma_flip_statusstringavailable when gamma_flip is a certified level; any other value means the level is unverified or missing. See GEX.
expected_moveobjectExpected move
endpoint_version, data_as_ofstring, objectResponse envelope, see Response envelope.

Errors

Status Error When
400invalid_expirationexpiration is not a valid yyyy-MM-dd date.
401-Missing or invalid X-Api-Key. The body is empty; check the status code before parsing JSON.
403tier_restrictedYour plan is below Basic. The body includes current_plan and required_plan.
404symbol_not_foundNo data for the symbol (unknown symbol, or no live data). Outside US market hours the message also says the market is closed.
404no_dataNo options data for the requested expiration.
429Quota exceededDaily quota used up. Retry-After gives the seconds until the reset at 00:00 UTC. Rejected requests (including 403) count toward the quota.

What Is Max Pain?

Max pain is the strike price where the total intrinsic value of all outstanding options (both calls and puts) is minimized at expiration. In theory, this is the price at which option writers (predominantly dealers and market makers) lose the least money, creating a gravitational pull on the underlying as expiration approaches.

This endpoint combines the classic max pain calculation with GEX dealer alignment data - gamma flip, call/put walls, and net gamma exposure - to give you a complete picture of where dealer positioning and option holder pain intersect. When the max pain strike aligns with key GEX levels, the pin probability increases significantly.

Common Use Cases

  • Gauge pin conviction - read pin_probability (0-100) to decide whether to fade moves toward max_pain_strike or stand aside into expiration
  • Anchor credit spreads - center iron condors on max_pain_strike and set wings at dealer_alignment.call_wall / put_wall for high-probability structures
  • Time the pin entry - use distance.percent and distance.direction to know how far spot must travel to reach max pain and which way to lean
  • Confirm with dealer alignment - act only when dealer_alignment.alignment reads converging and gamma_flip sits near max pain, raising pin odds
  • Plan roll timing - compare max_pain_by_expiration[] across expiries to roll positions where max pain and OI concentrate
  • Filter by expected move - gate setups on expected_move.max_pain_within_expected_range so you only pin-trade when max pain is reachable inside the straddle
  • Map the pain landscape - plot pain_curve[] and oi_by_strike[] to visualize where holder pain bottoms and OI clusters

Related reading

Complementary endpoints

  • Key Levels - gamma flip and call/put walls to cross-check the pin setup
  • Gamma Exposure (GEX) - per-strike gamma the dealer-alignment block is derived from
  • Flow Pin Risk - real-time flow-based pin-risk score alongside the OI-based pin probability
  • 0DTE Analytics - same-day pin risk, expected move, and gamma acceleration

Ready to build with FlashAlpha?

Get your free API key and start pulling live options data in 60 seconds.

No credit card required Setup in 60 seconds Secure & reliable