Expirations
Get a list of current or historical option expiration dates for an underlying symbol. If no optional parameters are used, the endpoint returns all expiration dates in the option chain.
Endpoint
https://api.marketdata.app/v1/options/expirations/{underlyingSymbol}/
Method
GET
Request Example
- HTTP
- NodeJS
- Python
- Go
fetch("https://api.marketdata.app/v1/options/expirations/AAPL")
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
import requests
url = "https://api.marketdata.app/v1/options/expirations/AAPL"
response = requests.request("GET", url)
print(response.text)
import (
"fmt"
api "github.com/MarketDataApp/sdk-go"
)
func ExampleOptionsExpirationsRequest() {
expirations, err := OptionsExpirations().UnderlyingSymbol("AAPL").Get()
if err != nil {
fmt.Print(err)
return
}
for _, expiration := range expirations {
fmt.Println(expiration)
}
}
Response Example
{
"s": "ok",
"expirations": [
"2022-09-23",
"2022-09-30",
"2022-10-07",
"2022-10-14",
"2022-10-21",
"2022-10-28",
"2022-11-18",
"2022-12-16",
"2023-01-20",
"2023-02-17",
"2023-03-17",
"2023-04-21",
"2023-06-16",
"2023-07-21",
"2023-09-15",
"2024-01-19",
"2024-06-21",
"2025-01-17"
],
"updated": 1663704000
}
Request Parameters
- Required
- Optional
-
underlyingSymbol
string
The underlying ticker symbol for the options chain you wish to lookup.
-
strike
number
Limit the lookup of expiration dates to the strike provided. This will cause the endpoint to only return expiration dates that include this strike.
-
date
date
Use to lookup a historical list of expiration dates from a specific previous trading day. If date is omitted the expiration dates will be from the current trading day during market hours or from the last trading day when the market is closed. Accepted date inputs:
ISO 8601
,unix
,spreadsheet
.
Response Attributes
- Success
- No Data
- Error
-
s
string
Status will always be
ok
when there is strike data for the underlying/expirations requested. -
expirations
array[date]
The expiration dates requested for the underlying with the option strikes for each expiration.
-
updated
date
The date and time of this list of options strikes was updated in Unix time. For historical strikes, this number should match the
date
parameter.
-
s
string
Status will be
no_data
if no data is found for the request. -
nextTime
number
optionalUnix time of the next quote if there is no data in the requested period, but there is data in a subsequent period.
-
prevTime
number
optionalUnix time of the previous quote if there is no data in the requested period, but there is data in a previous period.
-
s
string
Status will be
error
if the request produces an error response. -
errmsg
string
An error message.