> ## Documentation Index
> Fetch the complete documentation index at: https://docs.backquant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Max pain

> Max-pain strike (per-expiry). The strike at which option writers profit most at expiry.

The strike where option writers profit most at expiry. Use `?expiry=0dte` for the cheapest path, `?expiry=all` for a per-expiry table, or pass a specific expiry token to also receive the full pain curve.

## See also

<CardGroup cols={2}>
  <Card title="Max pain explained" href="/concepts/max-pain" icon="bookmark" />
</CardGroup>


## OpenAPI

````yaml GET /gex/max-pain
openapi: 3.1.0
info:
  title: BackQuant API v2
  description: >-

    # BackQuant API v2


    Options + gamma-exposure focused public API. Built on the same data the

    BackQuant Pro Terminal renders - pre-computed every 30s, served from cache.


    ## What's in v2


    * **Discovery**: `/v2/symbols` (universe + per-symbol freshness + supported
      endpoint list), `/v2/expiries` (active expiry tokens with DTE), `/v2/status`
      (per-symbol-per-category health with thresholds + overall classification).
    * **GEX**: composable levels (HVL / call wall / put support / max-pain /
      expected move / gamma-flip zones), strike profile with typed expiry
      filter, expiry profile, strike × expiry heatmap with downsampling,
      greek time-heatmap with DTE/OI/IV filters, history (cursor-paginated),
      Postgres-backed stress history, **per-expiry max-pain with pain curve**.
    * **Options**: filtered options chain with two-layer projection (top-level
      `?fields=` and per-contract `?include=oi,iv,greeks,bid_ask,volume,gex`)
      plus moneyness filter (`?moneyness_min=0.9&moneyness_max=1.1`), expiry
      summary table, full IV suite (surface / term structure / 25Δ-10Δ skew /
      curves / **single-expiry smile** / IV-RV history / VRP), expected move,
      **Breeden-Litzenberger probability density and surface**, typed greek
      profiles (delta / theta / vanna / charm / vega), strike × time charm/vega
      surfaces, strike × expiry 3D greek surface, OI by expiry + history,
      put/call ratio (intraday or daily), 0DTE & weekly premium tide,
      dated-futures term structure.
    * **Liquidation**: heatmap + leverage-tiered distribution.

    * **Multi**: `/v2/multi/gex/levels` - bundled multi-symbol read across the
      universe in one round-trip, with the same `?include=` model as the
      single-symbol endpoint.

    ## Authentication


    Every v2 route (except `/v2/openapi.json`, `/v2/docs`, `/v2/redoc`, and

    `/v2/health`) requires the `X-API-Key` header.


    ```

    X-API-Key: bq_live_your_api_key_here

    ```


    **Get your API key at
    [backquant.com/api-access](https://backquant.com/api-access).**


    The same key works across v1 and v2 - if you already have a v1 key, no

    re-issuance is needed.


    ## Rate limits


    Two budgets, both derived from your subscription tier: a **monthly request

    allowance** per account, and a **per-minute burst** per key. Size your

    integration against the monthly figure - sustained polling at the burst rate

    exhausts the month early.


    | Plan                      | Monthly allowance | Burst    | Sustained   |

    |---------------------------|-------------------|----------|-------------|

    | Starter (Terminal Yearly) | 10,000 req/month  | 10/min   | ~333/day    |

    | Standard (Crypto API)     | 250,000 req/month | 60/min   | ~8,300/day  |

    | Pro (Terminal + API)      | 1,000,000/month   | 120/min  | ~33,000/day |

    | Enterprise                | custom            | 600/min  | custom      |


    Headers `X-RateLimit-Limit / -Remaining / -Reset` (burst) and

    `X-Quota-Limit / -Used / -Remaining / -Period` (monthly) are included in

    every response; the rate-limit triple is echoed inside `meta.rate_limit`

    when populated by middleware. Exceeding either budget returns `429`.


    The live ladder is served at `GET /v2/meta` under `rate_limits`.


    ## Response envelope


    ```json

    {
      "success": true,
      "data": { ... },
      "meta": {
        "version": "2.0",
        "timestamp": "2026-04-29T12:00:00.000Z",
        "request_id": "req_…",
        "symbol": "BTCUSDT",
        "spot_price": 67213.5,
        "computed_at": "2026-04-29T11:59:48.000Z",
        "freshness_seconds": 12.0,
        "source": ["deribit","bybit","okx","binance","derive","thalex","delta_india","delta","bullish","paradex"],
        "exchanges_filtered": ["deribit","bybit"]
      }
    }

    ```


    ## Errors


    ```json

    {
      "success": false,
      "error": {
        "code": "NOT_FOUND",
        "message": "No data for BTCUSDT"
      },
      "meta": { "version": "2.0", "timestamp": "..." }
    }

    ```


    | Code                  | When |

    |-----------------------|------|

    | `UNAUTHORIZED`        | Missing or invalid API key |

    | `FORBIDDEN`           | Subscription doesn't allow API access |

    | `NOT_FOUND`           | Symbol/expiry/etc. not present in cache |

    | `VALIDATION_ERROR`    | Bad query parameters |

    | `RATE_LIMIT_EXCEEDED` | Per-tier limit hit |

    | `UPSTREAM_ERROR`      | Cache or DB temporarily unreachable |

    | `INTERNAL_ERROR`      | Anything else |
        
  version: '2.13'
servers: []
security: []
tags:
  - name: Meta
    description: Unauthenticated metadata + endpoint catalog (planning your integration)
  - name: Discovery
    description: Symbol catalog, active expiries, and service status
  - name: GEX
    description: Gamma exposure analytics
  - name: Options
    description: Options chain, IV, greeks, probability, premium tide
  - name: Liquidation
    description: Liquidation heatmap and distribution
  - name: Multi
    description: Bundled multi-symbol endpoints (single round-trip across the universe)
  - name: COT
    description: >-
      CFTC Commitments of Traders: futures positioning by trader category
      (public CFTC data)
  - name: Filings
    description: >-
      SEC Form 4 insider trades and 13F holders for MSTR, COIN, HOOD and IBIT
      (public SEC data)
paths:
  /gex/max-pain:
    get:
      tags:
        - GEX
      summary: Max-pain strike (per-expiry)
      description: >-
        The strike at which option writers profit most at expiry. Use
        `?expiry=0dte` for the cheapest path (read straight from the 0DTE levels
        cache), `?expiry=all` for a per-expiry table covering every active
        expiration, or pass a specific expiry token (e.g. `28MAR25`) to also
        receive the full pain curve by strike.
      operationId: get_max_pain_gex_max_pain_get
      parameters:
        - name: symbol
          in: query
          required: false
          schema:
            enum:
              - BTCUSDT
              - ETHUSDT
              - SOLUSDT
              - HYPEUSDT
            type: string
            description: 'Trading symbol: BTCUSDT, ETHUSDT, SOLUSDT, or HYPEUSDT.'
            default: BTCUSDT
            title: Symbol
          description: 'Trading symbol: BTCUSDT, ETHUSDT, SOLUSDT, or HYPEUSDT.'
        - name: expiry
          in: query
          required: false
          schema:
            type: string
            description: >-
              Which expiry to include: `all` for every expiry, `0dte` for
              today's expiry only, or a specific date (`YYYY-MM-DD`) or Deribit
              token (`28MAR25`).
            default: all
            title: Expiry
          description: >-
            Which expiry to include: `all` for every expiry, `0dte` for today's
            expiry only, or a specific date (`YYYY-MM-DD`) or Deribit token
            (`28MAR25`).
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaxPainResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid API key
                meta:
                  version: '2.0'
                  timestamp: '2026-04-29T12:00:00Z'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ErrorEnvelope'
          description: Not Found
        '422':
          description: Validation error on query parameters
          content:
            application/json:
              example:
                success: false
                error:
                  code: VALIDATION_ERROR
                  message: Invalid request parameters
                  details:
                    errors: []
                meta:
                  version: '2.0'
                  timestamp: '2026-04-29T12:00:00Z'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              example:
                success: false
                error:
                  code: RATE_LIMIT_EXCEEDED
                  message: Rate limit exceeded. Try again later.
                meta:
                  version: '2.0'
                  timestamp: '2026-04-29T12:00:00Z'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    MaxPainResponse:
      properties:
        success:
          type: boolean
          const: true
          title: Success
          default: true
        data:
          $ref: '#/components/schemas/MaxPainResponseData'
        meta:
          $ref: '#/components/schemas/V2Meta'
      type: object
      required:
        - data
        - meta
      title: MaxPainResponse
    V2ErrorEnvelope:
      properties:
        success:
          type: boolean
          const: false
          title: Success
          default: false
        error:
          $ref: '#/components/schemas/V2Error'
        meta:
          $ref: '#/components/schemas/V2Meta'
      type: object
      required:
        - error
        - meta
      title: V2ErrorEnvelope
      description: Returned for every non-2xx response.
    MaxPainResponseData:
      properties:
        expiry:
          type: string
          title: Expiry
          description: '`0dte`, `all`, or a specific expiry token.'
        dte:
          anyOf:
            - type: integer
            - type: 'null'
          title: Dte
        expiry_tokens:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Expiry Tokens
          description: >-
            Which expiry tokens were treated as 0DTE for this calculation.
            Present only when `?expiry=0dte`, so a caller can see exactly which
            expirations the number covers.
        max_pain:
          anyOf:
            - $ref: '#/components/schemas/GexMaxPainBlock'
            - type: 'null'
        pain_curve:
          anyOf:
            - items:
                $ref: '#/components/schemas/MaxPainPainCurveEntry'
              type: array
            - type: 'null'
          title: Pain Curve
          description: >-
            Per-strike total pain. Present only when a specific expiry is
            requested.
        per_expiry:
          anyOf:
            - items:
                $ref: '#/components/schemas/MaxPainPerExpiry'
              type: array
            - type: 'null'
          title: Per Expiry
          description: Per-expiry max-pain table. Present only when `?expiry=all`.
      type: object
      required:
        - expiry
      title: MaxPainResponseData
    V2Meta:
      properties:
        version:
          type: string
          const: '2.0'
          title: Version
          description: API version tag.
        timestamp:
          type: string
          title: Timestamp
          description: ISO 8601 wall-clock when the response was built.
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: X-Request-ID for tracing across logs / Sentry.
        symbol:
          anyOf:
            - type: string
            - type: 'null'
          title: Symbol
          description: Symbol the response is about, if applicable.
        spot_price:
          anyOf:
            - type: number
            - type: 'null'
          title: Spot Price
          description: Current spot price for the symbol.
        computed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Computed At
          description: ISO 8601 of when the underlying cache value was last written.
        freshness_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Freshness Seconds
          description: '`now - computed_at` in seconds; useful for staleness alarms.'
        source:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Source
          description: Upstream venue list the data flowed through.
        exchanges_filtered:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Exchanges Filtered
          description: Echo of the `?exchanges=` filter when one was applied.
        rate_limit:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Rate Limit
          description: '`{limit, remaining, reset}` echo of the rate-limit headers.'
        extra:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extra
          description: Open dict for endpoint-specific metadata (filter_hash, etc.).
      type: object
      required:
        - version
        - timestamp
      title: V2Meta
      description: |-
        The meta block returned alongside every v2 response.

        Every field after `version`/`timestamp` is optional because endpoints
        attach different combinations - e.g. `/v2/status` skips `symbol`, the
        chain endpoint sets `extra.filter_hash`, etc. Listing them here means
        SDKs get a typed accessor for each instead of a generic `meta: dict`.
    V2Error:
      properties:
        code:
          type: string
          title: Code
          description: Stable machine-readable error code (see /v2/meta).
        message:
          type: string
          title: Message
          description: Human-readable description.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Optional structured payload - e.g. validation_error returns the
            failing field list.
      type: object
      required:
        - code
        - message
      title: V2Error
    GexMaxPainBlock:
      properties:
        strike:
          anyOf:
            - type: number
            - type: 'null'
          title: Strike
        value:
          anyOf:
            - type: number
            - type: 'null'
          title: Value
      type: object
      title: GexMaxPainBlock
    MaxPainPainCurveEntry:
      properties:
        strike:
          type: number
          title: Strike
        pain:
          type: number
          title: Pain
      type: object
      required:
        - strike
        - pain
      title: MaxPainPainCurveEntry
    MaxPainPerExpiry:
      properties:
        expiry:
          type: string
          title: Expiry
        dte:
          anyOf:
            - type: integer
            - type: 'null'
          title: Dte
        max_pain:
          $ref: '#/components/schemas/GexMaxPainBlock'
      type: object
      required:
        - expiry
        - max_pain
      title: MaxPainPerExpiry
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your BackQuant API key (same key as v1)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.