ThetaData Option API

The Option API from ThetaData — 37 operation(s) for option.

OpenAPI Specification

thetadata-option-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Theta Data v3 At-Time Option API
  description: Real-time and historic stock, options, and index data!
  version: 3.0.0
  x-java-package: net.thetadata.generated
servers:
- url: http://127.0.0.1:25503/v3
  description: dev
security: []
tags:
- name: Option
paths:
  /option/list/symbols:
    x-concurrent-limit-ttl-ms: '210'
    x-min-subscription: free
    get:
      summary: Symbols
      operationId: option_list_symbols
      x-codeSamples:
      - lang: Python
        label: pandas
        source: 'from thetadata import ThetaClient


          client = ThetaClient(dataframe_type=''pandas'')

          df = client.option_list_symbols()

          '
      - lang: Python
        label: polars
        source: 'from thetadata import ThetaClient


          client = ThetaClient(dataframe_type=''polars'')

          df = client.option_list_symbols()

          '
      tags:
      - Option
      description: 'A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This endpoint is updated overnight.

        '
      x-sample-urls:
      - url: http://127.0.0.1:25503/v3/option/list/symbols
        description: List all symbols for options
      - url: http://127.0.0.1:25503/v3/option/list/symbols?format=html
        description: Click to open in browser (HTML)
      parameters:
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          description: List all symbols for options
          content:
            text/csv:
              schema:
                type: array
                items: &id001
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: The symbol of the contract, or stock / underlying asset / option / index.
              example: "symbol\r\nA\r\nAA\r\nAAAP\r\nAAAU\r\nAABA\r\n"
            application/json:
              schema: &id002
                type: array
                items: *id001
              example: "{\n  \"response\": [\n    {\"symbol\":\"A\"},\n    {\"symbol\":\"AA\"},\n    {\"symbol\":\"AAAP\"},\n    {\"symbol\":\"AAAU\"},\n    {\"symbol\":\"AABA\"}\n  ]\n}\n"
            application/x-ndjson:
              schema: *id002
              example: '{"symbol":"A"}

                {"symbol":"AA"}

                {"symbol":"AAAP"}

                {"symbol":"AAAU"}

                {"symbol":"AABA"}'
            python/pandas:
              schema: *id002
              example: 'symbol

                0      1BXSL

                1      1CORZ

                2      1INVH

                3      1LNCO

                4      1ZURA

                ...      ...

                15373    ZZV

                15374    ZZZ

                15375   ZZZ1

                15376    ÓPX

                15377   ÓPXW


                [15378 rows x 1 columns]

                '
            python/polars:
              schema: *id002
              example: 'shape: (15_378, 1)

                ┌────────┐

                │ symbol │

                │ ---    │

                │ str    │

                ╞════════╡

                │ 1BXSL  │

                │ 1CORZ  │

                │ 1INVH  │

                │ 1LNCO  │

                │ 1ZURA  │

                │ …      │

                │ ZZV    │

                │ ZZZ    │

                │ ZZZ1   │

                │ ÓPX    │

                │ ÓPXW   │

                └────────┘

                '
  /option/list/dates/{request_type}:
    x-concurrent-limit-ttl-ms: '548'
    x-min-subscription: free
    get:
      summary: Dates
      operationId: option_list_dates
      x-codeSamples:
      - lang: Python
        label: pandas
        source: "from thetadata import ThetaClient\nfrom datetime import date\n\nclient = ThetaClient(dataframe_type='pandas')\ndf = client.option_list_dates(\n    request_type='quote',\n    symbol='AAPL',\n    expiration=date(2022, 9, 30),\n)\n"
      - lang: Python
        label: polars
        source: "from thetadata import ThetaClient\nfrom datetime import date\n\nclient = ThetaClient(dataframe_type='polars')\ndf = client.option_list_dates(\n    request_type='quote',\n    symbol='AAPL',\n    expiration=date(2022, 9, 30),\n)\n"
      tags:
      - Option
      description: 'Lists all dates of data that are available for an option with a given symbol, request type, and expiration.

        This endpoint is updated overnight.

        '
      x-sample-urls:
      - url: http://127.0.0.1:25503/v3/option/list/dates/quote?symbol=AAPL&expiration=20220930
        description: List all dates for an option quote for a given symbol and expiration date
      - url: http://127.0.0.1:25503/v3/option/list/dates/trade?symbol=AAPL&expiration=20220930
        description: List all dates for an option trade for a given symbol with any expiration date
      - url: http://127.0.0.1:25503/v3/option/list/dates/trade?symbol=AAPL&expiration=20220930&format=html
        description: Click to open in browser (HTML)
      parameters:
      - $ref: '#/components/parameters/request_type'
      - $ref: '#/components/parameters/single_symbol'
      - $ref: '#/components/parameters/expiration_no_star'
      - $ref: '#/components/parameters/strike'
      - $ref: '#/components/parameters/right'
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          description: List all dates for an option quote for a given symbol and expiration date
          content:
            text/csv:
              schema:
                type: array
                items: &id003
                  type: object
                  properties:
                    date:
                      type: string
                      format: date
                      description: The date formated as YYYY-MM-DD.
              example: "date\r\n2022-09-12\r\n2022-09-13\r\n2022-09-14\r\n2022-09-16\r\n2022-09-19\r\n"
            application/json:
              schema: &id004
                type: array
                items: *id003
              example: "{\n  \"response\": [\n    {\"date\":\"2022-09-12\"},\n    {\"date\":\"2022-09-13\"},\n    {\"date\":\"2022-09-14\"},\n    {\"date\":\"2022-09-16\"},\n    {\"date\":\"2022-09-19\"}\n  ]\n}\n"
            application/x-ndjson:
              schema: *id004
              example: '{"date":"2022-09-12"}

                {"date":"2022-09-13"}

                {"date":"2022-09-14"}

                {"date":"2022-09-16"}

                {"date":"2022-09-19"}'
            python/pandas:
              schema: *id004
              example: 'date

                0  2025-08-13

                1  2025-08-29

                2  2025-09-19

                '
            python/polars:
              schema: *id004
              example: 'shape: (3, 1)

                ┌────────────┐

                │ date       │

                │ ---        │

                │ str        │

                ╞════════════╡

                │ 2025-08-13 │

                │ 2025-08-29 │

                │ 2025-09-19 │

                └────────────┘

                '
  /option/list/expirations:
    x-concurrent-limit-ttl-ms: '6'
    x-min-subscription: free
    get:
      summary: Expirations
      operationId: option_list_expirations
      x-codeSamples:
      - lang: Python
        label: pandas
        source: 'from thetadata import ThetaClient


          client = ThetaClient(dataframe_type=''pandas'')

          df = client.option_list_expirations(symbol=[''AAPL''])

          '
      - lang: Python
        label: polars
        source: 'from thetadata import ThetaClient


          client = ThetaClient(dataframe_type=''polars'')

          df = client.option_list_expirations(symbol=[''AAPL''])

          '
      tags:
      - Option
      description: 'Lists all dates of expirations that are available for an option with a given symbol.

        This endpoint is updated overnight.

        '
      x-sample-urls:
      - url: http://127.0.0.1:25503/v3/option/list/expirations?symbol=AAPL
        description: List all expirations for an option with a given symbol
      - url: http://127.0.0.1:25503/v3/option/list/expirations?symbol=AAPL&format=html
        description: Click to open in browser (HTML)
      parameters:
      - $ref: '#/components/parameters/multi_symbol'
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          description: List all expirations for an option with a given symbol
          content:
            text/csv:
              schema:
                type: array
                items: &id005
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: The symbol of the contract, or stock / underlying asset / option / index.
                    expiration:
                      type: string
                      format: date
                      description: Expiration date of the contract in YYYY-MM-DD format.
              example: "symbol,expiration\r\nAAPL,2012-06-01\r\nAAPL,2012-06-08\r\nAAPL,2012-06-16\r\nAAPL,2012-06-22\r\nAAPL,2012-06-29\r\n"
            application/json:
              schema: &id006
                type: array
                items: *id005
              example: "{\n  \"response\": [\n    {\"symbol\":\"AAPL\",\"expiration\":\"2012-06-01\"},\n    {\"symbol\":\"AAPL\",\"expiration\":\"2012-06-08\"},\n    {\"symbol\":\"AAPL\",\"expiration\":\"2012-06-16\"},\n    {\"symbol\":\"AAPL\",\"expiration\":\"2012-06-22\"},\n    {\"symbol\":\"AAPL\",\"expiration\":\"2012-06-29\"}\n  ]\n}\n"
            application/x-ndjson:
              schema: *id006
              example: '{"symbol":"AAPL","expiration":"2012-06-01"}

                {"symbol":"AAPL","expiration":"2012-06-08"}

                {"symbol":"AAPL","expiration":"2012-06-16"}

                {"symbol":"AAPL","expiration":"2012-06-22"}

                {"symbol":"AAPL","expiration":"2012-06-29"}'
            python/pandas:
              schema: *id006
              example: 'symbol  expiration

                0       SPY  2012-06-01

                1       SPY  2012-06-08

                2       SPY  2012-06-16

                3       SPY  2012-06-22

                4       SPY  2012-06-29

                ...     ...         ...

                2025    SPY  2027-09-17

                2026    SPY  2027-12-17

                2027    SPY  2028-01-21

                2028    SPY  2028-06-16

                2029    SPY  2028-12-15


                [2030 rows x 2 columns]

                '
            python/polars:
              schema: *id006
              example: 'shape: (2_030, 2)

                ┌────────┬────────────┐

                │ symbol ┆ expiration │

                │ ---    ┆ ---        │

                │ str    ┆ str        │

                ╞════════╪════════════╡

                │ SPY    ┆ 2012-06-01 │

                │ SPY    ┆ 2012-06-08 │

                │ SPY    ┆ 2012-06-16 │

                │ SPY    ┆ 2012-06-22 │

                │ SPY    ┆ 2012-06-29 │

                │ …      ┆ …          │

                │ SPY    ┆ 2027-09-17 │

                │ SPY    ┆ 2027-12-17 │

                │ SPY    ┆ 2028-01-21 │

                │ SPY    ┆ 2028-06-16 │

                │ SPY    ┆ 2028-12-15 │

                └────────┴────────────┘

                '
  /option/list/strikes:
    x-concurrent-limit-ttl-ms: '18'
    x-min-subscription: free
    get:
      summary: Strikes
      operationId: option_list_strikes
      x-codeSamples:
      - lang: Python
        label: pandas
        source: 'from thetadata import ThetaClient

          from datetime import date


          client = ThetaClient(dataframe_type=''pandas'')

          df = client.option_list_strikes(symbol=[''AAPL''], expiration=date(2022, 9, 30))

          '
      - lang: Python
        label: polars
        source: 'from thetadata import ThetaClient

          from datetime import date


          client = ThetaClient(dataframe_type=''polars'')

          df = client.option_list_strikes(symbol=[''AAPL''], expiration=date(2022, 9, 30))

          '
      tags:
      - Option
      description: 'Lists all strikes that are available for an option with a given symbol and expiration date.

        This endpoint is updated overnight.

        '
      x-sample-urls:
      - url: http://127.0.0.1:25503/v3/option/list/strikes?symbol=AAPL&expiration=20220930
        description: List all strikes for an option with a given symbol and expiration date
      - url: http://127.0.0.1:25503/v3/option/list/strikes?symbol=AAPL&expiration=20220930&format=html
        description: Click to open in browser (HTML)
      parameters:
      - $ref: '#/components/parameters/multi_symbol'
      - $ref: '#/components/parameters/expiration_no_star'
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          description: List all strikes for an option with a given symbol and expiration date
          content:
            text/csv:
              schema:
                type: array
                items: &id007
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: The symbol of the contract, or stock / underlying asset / option / index.
                    strike:
                      type: number
                      description: Strike price of the contract in dollars 180.00
              example: "symbol,strike\r\nAAPL,80.000\r\nAAPL,128.000\r\nAAPL,160.000\r\nAAPL,144.000\r\nAAPL,240.000\r\n"
            application/json:
              schema: &id008
                type: array
                items: *id007
              example: "{\n  \"response\": [\n    {\"symbol\":\"AAPL\",\"strike\":80.000},\n    {\"symbol\":\"AAPL\",\"strike\":128.000},\n    {\"symbol\":\"AAPL\",\"strike\":160.000},\n    {\"symbol\":\"AAPL\",\"strike\":144.000},\n    {\"symbol\":\"AAPL\",\"strike\":240.000}\n  ]\n}\n"
            application/x-ndjson:
              schema: *id008
              example: '{"symbol":"AAPL","strike":80.000}

                {"symbol":"AAPL","strike":128.000}

                {"symbol":"AAPL","strike":160.000}

                {"symbol":"AAPL","strike":144.000}

                {"symbol":"AAPL","strike":240.000}'
            python/pandas:
              schema: *id008
              example: 'symbol  strike

                0      SPY   597.0

                1      SPY   661.0

                2      SPY   725.0

                3      SPY   640.0

                4      SPY   704.0

                ..     ...     ...

                200    SPY   683.0

                201    SPY   470.0

                202    SPY   598.0

                203    SPY   662.0

                204    SPY   790.0


                [205 rows x 2 columns]

                '
            python/polars:
              schema: *id008
              example: 'shape: (205, 2)

                ┌────────┬────────┐

                │ symbol ┆ strike │

                │ ---    ┆ ---    │

                │ str    ┆ f64    │

                ╞════════╪════════╡

                │ SPY    ┆ 597.0  │

                │ SPY    ┆ 661.0  │

                │ SPY    ┆ 725.0  │

                │ SPY    ┆ 640.0  │

                │ SPY    ┆ 704.0  │

                │ …      ┆ …      │

                │ SPY    ┆ 683.0  │

                │ SPY    ┆ 470.0  │

                │ SPY    ┆ 598.0  │

                │ SPY    ┆ 662.0  │

                │ SPY    ┆ 790.0  │

                └────────┴────────┘

                '
  /option/list/contracts/{request_type}:
    x-concurrent-limit-ttl-ms: '1716'
    x-min-subscription: value
    x-history-access: true
    get:
      summary: Contracts
      operationId: option_list_contracts
      x-codeSamples:
      - lang: Python
        label: pandas
        source: 'from thetadata import ThetaClient

          from datetime import date


          client = ThetaClient(dataframe_type=''pandas'')

          df = client.option_list_contracts(request_type=''trade'', date=date(2022, 9, 30))

          '
      - lang: Python
        label: polars
        source: 'from thetadata import ThetaClient

          from datetime import date


          client = ThetaClient(dataframe_type=''polars'')

          df = client.option_list_contracts(request_type=''trade'', date=date(2022, 9, 30))

          '
      tags:
      - Option
      description: 'Lists all contracts that were traded or quoted on a particular date.


        If the ``symbol`` parameter is specified, the returned contracts will be filtered to match the symbol.

        Multiple symbols can be specified by separating them with commas such as ``symbol=AAPL,SPY,AMD``

        This endpoint is updated real-time.

        '
      x-sample-urls:
      - url: http://127.0.0.1:25503/v3/option/list/contracts/trade?date=20220930
        description: List all contracts for an option trade with a given date
      - url: http://127.0.0.1:25503/v3/option/list/contracts/quote?symbol=AAPL&date=20220930
        description: List all contracts for an option quote with a given symbol and date
      - url: http://127.0.0.1:25503/v3/option/list/contracts/quote?symbol=AAPL&date=20220930&format=html
        description: Click to open in browser (HTML)
      parameters:
      - $ref: '#/components/parameters/request_type'
      - $ref: '#/components/parameters/opt_multi_symbol'
      - $ref: '#/components/parameters/date'
      - $ref: '#/components/parameters/max_dte'
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          description: List all contracts for an option trade with a given date
          content:
            text/csv:
              schema:
                type: array
                items: &id009
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: The symbol of the contract, or stock / underlying asset / option / index.
                    expiration:
                      type: string
                      format: date
                      description: Expiration date of the contract in YYYY-MM-DD format.
                    strike:
                      type: number
                      description: Strike price of the contract in dollars 180.00
                    right:
                      type: string
                      description: Indicates whether the contract is a call or put option.
              example: "symbol,expiration,strike,right\r\nABNB,2023-06-16,260.000,CALL\r\nAAPL,2023-06-16,260.000,CALL\r\nAAL,2022-09-30,14.500,CALL\r\nABNB,2022-11-04,80.000,PUT\r\nAAPL,2022-11-04,80.000,PUT\r\n"
            application/json:
              schema: &id010
                type: array
                items: *id009
              example: "{\n  \"response\": [\n    {\"symbol\":\"ABNB\",\"strike\":260.000,\"expiration\":\"2023-06-16\",\"right\":\"CALL\"},\n    {\"symbol\":\"AAPL\",\"strike\":260.000,\"expiration\":\"2023-06-16\",\"right\":\"CALL\"},\n    {\"symbol\":\"AAL\",\"strike\":14.500,\"expiration\":\"2022-09-30\",\"right\":\"CALL\"},\n    {\"symbol\":\"ABNB\",\"strike\":80.000,\"expiration\":\"2022-11-04\",\"right\":\"PUT\"},\n    {\"symbol\":\"AAPL\",\"strike\":80.000,\"expiration\":\"2022-11-04\",\"right\":\"PUT\"}\n  ]\n}\n"
            application/x-ndjson:
              schema: *id010
              example: '{"symbol":"ABNB","strike":260.000,"expiration":"2023-06-16","right":"CALL"}

                {"symbol":"AAPL","strike":260.000,"expiration":"2023-06-16","right":"CALL"}

                {"symbol":"AAL","strike":14.500,"expiration":"2022-09-30","right":"CALL"}

                {"symbol":"ABNB","strike":80.000,"expiration":"2022-11-04","right":"PUT"}

                {"symbol":"AAPL","strike":80.000,"expiration":"2022-11-04","right":"PUT"}'
            python/pandas:
              schema: *id010
              example: 'symbol  expiration  strike right

                0       SPY  2026-03-20   605.0   PUT

                1       SPY  2026-01-16   475.0   PUT

                2       SPY  2025-10-03   608.0   PUT

                3       SPY  2026-06-18   735.0  CALL

                4       SPY  2025-10-06   608.0   PUT

                ...     ...         ...     ...   ...

                4701    SPY  2025-10-10   607.0   PUT

                4702    SPY  2025-10-10   607.0  CALL

                4703    SPY  2025-10-31   607.0   PUT

                4704    SPY  2027-01-15   600.0   PUT

                4705    SPY  2027-01-15   600.0  CALL


                [4706 rows x 4 columns]

                '
            python/polars:
              schema: *id010
              example: 'shape: (4_706, 4)

                ┌────────┬────────────┬────────┬───────┐

                │ symbol ┆ expiration ┆ strike ┆ right │

                │ ---    ┆ ---        ┆ ---    ┆ ---   │

                │ str    ┆ str        ┆ f64    ┆ str   │

                ╞════════╪════════════╪════════╪═══════╡

                │ SPY    ┆ 2026-03-20 ┆ 605.0  ┆ PUT   │

                │ SPY    ┆ 2026-01-16 ┆ 475.0  ┆ PUT   │

                │ SPY    ┆ 2025-10-03 ┆ 608.0  ┆ PUT   │

                │ SPY    ┆ 2026-06-18 ┆ 735.0  ┆ CALL  │

                │ SPY    ┆ 2025-10-06 ┆ 608.0  ┆ PUT   │

                │ …      ┆ …          ┆ …      ┆ …     │

                │ SPY    ┆ 2025-10-10 ┆ 607.0  ┆ PUT   │

                │ SPY    ┆ 2025-10-10 ┆ 607.0  ┆ CALL  │

                │ SPY    ┆ 2025-10-31 ┆ 607.0  ┆ PUT   │

                │ SPY    ┆ 2027-01-15 ┆ 600.0  ┆ PUT   │

                │ SPY    ┆ 2027-01-15 ┆ 600.0  ┆ CALL  │

                └────────┴────────────┴────────┴───────┘

                '
  /option/snapshot/ohlc:
    x-skip-concurrent-limit: true
    x-min-subscription: value
    get:
      summary: Open High Low Close
      operationId: option_snapshot_ohlc
      x-codeSamples:
      - lang: Python
        label: pandas
        source: 'from thetadata import ThetaClient

          from datetime import date


          client = ThetaClient(dataframe_type=''pandas'')

          df = client.option_snapshot_ohlc(symbol=''AAPL'', expiration=date(2027, 1, 15))

          '
      - lang: Python
        label: polars
        source: 'from thetadata import ThetaClient

          from datetime import date


          client = ThetaClient(dataframe_type=''polars'')

          df = client.option_snapshot_ohlc(symbol=''AAPL'', expiration=date(2027, 1, 15))

          '
      tags:
      - Option
      description: '- Retrieve a real-time last ohlc of an option contract for the trading day.

        - You might need to change the default expiration date to a different date if it is past the current date.

        '
      x-sample-urls:
      - url: http://127.0.0.1:25503/v3/option/snapshot/ohlc?symbol=AAPL&expiration=20270115&right=call&strike=270.000
        description: Returns OHLC for a given option contract
      - url: http://127.0.0.1:25503/v3/option/snapshot/ohlc?symbol=AAPL&expiration=*
        description: Returns OHLC for all option contracts
      - url: http://127.0.0.1:25503/v3/option/snapshot/ohlc?symbol=AAPL&expiration=*&format=html
        description: Click to open in browser (HTML)
      parameters:
      - $ref: '#/components/parameters/single_symbol'
      - $ref: '#/components/parameters/expiration'
      - $ref: '#/components/parameters/strike'
      - $ref: '#/components/parameters/right'
      - $ref: '#/components/parameters/max_dte'
      - $ref: '#/components/parameters/strike_range'
      - $ref: '#/components/parameters/min_time'
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          description: Returns OHLC for a given option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id011
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    symbol:
                      type: string
                      description: The symbol of the contract, or stock / underlying asset / option / index.
                    expiration:
                      type: string
                      format: date
                      description: Expiration date of the contract in YYYY-MM-DD format.
                    strike:
                      type: number
                      description: Strike price of the contract in dollars 180.00
                    right:
                      type: string
                      description: Indicates whether the contract is a call or put option.
                    open:
                      type: number
                      description: The opening trade price.
                    high:
                      type: number
                      description: The highest traded price.
                    low:
                      type: number
                      description: The lowest traded price.
                    close:
                      type: number
                      description: The closing traded price.
                    volume:
                      type: integer
                      description: The amount of contracts / shares traded.
                    count:
                      type: integer
                      description: The amount of trades.
              example: "timestamp,symbol,expiration,strike,right,open,high,low,close,volume,count\r\n2025-08-20T15:25:31.03,AAPL,2026-01-16,275.000,CALL,1.78,1.78,1.51,1.51,202,29\r\n"
            application/json:
              schema: &id012
                type: array
                items: *id011
              example: "{\n  \"response\": [\n    {\n      \"contract\": {\"symbol\":\"AAPL\",\"expiration\":\"2026-01-16\",\"strike\":275.000,\"right\":\"CALL\"},\n      \"data\": [\n        {\"volume\":202,\"high\":1.78,\"low\":1.51,\"count\":29,\"close\":1.51,\"open\":1.78,\"timestamp\":\"2025-08-20T15:25:31.03\"}\n      ]\n    }\n  ]\n}\n"
            application/x-ndjson:
              schema: *id012
              example: '{"volume":202,"symbol":"AAPL","high":1.78,"low":1.51,"strike":275.000,"count":29,"expiration":"2026-01-16","right":"CALL","close":1.51,"open":1.78,"timestamp":"2025-08-20T15:25:31.03"}'
            python/pandas:
              schema: *id012
              example: 'timestamp symbol  expiration  strike right  open   high   low  close  volume  count

                0 2026-04-27 11:57:06.802000-04:00   AAPL  2026-12-18   270.0  CALL  24.0  25.75  24.0   24.8     114     22

                '
            python/polars:
              schema: *id012
              example: 'shape: (1, 11)

                ┌────────────────────────────────┬────────┬────────────┬────────┬───────┬──────┬───────┬──────┬───────┬────────┬───────┐

                │ timestamp                      ┆ symbol ┆ expiration ┆ strike ┆ right ┆ open ┆ high  ┆ low  ┆ close ┆ volume ┆ count │

                │ ---                            ┆ ---    ┆ ---        ┆ ---    ┆ ---   ┆ ---  ┆ ---   ┆ ---  ┆ ---   ┆ ---    ┆ ---   │

                │ datetime[ms, America/New_York] ┆ str    ┆ str        ┆ f64    ┆ str   ┆ f64  ┆ f64   ┆ f64  ┆ f64   ┆ i64    ┆ i64   │

                ╞════════════════════════════════╪════════╪════════════╪════════╪═══════╪══════╪═══════╪══════╪═══════╪════════╪═══════╡

                │ 2026-04-27 11:57:06.802 EDT    ┆ AAPL   ┆ 2026-12-18 ┆ 270.0  ┆ CALL  ┆ 24.0 ┆ 25.75 ┆ 24.0 ┆ 24.8  ┆ 114    ┆ 22    │

                └────────────────────────────────┴────────┴────────────┴────────┴───────┴──────┴───────┴──────┴───────┴────────┴───────┘

                '
  /option/snapshot/trade:
    x-skip-concurrent-limit: true
    x-min-subscription: standard
    get:
      summary: Trade
      operationId: option_snapshot_trade
      x-codeSamples:
      - lang: Python
        label: pandas
        source: 'from thetadata import ThetaClient

          from datetime import date


          client = ThetaClient(dataframe_type=''pandas'')

          df = client.option_snapshot_trade(symbol=''AAPL'', expiration=date(2027, 1, 15))

          '
      - lang: Python
        label: polars
        source: 'from thetadata import ThetaClient

          from datetime import date


          client = ThetaClient(dataframe_type=''polars'')

          df = client.option_snapshot_trade(symbol=''AAPL'', expiration=date(2027, 1, 15))

          '
      tags:
      - Option
      description: '- Retrieve the real-time last trade of an option contract.

        - You might need to change the default expiration date to a different date if it is past the current date.

        - This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night.

        '
      x-sample-urls:
      - url: http://127.0.0.1:25503/v3/option/snapshot/trade?symbol=AAPL&expiration=2027-01-15&right=call&strike=270.000
        description: Returns last trade for an option contract
      - url: http://127.0.0.1:25503/v3/option/snapshot/trade?symbol=AAPL&expiration=2027-01-15
        description: Returns last trade for all option contracts with an expiration of 2027-01-15
      - url: http://127.0.0.1:25503/v3/option/snapshot/trade?symbol=AAPL&expiration=2027-01-15&format=html
        description: Click to open in browser (HTML)
      parameters:
      - $ref: '#/components/parameters/single_symbol'
      - $ref: '#/components/parameters/expiration_no_star'
      - $ref: '#/components/parameters/strike'
      - $ref: '#/components/parameters/right'
      - $ref: '#/components/parameters/strike_range'
      - $ref: '#/components/parameters/min_time'
      - $ref: '#/components/parameters/format'
      responses:
        '200':
          description: Returns last NBBO quote for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id013
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: The symbol of the contract, or stock / underlying asset / option / index.
                    expiration:
                      type: string
                      format: date
 

# --- truncated at 32 KB (497 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/thetadata/refs/heads/main/openapi/thetadata-option-api-openapi.yml