Skip to main content

Expiry

POST /api/v1/expiry​

The Expiry API allows you to retrieve expiry dates for F&O (Futures and Options) instruments for a given underlying symbol. This API helps you get all available expiry dates for futures or options contracts of a specific underlying asset.

Endpoint​

Hosted URL   :  POST https://imc.layr0.org/api/v1/expiry

Request Format​

Headers​

  • Content-Type: application/json

Body Parameters​

ParameterTypeRequiredDescription
apikeystringYesYour IMC API key for authentication
symbolstringYesUnderlying symbol (e.g., NIFTY, BANKNIFTY, RELIANCE)
exchangestringYesExchange code (NFO, BFO, MCX, CDS)
instrumenttypestringYesType of instrument - "futures" or "options"

Supported Exchanges and Instruments​

ExchangeFuturesOptionsExamples
NFO✓✓NIFTY, BANKNIFTY, RELIANCE
BFO✓✓SENSEX, BANKEX
MCX✓✓GOLD, SILVER, CRUDEOIL
CDS✓✓USDINR, EURINR

Request and Response Examples​

NIFTY Futures (NFO)​

Request:

{
"apikey": "IMC-api-key",
"symbol": "NIFTY",
"exchange": "NFO",
"instrumenttype": "futures"
}

Response:

{
"data": [
"31-JUL-25",
"28-AUG-25",
"25-SEP-25"
],
"message": "Found 3 expiry dates for NIFTY futures in NFO",
"status": "success"
}

Error Responses​

  • 401 Unauthorized: Invalid/expired broker session or unauthorized.
  • 403 Forbidden: Invalid IMC API key or permission error.
  • 429 Too Many Requests: Rate limit exceeded (where detectable).
  • 500 Internal Server Error: Unclassified internal failure.

See also: HTTP Status Codes for detailed meanings.

NIFTY Options (NFO)​

Request:

{
"apikey": "IMC-api-key",
"symbol": "NIFTY",
"exchange": "NFO",
"instrumenttype": "options"
}

Response:

{
"data": [
"10-JUL-25",
"17-JUL-25",
"24-JUL-25",
"31-JUL-25",
"07-AUG-25",
"28-AUG-25",
"25-SEP-25",
"24-DEC-25",
"26-MAR-26",
"25-JUN-26",
"31-DEC-26",
"24-JUN-27",
"30-DEC-27",
"29-JUN-28",
"28-DEC-28",
"28-JUN-29",
"27-DEC-29",
"25-JUN-30"
],
"message": "Found 18 expiry dates for NIFTY options in NFO",
"status": "success"
}

GOLD Futures (MCX)​

Request:

{
"apikey": "IMC-api-key",
"symbol": "GOLD",
"exchange": "MCX",
"instrumenttype": "futures"
}

Response:

{
"data": [
"05-AUG-25",
"03-OCT-25",
"05-DEC-25",
"05-FEB-26",
"02-APR-26",
"05-JUN-26"
],
"message": "Found 6 expiry dates for GOLD futures in MCX",
"status": "success"
}

USDINR Futures (CDS)​

Request:

{
"apikey": "IMC-api-key",
"symbol": "USDINR",
"exchange": "CDS",
"instrumenttype": "futures"
}

Response:

{
"data": [
"11-JUL-25",
"18-JUL-25",
"25-JUL-25",
"29-JUL-25",
"01-AUG-25",
"08-AUG-25",
"14-AUG-25",
"22-AUG-25",
"26-AUG-25",
"29-AUG-25",
"04-SEP-25",
"12-SEP-25",
"19-SEP-25",
"26-SEP-25",
"29-OCT-25",
"26-NOV-25",
"29-DEC-25",
"28-JAN-26",
"25-FEB-26",
"27-MAR-26",
"28-APR-26",
"27-MAY-26",
"26-JUN-26"
],
"message": "Found 23 expiry dates for USDINR futures in CDS",
"status": "success"
}

Error Response​

{
"status": "error",
"message": "Invalid IMC apikey"
}

Response Fields​

FieldTypeDescription
statusstringResponse status: "success" or "error"
messagestringDescriptive message about the response
dataarrayArray of expiry dates in DD-MMM-YY format, sorted chronologically

Error Codes​

HTTP StatusError TypeDescription
200SuccessRequest processed successfully
400Bad RequestInvalid request parameters
401UnauthorizedInvalid/expired broker session or unauthorized
403ForbiddenInvalid IMC API key or permission error
429Too Many RequestsRate limit exceeded (where detectable)
500Server ErrorInternal server error (unclassified internal failure)

Error Messages​

MessageDescription
"Invalid IMC apikey"The provided API key is invalid
"Symbol parameter is required and cannot be empty"Symbol field is missing or empty
"Exchange parameter is required and cannot be empty"Exchange field is missing or empty
"Instrumenttype parameter is required and cannot be empty"Instrumenttype field is missing or empty
"Instrumenttype must be either 'futures' or 'options'"Invalid instrumenttype value
"Exchange must be one of: NFO, BFO, MCX, CDS"Invalid exchange value
"No expiry dates found for [symbol] [instrumenttype] in [exchange]"No matching expiry dates found

Notes​

  • Expiry dates are returned in DD-MMM-YY format (e.g., "31-JUL-25")
  • Dates are sorted chronologically from earliest to latest
  • The API uses exact symbol matching to avoid confusion (e.g., "NIFTY" won't match "BANKNIFTY")
  • The API accepts standardized futures and options values. Internally, broker master contracts may label options as OPTSTK, OPTIDX, OPTFUT, OPTCUR, OPTIRC, or direct CE/PE contract types; these labels are normalized by the service.
  • Rate limiting is applied as per your IMC server configuration

Stock option lookup example​

For a stock such as RELIANCE, the cash symbol is quoted on NSE, while its derivative contracts are listed on NFO:

RELIANCE + NSE
-> derivative venue NFO
-> expiry(RELIANCE, NFO, options)
-> optionchain(RELIANCE, NSE, DDMMMYY)

Use NFO when requesting expiries. The option-chain request uses the underlying quote exchange (NSE for an NSE stock, NSE_INDEX for an NSE index), while the service resolves the actual option contracts on NFO. The expiry response remains an array of display values such as 31-JUL-25; option-chain consumers must submit the canonical DDMMMYY form, 31JUL25.

Rate Limits​

This API endpoint is subject to rate limiting. The default rate limit is 10 requests per second per API key, but this may vary based on your IMC server configuration.

Common Use Cases​

  1. Options Strategy Planning: Get all available expiry dates for options to plan multi-leg strategies
  2. Futures Trading: Identify available futures contracts for different expiry months
  3. Calendar Spreads: Find suitable expiry dates for calendar spread strategies

Integration Tips​

  • Cache the expiry dates locally to reduce API calls
  • Filter expiry dates based on your trading strategy requirements
  • Consider time to expiry when selecting contracts
  • Use the chronologically sorted expiry dates for time-based analysis
  • Validate the symbol format according to IMC symbol conventions before making API calls