Skip to main content

Lookup

Convert a human-readable option description to the standard OCC option symbol format.

Making Requests

Use the lookup() method on the options resource to convert option descriptions:

Output FormatReturn TypeDescription
JSONLookupReturns a Lookup object containing the OCC symbol (default).
CSVLookupReturns a Lookup object with CSV data accessible via getCsv().
HTMLLookupReturns a Lookup object with HTML data accessible via getHtml().
HTML Not Yet Available

Format::HTML is included for forward compatibility, but HTML responses are not currently implemented by the Market Data API.

lookup

public function lookup(
string $input,
?Parameters $parameters = null
): Lookup

Generate a properly formatted OCC option symbol based on a human-readable description of an option. This endpoint converts text such as "AAPL 7/28/23 $200 Call" to OCC option symbol format: AAPL230728C00200000.

Parameters

  • input (string)

    A human-readable string containing:

    1. Stock symbol
    2. Strike price
    3. Expiration date
    4. Option side (put or call)

    Example: "AAPL 7/28/23 $200 Call"

  • parameters (Parameters, optional)

    Universal parameters for customizing the output format. See Parameters for details.

Returns

  • Lookup

    A Lookup response object containing the OCC-formatted option symbol.

Notes

  • The OCC (Options Clearing Corporation) symbol format is: SYMBOL + YYMMDD + C/P + STRIKE(8 digits)
  • Example: AAPL230728C00200000 = AAPL July 28, 2023 $200 Call
  • The input parser is flexible and accepts various date formats and orderings.
<?php

use MarketDataApp\Client;

$client = new Client();

// Convert human-readable description to OCC symbol
$lookup = $client->options->lookup('AAPL 7/28/23 $200 Call');

echo "Input: AAPL 7/28/23 $200 Call\n";
echo "OCC Symbol: " . $lookup->option_symbol . "\n";

Output

Input: AAPL 7/28/23 $200 Call
OCC Symbol: AAPL230728C00200000

Lookup

class Lookup extends ResponseBase
{
public string $status;
public string $option_symbol;
}

Represents the result of an option symbol lookup.

Properties

  • status (string): Response status ("ok" or "error").
  • option_symbol (string): The OCC-formatted option symbol.

Methods

  • getCsv(): Returns the raw CSV data (when using Format::CSV).
  • getHtml(): Returns the raw HTML data (when using Format::HTML).
  • isJson(): Returns true if the response contains JSON data.