Skip to main content

Expirations

Retrieve the list of current or historical option expiration dates for a given underlying symbol.

Making Requests

Use the expirations() method on the options resource to fetch available expiration dates.

Output FormatResult PayloadDescription
internal (default)OptionsExpirationsResponse or OptionsExpirationsHumanResponseObject with the list of expirations.
jsonRaw JSON objectThe raw response as returned by the API.

expirations

// Positional form
expirations<P>(
symbol: string,
params?: P,
): MarketDataResult<OptionsExpirationsResponse | OptionsExpirationsHumanResponse>

// Object form
expirations<P>(
params: P & { symbol: string },
): MarketDataResult<OptionsExpirationsResponse | OptionsExpirationsHumanResponse>

Fetches the list of expirations for a single underlying symbol.

Parameters

  • symbol (string)

    The underlying stock symbol.

  • strike (number, optional)

    Filter to expirations that have at least one contract at the given strike.

  • date (string | Date, optional)

    Fetch expirations as-of a specific historical date.

  • outputFormat (optional): The format of the returned data. Alias: format.

  • dateFormat (optional): Date format. Alias: dateformat.

  • columns (optional): Columns to include.

  • useHumanReadable (optional): Use human-readable field names. Alias: human.

Returns

import { MarketDataClient } from "marketdata-sdk-js";

const client = new MarketDataClient();

const result = await client.options.expirations("AAPL");

result.match(
(data) => {
console.log(`Updated: ${data.updated}`);
for (const exp of data.expirations) {
console.log(exp);
}
},
(error) => console.error(error.message),
);

OptionsExpirationsResponse

interface OptionsExpirationsResponse {
s: string;
expirations: string[];
updated: number;
}

Properties

  • s (string): Status indicator.
  • expirations (string[]): List of expiration dates in YYYY-MM-DD format.
  • updated (number): Unix timestamp when the data was last updated.

OptionsExpirationsHumanResponse

interface OptionsExpirationsHumanResponse {
s?: string;
Expirations: string[];
Date: number;
}

OptionsExpirationsHumanResponse is returned when human: true is set.