Skip to main content

Max Painโ€‹

API for retrieving the Max Pain strike price for an underlying asset on a given expiry and date. It accepts the instrument key, expiry, date, and bucket interval, and returns the max pain level for the requested date along with spot price insights at each interval.

Requestโ€‹

curl --location 'https://api.upstox.com/v2/market/max-pain?instrument_key=NSE_INDEX%7CNifty%2050&expiry=2026-05-29&date=2026-05-07&bucket_interval=60' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

For additional samples in various languages, please refer to the Sample code section on this page.


Query Parametersโ€‹

NameRequiredDescription
instrument_keytrueUnderlying asset instrument key. For the regex pattern applicable to this field, see the Field Pattern Appendix.
expirytrueExpiry date of the option contract in YYYY-MM-DD format.
datetrueDate for which Max Pain data is required, in YYYY-MM-DD format.
bucket_intervaltrueBucket interval in minutes for intraday insights.

The bucket_interval parameter controls the granularity of the intraday insights array โ€” it defines the gap in minutes between consecutive data points. For example, bucket_interval=60 returns one data point per hour starting from market open (09:15, 10:15, 11:15, ..., 15:15).

Responses

Response bodyโ€‹

{
"status": "success",
"data": {
"instrument_key": "NSE_INDEX|Nifty 50",
"expiry_date": "19-05-2026",
"max_pain": 24050.0,
"spot_closing_price": 24044.35,
"insights": [
{
"max_pain": 24250.0,
"spot_price": 23955.0,
"time": "09:15"
},
{
"max_pain": 24100.0,
"spot_price": 23829.65,
"time": "10:15"
},
{
"max_pain": 24000.0,
"spot_price": 23800.0,
"time": "11:15"
},
{
"max_pain": 24000.0,
"spot_price": 23905.75,
"time": "12:15"
},
{
"max_pain": 24000.0,
"spot_price": 23950.65,
"time": "13:15"
},
{
"max_pain": 24050.0,
"spot_price": 24028.5,
"time": "14:15"
},
{
"max_pain": 24050.0,
"spot_price": 23988.3,
"time": "15:15"
}
]
}
}
NameTypeDescription
statusstringOutcome of the request. Typically success for successful operations.
dataobjectMax Pain data object.
data.instrument_keystringUnderlying asset instrument key.
data.expiry_datestringExpiry date of the option contract.
data.max_painnumberMax Pain strike level for the requested date.
data.spot_closing_pricenumberClosing spot price of the underlying asset.
data.insightsarrayIntraday Max Pain data points at the requested bucket interval.
data.insights[].max_painnumberMax Pain strike at this interval.
data.insights[].spot_pricenumberSpot price at this interval.
data.insights[].timestringTime of the interval in HH:mm format.

Sample Codeโ€‹

Get Max Pain dataโ€‹

curl --location 'https://api.upstox.com/v2/market/max-pain?instrument_key=NSE_INDEX%7CNifty%2050&expiry=2026-05-29&date=2026-05-07&bucket_interval=60' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
Loading...