Contracts & Expiries¶
These endpoints let you discover individual derivative contracts and the expiry dates they belong to — both currently trading and long expired — by querying on an underlying instead of downloading and filtering the whole Instruments Master CSV. The expired side is what makes historical options work: it tells you which strikes existed for an expiry that has already passed.
| Request Type | Path | Description |
|---|---|---|
| GET | /market/instruments/search | Search currently trading contracts for an underlying. |
| GET | /market/instruments/expiries | List upcoming expiry dates for an underlying. |
| GET | /market/instruments/expired/search | Search contracts whose expiry has passed. |
| GET | /market/instruments/expired/expiries | List past expiry dates within a window. |
| GET | /market/instruments/expired/contracts | Full contract chain for one past expiry. |
Shared Parameters¶
The five endpoints draw on a common set of parameters and enums.
| Parameter | Type | Description |
|---|---|---|
underlying | string | The underlying symbol, e.g. NIFTY, RELIANCE. Required on every endpoint. |
segment | string | Market segment. Required on every endpoint. Only DERIVATIVE is supported. |
instrument_type | string | Narrows results to one contract type. Enum: OPTIDX, OPTSTK, FUTIDX, FUTSTK |
option_type | string | Narrows options to calls or puts. Enum: CE, PE |
expiry | date | A single expiry date, YYYY-MM-DD. |
All date values, in requests and in responses, are YYYY-MM-DD.
Supported segment
These endpoints serve the derivatives segment, so segment=DERIVATIVE is the value to pass. Support for segment=EQUITY is on the roadmap; for cash-market instruments today, use the Instruments Master CSV with source=equity.
Search Contracts¶
Returns the individual contracts currently trading on an underlying — options, futures, or both.
Endpoint
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
underlying | string | ✅ | The underlying symbol, e.g. NIFTY. |
segment | string | ✅ | DERIVATIVE. |
instrument_type | string | OPTIDX, OPTSTK, FUTIDX or FUTSTK. Omit to get every type. | |
expiry | date | Restrict to one expiry, YYYY-MM-DD. | |
strike_from | number | Lower bound on strike price. Options only. | |
strike_to | number | Upper bound on strike price. Options only. | |
option_type | string | CE or PE. Options only. | |
page | integer | Page number. Default 1. | |
page_size | integer | Results per page. Default 50, maximum 100. |
Example Request
curl --location 'https://api.indstocks.com/market/instruments/search?underlying=NIFTY&segment=DERIVATIVE&instrument_type=FUTIDX' \
--header 'Authorization: YOUR_ACCESS_TOKEN'
Response Payload (Success)
{
"status": "success",
"data": {
"count": 804,
"page": 1,
"page_size": 50,
"instruments": [
{
"security_id": "58072",
"trading_symbol": "NIFTY26AUG25FUT",
"expiry": "2026-08-25",
"strike_price": null,
"option_type": null,
"lot_size": 75
}
]
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
count | integer | Total contracts matching the filters, across all pages. |
page / page_size | integer | Echo of the pagination you requested. |
instruments[].security_id | string | The instrument's numeric ID, for scrip-codes and order placement. |
instruments[].trading_symbol | string | The exchange trading symbol. |
instruments[].expiry | date | Contract expiry, YYYY-MM-DD. |
instruments[].strike_price | number | Strike price for options; null for futures. |
instruments[].option_type | string | CE or PE for options; null for futures. |
instruments[].lot_size | integer | Contract lot size. |
Omitting instrument_type mixes options and futures
With no instrument_type filter the response contains both, distinguishable by the null strike_price and option_type on futures rows. Filter explicitly when you want one or the other.
Index futures are listed on monthly expiries
Index futures follow the exchange's monthly expiry cycle, so instrument_type=FUTIDX returns rows for monthly expiries. A weekly expiry has options but no index futures.
List Expiries¶
Returns the upcoming expiry dates available for an underlying — the values you feed into expiry elsewhere.
Endpoint
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
underlying | string | ✅ | The underlying symbol, e.g. NIFTY. |
segment | string | ✅ | DERIVATIVE. |
Example Request
curl --location 'https://api.indstocks.com/market/instruments/expiries?underlying=NIFTY&segment=DERIVATIVE' \
--header 'Authorization: YOUR_ACCESS_TOKEN'
Response Payload (Success)
data is a flat array of dates in ascending order, covering upcoming expiries only.
Search Expired Contracts¶
The same search as Search Contracts, over contracts whose expiry has already passed.
Endpoint
Query Parameters
Every parameter from Search Contracts, plus a mandatory expiry window:
| Parameter | Type | Required | Description |
|---|---|---|---|
expiry_from | date | ✅ | Start of the expiry window, YYYY-MM-DD. |
expiry_to | date | ✅ | End of the expiry window, YYYY-MM-DD. Max span 5 years. |
Example Request
curl --location 'https://api.indstocks.com/market/instruments/expired/search?underlying=NIFTY&segment=DERIVATIVE&instrument_type=OPTIDX&expiry_from=2024-08-19&expiry_to=2026-07-20&page=1&page_size=50' \
--header 'Authorization: YOUR_ACCESS_TOKEN'
Response Payload (Success)
Identical in shape to Search Contracts, with one difference: there is no security_id.
{
"status": "success",
"data": {
"count": 804,
"page": 1,
"page_size": 50,
"instruments": [
{
"trading_symbol": "NIFTY26JUL2825950CE",
"expiry": "2026-07-28",
"strike_price": 25950,
"option_type": "CE",
"lot_size": 75
}
]
}
}
Expired contracts are identified by trading_symbol
Exchanges reuse numeric instrument tokens once a contract has expired, so trading_symbol is the stable identifier for historical contracts and is what this endpoint returns. Use it as the key when you carry results forward to Historical Data.
Both expiry_from and expiry_to are mandatory, the window may not span more than 5 years, and an inverted window (expiry_from later than expiry_to) is rejected.
List Expired Expiries¶
Returns past expiry dates for an underlying within a window.
Endpoint
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
underlying | string | ✅ | The underlying symbol, e.g. NIFTY. |
segment | string | ✅ | DERIVATIVE. |
expiry_from | date | ✅ | Start of the window, YYYY-MM-DD. |
expiry_to | date | ✅ | End of the window, YYYY-MM-DD. Max span 1 year. |
Example Request
curl --location 'https://api.indstocks.com/market/instruments/expired/expiries?underlying=NIFTY&segment=DERIVATIVE&expiry_from=2025-10-23&expiry_to=2026-08-09' \
--header 'Authorization: YOUR_ACCESS_TOKEN'
Response Payload (Success)
data is a flat array of dates in descending order — newest expiry first, the opposite of List Expiries.
Get Contracts for an Expired Expiry¶
Returns the full contract chain for one expiry that has already passed.
Endpoint
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
underlying | string | ✅ | The underlying symbol, e.g. NIFTY. |
segment | string | ✅ | DERIVATIVE. |
expiry | date | ✅ | The expiry, YYYY-MM-DD. Must be a date returned by List Expired Expiries. |
instrument_type | string | OPTIDX, OPTSTK, FUTIDX or FUTSTK. Omit to get every type. |
Example Request
curl --location 'https://api.indstocks.com/market/instruments/expired/contracts?underlying=NIFTY&segment=DERIVATIVE&expiry=2026-07-28' \
--header 'Authorization: YOUR_ACCESS_TOKEN'
Response Payload (Success)
data is a flat array of contracts — not the paginated object the two search endpoints return.
{
"status": "success",
"data": [
{
"trading_symbol": "NIFTY26JUL2825950CE",
"instrument_type": "OPTIDX",
"strike_price": 25950,
"option_type": "CE",
"lot_size": 75,
"expiry": "2026-07-28"
}
]
}
The full chain arrives in a single response
This endpoint returns the complete chain for the expiry in one array, so no pagination is needed. A NIFTY expiry is typically 460–480 rows — a CE and a PE at each strike, plus the futures contract on monthly expiries. Size your client for the full chain, and pass instrument_type when you only need one contract type.
Take expiry from the expiry list
Pass a date returned by List Expired Expiries for the same underlying. Other dates return 400 {"debug_info": "Invalid or unknown underlying/segment/expiry passed", "message": "Bad Request"}.
Errors¶
Validation errors on these endpoints carry two fields: message with the error category, and debug_info with the specific detail.
{
"debug_info": "segment=EQUITY is not yet supported on this endpoint; use segment=DERIVATIVE",
"message": "Not Supported"
}
Surface debug_info in your logs — it identifies which parameter needs attention. See Error Bucket for the response shapes used across the API.
See Also¶
- Instruments Master — the full CSV dump, and the only place to look up cash-market instruments
- Historical Data — fetch candles for the contracts you find here
- Option Chain — live strike-by-strike quotes for a current expiry
- Error Bucket — error shapes and
error_typevalues