For the complete documentation index, see llms.txt. This page is also available as Markdown.

Expiry

Get available expiry dates for a futures or options symbol.

Endpoint URL

Local Host   :  POST http://127.0.0.1:5000/api/v1/expiry
Ngrok Domain :  POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/expiry
Custom Domain:  POST https://<your-custom-domain>/api/v1/expiry

Sample API Request

{
  "apikey": "<your_app_apikey>",
  "symbol": "NIFTY",
  "exchange": "NFO",
  "instrumenttype": "options"
}

Sample cURL Request

curl -X POST http://127.0.0.1:5000/api/v1/expiry \
  -H 'Content-Type: application/json' \
  -d '{
  "apikey": "<your_app_apikey>",
  "symbol": "NIFTY",
  "exchange": "NFO",
  "instrumenttype": "options"
}'

Sample API Response

Sample API Request (Futures)

Request Body

Parameter
Description
Mandatory/Optional
Default Value

apikey

Your OpenAlgo API key

Mandatory

-

symbol

Underlying symbol (e.g., NIFTY, BANKNIFTY)

Mandatory

-

exchange

Exchange code: NFO, BFO, CDS, BCD, MCX

Mandatory

-

instrumenttype

Instrument type: "options" or "futures"

Mandatory

-

Response Fields

Field
Type
Description

status

string

"success" or "error"

message

string

Summary of results

data

array

Array of expiry dates in DD-MMM-YY format

Notes

  • Expiry dates are sorted in ascending order (nearest first)

  • Weekly expiries are included for index options (NIFTY, BANKNIFTY)

  • Monthly expiries extend further into the future

  • Use this data to populate expiry dropdowns in your application

  • Format is DD-MMM-YY (e.g., 10-JUL-25)

Use Cases

  • Options trading: Get available expiries for option selection

  • Futures trading: Find current and far-month futures

  • Strategy building: Select appropriate expiry for strategy


Back to: API Documentation

Last updated