Skip to main content

Option Chain (JavaScript SDK)

  • Last updated
  • View as Markdown

Retrieve the full option chain — every call and put contract — for any supported underlying symbol, with extensive filtering options.

Making Requests​

Use the chain() method on the options resource to fetch an option chain. The response includes Greeks (delta, gamma, theta, vega, IV), intrinsic/extrinsic value, and underlying price alongside the quote fields.

Output FormatResult PayloadDescription
internal (default)OptionsChain[] or OptionsChainHuman[]Array of decoded option-contract records.
jsonRaw JSON objectThe compressed, array-keyed response object.
csvBlobCSV payload. Use .save(filename) to write it.

chain​

// Positional form
chain<P>(
symbol: string,
params?: P,
): MarketDataPromise<OptionsChain[] | OptionsChainHuman[]>

// Object form
chain<P>(
params: P & { symbol: string },
): MarketDataPromise<OptionsChain[] | OptionsChainHuman[]>

Fetches the option chain for a single underlying symbol.

Parameters​

  • symbol (string)

    The underlying stock symbol (e.g. "AAPL").

  • date (string | Date, optional)

    Fetch the chain as-of a specific historical date (end-of-day snapshot).

  • expiration (string | Date, optional)

    Filter by specific expiration date.

  • dte (number, optional)

    Filter by number of days to expiration.

  • from / to (string | Date, optional)

    Range filter for expiration dates.

  • month (number, optional, 1–12), year (number, optional)

    Filter by expiration month and/or year.

  • weekly / monthly / quarterly (boolean, optional)

    Filter by expiration cycle type.

  • strike (number | string, optional)

    Filter by specific strike price.

  • delta (number, optional)

    Filter by target delta value.

  • strikeLimit (number, optional)

    Limit the response to the N strikes nearest the underlying price.

  • range (string, optional)

    Filter by in-the-money / out-of-the-money range (e.g. "itm", "otm").

  • minBid / maxBid / minAsk / maxAsk (number, optional)

    Filter by quote price thresholds.

  • maxBidAskSpread (number, optional), maxBidAskSpreadPct (number, optional)

    Filter by spread thresholds.

  • minOpenInterest (number, optional), minVolume (number, optional)

    Filter by liquidity thresholds.

  • nonstandard (boolean, optional)

    Include or exclude non-standard contracts.

  • side ("call" | "put" | "both", optional)

    Filter by option side.

  • am / pm (boolean, optional)

    Filter by AM-settled or PM-settled contracts.

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

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

  • columns (optional): Columns to include.

  • addHeaders (optional): Whether to include headers in CSV output. Alias: headers.

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

  • mode (optional): The data mode to use.

Returns​

import { MarketDataClient } from "@marketdata/sdk";

const client = new MarketDataClient();

try {
const contracts = await client.options.chain("AAPL");
console.log(`Got ${contracts.length} contracts`);
} catch (error) {
console.error(error);
}

OptionsChain​

interface OptionsChain {
s?: string;
optionSymbol: string;
underlying: string;
expiration: number;
side: string;
strike: number;
firstTraded: number;
dte: number;
updated: number;
bid: number | null;
bidSize: number | null;
mid: number | null;
ask: number | null;
askSize: number | null;
last: number | null;
openInterest: number | null;
volume: number | null;
inTheMoney: boolean;
intrinsicValue: number;
extrinsicValue: number;
underlyingPrice: number;
iv: number | null;
delta: number | null;
gamma: number | null;
theta: number | null;
vega: number | null;
}

Properties​

  • optionSymbol (string): OCC-format option symbol (e.g. "AAPL271217C00250000").
  • underlying (string): The underlying stock symbol.
  • expiration (number): Unix timestamp of the expiration date.
  • side (string): "call" or "put".
  • strike (number): The strike price.
  • firstTraded (number): Unix timestamp when the contract first traded.
  • dte (number): Days to expiration.
  • updated (number): Unix timestamp when the quote was last updated.
  • bid, ask, mid, last (number | null): Quote prices.
  • bidSize, askSize (number | null): Quote sizes.
  • openInterest, volume (number | null): Liquidity metrics.
  • inTheMoney (boolean): Whether the contract is currently in the money.
  • intrinsicValue, extrinsicValue (number): Value decomposition.
  • underlyingPrice (number): Price of the underlying at quote time.
  • iv, delta, gamma, theta, vega (number | null): Implied volatility and Greeks.

OptionsChainHuman​

When human: true is set, field names are returned in Title_Case: Symbol, Underlying, Expiration_Date, Option_Side, Strike, Days_To_Expiration, Bid, Ask, Mid, Open_Interest, Volume, In_The_Money, IV, Delta, Gamma, Theta, Vega, etc.