openapi: 3.1.0

info:
  title: Theta Data v3
  description: Real-time and historic stock, options, and index data!
  version: 3.0.0
  x-java-package: net.thetadata.generated

servers:
  - url: 'https://localhost:25503/v3'
    description: dev

security: []


paths:
#
# STOCK ENDPOINTS
#
  /stock/list/symbols:
    x-min-subscription: free
    get:
      summary: Symbols
      operationId: stock_list_symbols
      tags:
        - Stock
        - List
      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 stocks. This endpoint is updated overnight.
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/list/symbols
          description: "List all stock symbols"
      parameters:
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: List all stock symbols
          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\nAAA\r\nAAAA\r\nAAAP\r\n"
            application/json:
              schema: &id002
                type: array
                items: *id001
              example:
                symbol:
                - A
                - AA
                - AAA
                - AAAA
                - AAAP
            application/x-ndjson:
              schema: *id002
              example: '{"symbol":"A"}

                {"symbol":"AA"}

                {"symbol":"AAA"}

                {"symbol":"AAAA"}

                {"symbol":"AAAP"}'

  /stock/list/dates/{request_type}:
    x-min-subscription: free
    get:
      summary: Dates
      operationId: stock_list_dates
      tags:
        - Stock
        - List
      description: |
        Lists all dates of data that are available for a stock with a given request type and symbol. This endpoint is updated overnight.
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/list/dates/quote?symbol=AAPL
          description: "List all dates for a stock quote for a given symbol"
        - url: http://localhost:25503/v3/stock/list/dates/trade?symbol=AAPL,SPY
          description: "List all dates for a stock trade for multiple symbols"
        - url: http://localhost:25503/v3/stock/list/dates/trade?symbol=*
          description: "List all dates for a stock trade for all symbols"
      parameters:
        - $ref: "#/components/parameters/request_type"
        - $ref: "#/components/parameters/multi_symbol"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: List all dates for a stock quote for a given symbol
          content:
            text/csv:
              schema:
                type: array
                items: &id003
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: The symbol of the contract, or stock / underlying asset / option / index.
                    date:
                      type: string
                      format: date
                      description: The date formated as YYYY-MM-DD.
              example: "symbol,date\r\nAAPL,2016-08-19\r\nAAPL,2016-08-18\r\nAAPL,2016-08-17\r\nAAPL,2016-08-16\r\nAAPL,2016-08-23\r\
                \n"
            application/json:
              schema: &id004
                type: array
                items: *id003
              example:
                date:
                - '2016-08-19'
                - '2016-08-18'
                - '2016-08-17'
                - '2016-08-16'
                - '2016-08-23'
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
            application/x-ndjson:
              schema: *id004
              example: '{"date":"2016-08-19","symbol":"AAPL"}

                {"date":"2016-08-18","symbol":"AAPL"}

                {"date":"2016-08-17","symbol":"AAPL"}

                {"date":"2016-08-16","symbol":"AAPL"}

                {"date":"2016-08-23","symbol":"AAPL"}'

  /stock/snapshot/ohlc:
    x-min-subscription: value
    get:
      summary: Open High Low Close
      operationId: stock_snapshot_ohlc
      tags:
        - Stock
        - Snapshot
      description: |
        
        Provides a real-time Open, High, Low, Close for the current day.
        * Returns a real-time session OHLC from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks).
        * Returns a 15-minute delayed session OHLC from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs) if the account has the stocks value subscription.
        * ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a weekend where there were no eligible messages sent over exchange feeds. We recommend using historic requests during the weekend.
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/snapshot/ohlc?symbol=*
          description: "Returns OHLC for stocks for all symbols"
        - url: http://localhost:25503/v3/stock/snapshot/ohlc?symbol=AAPL&venue=nqb
          description: "Returns OHLC for a given stock trade from the Nasdaq Basic feed"
      parameters:
        - $ref: "#/components/parameters/multi_symbol"
        - $ref: "#/components/parameters/venue"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns OHLC for stocks for all symbols
          content:
            text/csv:
              schema:
                type: array
                items: &id005
                  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.
                    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,open,high,low,close,volume,count\r\n2025-08-20T16:10:04.43,CVCO,492.0000,492.0000,480.5477,485.1100,119656,7684\r\
                \n2025-08-20T16:11:13.962,IFRX,0.8900,0.9199,0.8529,0.8929,57048,138\r\n2025-08-20T16:04:10.564,KLXY,0.0000,0.0000,0.0000,0.0000,9,6\r\
                \n2025-08-20T16:04:07.554,HCOW,23.5600,23.6976,23.5600,23.6616,3648,44\r\n2025-08-20T16:22:32.726,SCS,16.2000,16.3200,16.1550,16.1800,992620,7690\r\
                \n"
            application/json:
              schema: &id006
                type: array
                items: *id005
              example:
                volume:
                - 119656
                - 57048
                - 9
                - 3648
                - 992620
                symbol:
                - CVCO
                - IFRX
                - KLXY
                - HCOW
                - SCS
                high:
                - 492.0
                - 0.9199
                - 0.0
                - 23.6976
                - 16.32
                low:
                - 480.5477
                - 0.8529
                - 0.0
                - 23.56
                - 16.155
                count:
                - 7684
                - 138
                - 6
                - 44
                - 7690
                close:
                - 485.11
                - 0.8929
                - 0.0
                - 23.6616
                - 16.18
                open:
                - 492.0
                - 0.89
                - 0.0
                - 23.56
                - 16.2
                timestamp:
                - '2025-08-20T16:10:04.43'
                - '2025-08-20T16:11:13.962'
                - '2025-08-20T16:04:10.564'
                - '2025-08-20T16:04:07.554'
                - '2025-08-20T16:22:32.726'
            application/x-ndjson:
              schema: *id006
              example: '{"volume":119656,"symbol":"CVCO","high":492.0000,"low":480.5477,"count":7684,"close":485.1100,"open":492.0000,"timestamp":"2025-08-20T16:10:04.43"}

                {"volume":57048,"symbol":"IFRX","high":0.9199,"low":0.8529,"count":138,"close":0.8929,"open":0.8900,"timestamp":"2025-08-20T16:11:13.962"}

                {"volume":9,"symbol":"KLXY","high":0.0000,"low":0.0000,"count":6,"close":0.0000,"open":0.0000,"timestamp":"2025-08-20T16:04:10.564"}

                {"volume":3648,"symbol":"HCOW","high":23.6976,"low":23.5600,"count":44,"close":23.6616,"open":23.5600,"timestamp":"2025-08-20T16:04:07.554"}

                {"volume":992620,"symbol":"SCS","high":16.3200,"low":16.1550,"count":7690,"close":16.1800,"open":16.2000,"timestamp":"2025-08-20T16:22:32.726"}'

  /stock/snapshot/trade:
    x-min-subscription: standard
    get:
      summary: Trade
      operationId: stock_snapshot_trade
      tags:
        - Stock
        - Snapshot
      description: |
        
        Returns a real-time last trade from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks).

        - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a weekend where there were no eligible messages sent over exchange feeds. We recommend using historic requests during the weekend.
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/snapshot/trade?symbol=AAPL
          description: "Returns last trade for stocks for a given symbol"
      parameters:
        - $ref: "#/components/parameters/multi_symbol"
        - $ref: "#/components/parameters/venue"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns last trade for stocks for a given symbol
          content:
            text/csv:
              schema:
                type: array
                items: &id007
                  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.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    price:
                      type: number
                      description: The trade price.
              example: "timestamp,symbol,sequence,size,condition,price\r\n2025-08-20T16:36:05.549,AAPL,63539137,23,1,225.7500\r\
                \n"
            application/json:
              schema: &id008
                type: array
                items: *id007
              example:
                symbol:
                - AAPL
                sequence:
                - 63539137
                condition:
                - 1
                size:
                - 23
                price:
                - 225.75
                timestamp:
                - '2025-08-20T16:36:05.549'
            application/x-ndjson:
              schema: *id008
              example: '{"symbol":"AAPL","sequence":63539137,"condition":1,"size":23,"price":225.7500,"timestamp":"2025-08-20T16:36:05.549"}'

  /stock/snapshot/quote:
    x-min-subscription: value
    get:
      summary: Quote
      operationId: stock_snapshot_quote
      tags:
        - Stock
        - Snapshot
      description: |
        * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks).
        * Returns a 15-minute delayed NBBO quote from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) subscription.
        - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a weekend where there were no eligible messages sent over exchange feeds. We recommend using historic requests during the weekend.
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/snapshot/quote?symbol=*
          description: "Returns last quote for stocks for all symbols"
        - url: http://localhost:25503/v3/stock/snapshot/quote?symbol=AAPL&venue=nqb
          description: "Returns OHLC for a given stock trade from the Nasdaq Basic feed"
      parameters:
        - $ref: "#/components/parameters/multi_symbol"
        - $ref: "#/components/parameters/venue"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns last quote for stocks for all symbols
          content:
            text/csv:
              schema:
                type: array
                items: &id009
                  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.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "timestamp,symbol,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\
                \n2025-08-20T16:03:05.142,CVCO,1,29,475.75,0,3,29,494.33,0\r\n2025-08-20T16:10:05.032,KLXY,200,29,12.40,0,200,29,37.18,0\r\
                \n2025-08-20T16:21:05.781,IFRX,100,29,0.7510,0,45,29,0.9500,0\r\n2025-08-20T16:19:55.101,SCS,100,29,14.64,0,100,29,17.60,0\r\
                \n2025-08-20T16:33:50.877,BBC,100,29,13.29,0,2800,29,24.06,0\r\n"
            application/json:
              schema: &id010
                type: array
                items: *id009
              example:
                symbol:
                - CVCO
                - KLXY
                - IFRX
                - SCS
                - BBC
                ask_size:
                - 3
                - 200
                - 45
                - 100
                - 2800
                bid_size:
                - 1
                - 200
                - 100
                - 100
                - 100
                ask_exchange:
                - 29
                - 29
                - 29
                - 29
                - 29
                ask_condition:
                - 0
                - 0
                - 0
                - 0
                - 0
                bid_exchange:
                - 29
                - 29
                - 29
                - 29
                - 29
                ask:
                - 494.33
                - 37.18
                - 0.95
                - 17.6
                - 24.06
                bid:
                - 475.75
                - 12.4
                - 0.751
                - 14.64
                - 13.29
                bid_condition:
                - 0
                - 0
                - 0
                - 0
                - 0
                timestamp:
                - '2025-08-20T16:03:05.142'
                - '2025-08-20T16:10:05.032'
                - '2025-08-20T16:21:05.781'
                - '2025-08-20T16:19:55.101'
                - '2025-08-20T16:33:50.877'
            application/x-ndjson:
              schema: *id010
              example: '{"symbol":"CVCO","ask_size":3,"bid_size":1,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":494.33,"bid":475.75,"bid_condition":0,"timestamp":"2025-08-20T16:03:05.142"}

                {"symbol":"KLXY","ask_size":200,"bid_size":200,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":37.18,"bid":12.40,"bid_condition":0,"timestamp":"2025-08-20T16:10:05.032"}

                {"symbol":"IFRX","ask_size":45,"bid_size":100,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":0.9500,"bid":0.7510,"bid_condition":0,"timestamp":"2025-08-20T16:21:05.781"}

                {"symbol":"SCS","ask_size":100,"bid_size":100,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":17.60,"bid":14.64,"bid_condition":0,"timestamp":"2025-08-20T16:19:55.101"}

                {"symbol":"BBC","ask_size":2800,"bid_size":100,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":24.06,"bid":13.29,"bid_condition":0,"timestamp":"2025-08-20T16:33:50.877"}'

  /stock/history/eod:
    x-min-subscription: free
    get:
      summary: End of Day
      operationId: stock_history_eod
      tags:
        - Stock
        - History
      description:  |
        
        Since [the equity SIPs](/Articles/Data-And-Requests/The-SIPs.html) only generate a partial EOD report, Theta Data generates a national EOD report at 17:15 ET each day. ``created`` represents the datetime the report was generated and ``last_trade`` represents the datetime of the last trade. The quote in the response represents the last NBBO reported by [CTA or UTP](/Articles/Data-And-Requests/The-SIPs.html) at the time of report generation. You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html). Theta Data plans to avail SIP EOD reports in the near future.
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/history/eod?symbol=AAPL&start_date=20240101&end_date=20240131
          description: "Returns EOD report for a given symbol between specified dates (inclusive)"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns EOD report for a given symbol between specified dates (inclusive)
          content:
            text/csv:
              schema:
                type: array
                items: &id011
                  type: object
                  properties:
                    created:
                      type: string
                      format: date-time
                      description: The date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    last_trade:
                      type: string
                      format: date-time
                      description: The last trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    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.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "created,last_trade,open,high,low,close,volume,count,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\
                \n2024-01-02T17:17:53.606,2024-01-02T17:17:51.877,187.030,188.440,183.885,185.640,80680243,1003582,2,7,18.534,0,2,1,18.536,0\r\
                \n2024-01-03T17:16:29.883,2024-01-03T17:16:28.586,184.200,185.880,183.430,184.250,58308345,654127,5,7,18.405,0,2,1,18.410,0\r\
                \n2024-01-04T17:17:06.02,2024-01-04T17:17:02.445,182.0000,183.0872,180.8800,181.9100,71197269,709246,8,60,1.8176,0,2,7,1.8179,0\r\
                \n2024-01-05T17:16:57.032,2024-01-05T17:16:49.821,181.900,182.760,180.170,181.180,61949135,679405,3,1,18.103,0,3,7,18.105,0\r\
                \n2024-01-08T17:17:01.83,2024-01-08T17:17:01.484,182.000,185.600,181.500,185.560,59029146,665626,4,1,18.528,0,1,65,18.537,0\r\
                \n"
            application/json:
              schema: &id012
                type: array
                items: *id011
              example:
                ask_size:
                - 2
                - 2
                - 2
                - 3
                - 1
                last_trade:
                - '2024-01-02T17:17:51.877'
                - '2024-01-03T17:16:28.586'
                - '2024-01-04T17:17:02.445'
                - '2024-01-05T17:16:49.821'
                - '2024-01-08T17:17:01.484'
                created:
                - '2024-01-02T17:17:53.606'
                - '2024-01-03T17:16:29.883'
                - '2024-01-04T17:17:06.02'
                - '2024-01-05T17:16:57.032'
                - '2024-01-08T17:17:01.83'
                ask_condition:
                - 0
                - 0
                - 0
                - 0
                - 0
                count:
                - 1003582
                - 654127
                - 709246
                - 679405
                - 665626
                volume:
                - 80680243
                - 58308345
                - 71197269
                - 61949135
                - 59029146
                high:
                - 188.44
                - 185.88
                - 183.0872
                - 182.76
                - 185.6
                low:
                - 183.885
                - 183.43
                - 180.88
                - 180.17
                - 181.5
                bid_size:
                - 2
                - 5
                - 8
                - 3
                - 4
                ask_exchange:
                - 1
                - 1
                - 7
                - 7
                - 65
                bid_exchange:
                - 7
                - 7
                - 60
                - 1
                - 1
                ask:
                - 18.536
                - 18.41
                - 1.8179
                - 18.105
                - 18.537
                bid:
                - 18.534
                - 18.405
                - 1.8176
                - 18.103
                - 18.528
                bid_condition:
                - 0
                - 0
                - 0
                - 0
                - 0
                close:
                - 185.64
                - 184.25
                - 181.91
                - 181.18
                - 185.56
                open:
                - 187.03
                - 184.2
                - 182.0
                - 181.9
                - 182.0
            application/x-ndjson:
              schema: *id012
              example: '{"ask_size":2,"last_trade":"2024-01-02T17:17:51.877","created":"2024-01-02T17:17:53.606","ask_condition":0,"count":1003582,"volume":80680243,"high":188.440,"low":183.885,"bid_size":2,"ask_exchange":1,"bid_exchange":7,"ask":18.536,"bid":18.534,"bid_condition":0,"close":185.640,"open":187.030}

                {"ask_size":2,"last_trade":"2024-01-03T17:16:28.586","created":"2024-01-03T17:16:29.883","ask_condition":0,"count":654127,"volume":58308345,"high":185.880,"low":183.430,"bid_size":5,"ask_exchange":1,"bid_exchange":7,"ask":18.410,"bid":18.405,"bid_condition":0,"close":184.250,"open":184.200}

                {"ask_size":2,"last_trade":"2024-01-04T17:17:02.445","created":"2024-01-04T17:17:06.02","ask_condition":0,"count":709246,"volume":71197269,"high":183.0872,"low":180.8800,"bid_size":8,"ask_exchange":7,"bid_exchange":60,"ask":1.8179,"bid":1.8176,"bid_condition":0,"close":181.9100,"open":182.0000}

                {"ask_size":3,"last_trade":"2024-01-05T17:16:49.821","created":"2024-01-05T17:16:57.032","ask_condition":0,"count":679405,"volume":61949135,"high":182.760,"low":180.170,"bid_size":3,"ask_exchange":7,"bid_exchange":1,"ask":18.105,"bid":18.103,"bid_condition":0,"close":181.180,"open":181.900}

                {"ask_size":1,"last_trade":"2024-01-08T17:17:01.484","created":"2024-01-08T17:17:01.83","ask_condition":0,"count":665626,"volume":59029146,"high":185.600,"low":181.500,"bid_size":4,"ask_exchange":65,"bid_exchange":1,"ask":18.537,"bid":18.528,"bid_condition":0,"close":185.560,"open":182.000}'

  /stock/history/ohlc:
    x-min-subscription: value
    get:
      summary: Open High Low Close
      operationId: stock_history_ohlc
      tags:
        - Stock
        - History
      description: |
        Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar:  ``bar time`` <= ``trade time`` < ``bar timestamp + ivl``, where ivl is the specified interval size in milliseconds. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks).
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/history/ohlc?symbol=AAPL&date=20240102&interval=1m
          description: "Returns OHLC for a given symbol between specified dates (inclusive) with a one minute interval"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/venue"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns OHLC for a given symbol between specified dates (inclusive) with a one minute interval
          content:
            text/csv:
              schema:
                type: array
                items: &id013
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    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.
                    vwap:
                      type: number
                      description: The volume weighted average price of the given interval.
              example: "timestamp,open,high,low,close,volume,count,vwap\r\n2024-01-02T09:30:00,187.1500,188.050,186.350,187.830,3256708,37886,187.25\r\
                \n2024-01-02T09:31:00,187.830,188.120,187.630,187.765,809707,7481,187.38\r\n2024-01-02T09:32:00,187.770,188.440,187.730,188.2984,687086,7103,187.48\r\
                \n2024-01-02T09:33:00,188.3050,188.310,187.810,188.160,485275,6245,187.53\r\n2024-01-02T09:34:00,188.150,188.150,187.670,187.730,415948,5942,187.55\r\
                \n"
            application/json:
              schema: &id014
                type: array
                items: *id013
              example:
                volume:
                - 3256708
                - 809707
                - 687086
                - 485275
                - 415948
                high:
                - 188.05
                - 188.12
                - 188.44
                - 188.31
                - 188.15
                low:
                - 186.35
                - 187.63
                - 187.73
                - 187.81
                - 187.67
                vwap:
                - 187.25
                - 187.38
                - 187.48
                - 187.53
                - 187.55
                count:
                - 37886
                - 7481
                - 7103
                - 6245
                - 5942
                close:
                - 187.83
                - 187.765
                - 188.2984
                - 188.16
                - 187.73
                open:
                - 187.15
                - 187.83
                - 187.77
                - 188.305
                - 188.15
                timestamp:
                - '2024-01-02T09:30:00'
                - '2024-01-02T09:31:00'
                - '2024-01-02T09:32:00'
                - '2024-01-02T09:33:00'
                - '2024-01-02T09:34:00'
            application/x-ndjson:
              schema: *id014
              example: '{"volume":3256708,"high":188.050,"low":186.350,"vwap":187.25,"count":37886,"close":187.830,"open":187.1500,"timestamp":"2024-01-02T09:30:00"}

                {"volume":809707,"high":188.120,"low":187.630,"vwap":187.38,"count":7481,"close":187.765,"open":187.830,"timestamp":"2024-01-02T09:31:00"}

                {"volume":687086,"high":188.440,"low":187.730,"vwap":187.48,"count":7103,"close":188.2984,"open":187.770,"timestamp":"2024-01-02T09:32:00"}

                {"volume":485275,"high":188.310,"low":187.810,"vwap":187.53,"count":6245,"close":188.160,"open":188.3050,"timestamp":"2024-01-02T09:33:00"}

                {"volume":415948,"high":188.150,"low":187.670,"vwap":187.55,"count":5942,"close":187.730,"open":188.150,"timestamp":"2024-01-02T09:34:00"}'

  /stock/history/trade:
    x-min-subscription: standard
    get:
      summary: Trade
      operationId: stock_history_trade
      tags:
        - Stock
        - History
      description: |
        Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs). Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks).
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/history/trade?symbol=AAPL&date=20240102
          description: "Returns every trade for a given symbol between specified dates (inclusive) with a one minute interval"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/venue"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns every trade for a given symbol between specified dates (inclusive) with a one minute interval
          content:
            text/csv:
              schema:
                type: array
                items: &id015
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
              example: "timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\
                \n2024-01-02T09:30:00.011,14920,32,95,1,115,1,2,7,187.1800\r\n2024-01-02T09:30:00.014,8931,32,255,1,115,1,1,1,187.1800\r\
                \n2024-01-02T09:30:00.014,8932,32,255,1,115,1,5,1,187.1800\r\n2024-01-02T09:30:00.014,8933,32,255,1,115,1,3,1,187.1900\r\
                \n2024-01-02T09:30:00.014,8934,32,255,1,115,1,91,1,187.1900\r\n"
            application/x-ndjson:
              schema:
                type: array
                items: *id015
              example: '{"sequence":14920,"condition":1,"size":2,"price":187.1800,"ext_condition2":95,"ext_condition1":32,"ext_condition4":115,"exchange":7,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.011"}

                {"sequence":8931,"condition":1,"size":1,"price":187.1800,"ext_condition2":255,"ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.014"}

                {"sequence":8932,"condition":1,"size":5,"price":187.1800,"ext_condition2":255,"ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.014"}

                {"sequence":8933,"condition":1,"size":3,"price":187.1900,"ext_condition2":255,"ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.014"}

                {"sequence":8934,"condition":1,"size":91,"price":187.1900,"ext_condition2":255,"ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.014"}'

  /stock/history/quote:
    x-min-subscription: value
    get:
      summary: Quote
      operationId: stock_history_quote
      tags:
        - Stock
        - History
      description: |
        Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the ``interval`` parameter is specified, the quote for each interval represents the last quote prior to the interval's timestamp. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks).
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/history/quote?symbol=AAPL&date=20240102&interval=1m
          description: "Returns every quote for a given symbol between specified dates (inclusive) with a one minute interval"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/venue"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns every quote for a given symbol between specified dates (inclusive) with a one minute interval
          content:
            text/csv:
              schema:
                type: array
                items: &id016
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "timestamp,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\n2024-01-02T09:30:00,30,7,187.10,0,1,1,187.20,0\r\
                \n2024-01-02T09:31:00,2,1,187.83,0,4,1,187.86,0\r\n2024-01-02T09:32:00,2,60,187.74,0,1,73,187.77,0\r\n2024-01-02T09:33:00,2,60,188.29,0,2,73,188.32,0\r\
                \n2024-01-02T09:34:00,5,1,188.14,0,2,7,188.16,0\r\n"
            application/json:
              schema: &id017
                type: array
                items: *id016
              example:
                ask_size:
                - 1
                - 4
                - 1
                - 2
                - 2
                bid_size:
                - 30
                - 2
                - 2
                - 2
                - 5
                ask_exchange:
                - 1
                - 1
                - 73
                - 73
                - 7
                ask_condition:
                - 0
                - 0
                - 0
                - 0
                - 0
                bid_exchange:
                - 7
                - 1
                - 60
                - 60
                - 1
                ask:
                - 187.2
                - 187.86
                - 187.77
                - 188.32
                - 188.16
                bid:
                - 187.1
                - 187.83
                - 187.74
                - 188.29
                - 188.14
                bid_condition:
                - 0
                - 0
                - 0
                - 0
                - 0
                timestamp:
                - '2024-01-02T09:30:00'
                - '2024-01-02T09:31:00'
                - '2024-01-02T09:32:00'
                - '2024-01-02T09:33:00'
                - '2024-01-02T09:34:00'
            application/x-ndjson:
              schema: *id017
              example: '{"ask_size":1,"bid_size":30,"ask_exchange":1,"ask_condition":0,"bid_exchange":7,"ask":187.20,"bid":187.10,"bid_condition":0,"timestamp":"2024-01-02T09:30:00"}

                {"ask_size":4,"bid_size":2,"ask_exchange":1,"ask_condition":0,"bid_exchange":1,"ask":187.86,"bid":187.83,"bid_condition":0,"timestamp":"2024-01-02T09:31:00"}

                {"ask_size":1,"bid_size":2,"ask_exchange":73,"ask_condition":0,"bid_exchange":60,"ask":187.77,"bid":187.74,"bid_condition":0,"timestamp":"2024-01-02T09:32:00"}

                {"ask_size":2,"bid_size":2,"ask_exchange":73,"ask_condition":0,"bid_exchange":60,"ask":188.32,"bid":188.29,"bid_condition":0,"timestamp":"2024-01-02T09:33:00"}

                {"ask_size":2,"bid_size":5,"ask_exchange":7,"ask_condition":0,"bid_exchange":1,"ask":188.16,"bid":188.14,"bid_condition":0,"timestamp":"2024-01-02T09:34:00"}'

  /stock/history/trade_quote:
    x-min-subscription: standard
    get:
      summary: Trade Quote
      operationId: stock_history_trade_quote
      tags:
        - Stock
        - History
      description: |
        Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs) paired with the last BBO quote reported by [UTP or CTA](/Articles/Data-And-Requests/The-SIPs) at the time of trade. A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. If you prefer to match quotes with timestamps that are ``<`` the trade timestamp, specify the ``exclusive`` parameter to ``true``. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks).
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/history/trade_quote?symbol=AAPL&date=20240102
          description: "Returns every trade quote for a given symbol between specified dates (inclusive)"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/exclusive"
        - $ref: "#/components/parameters/venue"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns every trade quote for a given symbol between specified dates (inclusive)
          content:
            text/csv:
              schema:
                type: array
                items: &id018
                  type: object
                  properties:
                    trade_timestamp:
                      type: string
                      format: date-time
                      description: The trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    quote_timestamp:
                      type: string
                      format: date-time
                      description: The quote date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "trade_timestamp,quote_timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\
                \n2023-01-03T09:30:00.002,2023-01-03T09:30:00.001,562,32,255,255,115,115,1,60,130.3300,4,7,130.2600,0,1,7,130.4000,0\r\
                \n2023-01-03T09:30:00.003,2023-01-03T09:30:00.002,563,32,255,255,115,115,24,60,130.3300,4,7,130.2600,0,1,7,130.4000,0\r\
                \n2023-01-03T09:30:00.003,2023-01-03T09:30:00.002,564,32,255,255,115,115,40,60,130.3300,4,7,130.2600,0,1,7,130.4000,0\r\
                \n2023-01-03T09:30:00.036,2023-01-03T09:30:00.017,6081,32,95,1,115,1,19,1,130.2500,4,7,130.2600,0,1,1,130.3900,0\r\
                \n2023-01-03T09:30:00.057,2023-01-03T09:30:00.017,6082,32,255,1,115,1,30,1,130.2500,4,7,130.2600,0,1,1,130.3900,0\r\
                \n"
            application/x-ndjson:
              schema:
                type: array
                items: *id018
              example: '{"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.002","ask_condition":0,"sequence":562,"condition":115,"size":1,"bid_size":4,"ask_exchange":7,"price":130.3300,"ext_condition2":255,"bid_exchange":7,"ask":130.4000,"quote_timestamp":"2023-01-03T09:30:00.001","ext_condition1":32,"ext_condition4":115,"exchange":60,"ext_condition3":255,"bid":130.2600,"bid_condition":0}

                {"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.003","ask_condition":0,"sequence":563,"condition":115,"size":24,"bid_size":4,"ask_exchange":7,"price":130.3300,"ext_condition2":255,"bid_exchange":7,"ask":130.4000,"quote_timestamp":"2023-01-03T09:30:00.002","ext_condition1":32,"ext_condition4":115,"exchange":60,"ext_condition3":255,"bid":130.2600,"bid_condition":0}

                {"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.003","ask_condition":0,"sequence":564,"condition":115,"size":40,"bid_size":4,"ask_exchange":7,"price":130.3300,"ext_condition2":255,"bid_exchange":7,"ask":130.4000,"quote_timestamp":"2023-01-03T09:30:00.002","ext_condition1":32,"ext_condition4":115,"exchange":60,"ext_condition3":255,"bid":130.2600,"bid_condition":0}

                {"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.036","ask_condition":0,"sequence":6081,"condition":1,"size":19,"bid_size":4,"ask_exchange":1,"price":130.2500,"ext_condition2":95,"bid_exchange":7,"ask":130.3900,"quote_timestamp":"2023-01-03T09:30:00.017","ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"bid":130.2600,"bid_condition":0}

                {"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.057","ask_condition":0,"sequence":6082,"condition":1,"size":30,"bid_size":4,"ask_exchange":1,"price":130.2500,"ext_condition2":255,"bid_exchange":7,"ask":130.3900,"quote_timestamp":"2023-01-03T09:30:00.017","ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"bid":130.2600,"bid_condition":0}'

  /stock/at_time/trade:
    x-min-subscription: standard
    get:
      summary: Trade
      operationId: stock_at_time_trade
      tags:
        - Stock
        - At-Time
      description: |
        #### Real-time request:
        - Returns a real-time session from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks).
        - Returns a 15-minute delayed session from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) subscription.

        #### Historical request:
        Returns the last trade reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) at a specified millisecond of the day.
        Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
      x-sample-urls:
      - url: http://localhost:25503/v3/stock/at_time/trade?symbol=SPY&start_date=20240116&end_date=20240116&time_of_day=09:30:00.100
        description: "Returns the last trade for a given symbol and specified time of day"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/time_of_day"
        - $ref: "#/components/parameters/venue"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns the last trade for a given symbol and specified time of day
          content:
            text/csv:
              schema:
                type: array
                items: &id019
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
              example: "timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\
                \n2024-01-16T09:30:00.088,405549,255,255,255,115,115,1,57,475.280\r\n"
            application/json:
              schema: &id020
                type: array
                items: *id019
              example:
                sequence:
                - 405549
                condition:
                - 115
                size:
                - 1
                price:
                - 475.28
                ext_condition2:
                - 255
                ext_condition1:
                - 255
                ext_condition4:
                - 115
                exchange:
                - 57
                ext_condition3:
                - 255
                timestamp:
                - '2024-01-16T09:30:00.088'
            application/x-ndjson:
              schema: *id020
              example: '{"sequence":405549,"condition":115,"size":1,"price":475.280,"ext_condition2":255,"ext_condition1":255,"ext_condition4":115,"exchange":57,"ext_condition3":255,"timestamp":"2024-01-16T09:30:00.088"}'

  /stock/at_time/quote:
    x-min-subscription: value
    get:
      summary: Quote
      operationId: stock_at_time_quote
      tags:
        - Stock
        - At-Time
      description: |
        #### Real-time request:
          - Subscription tier standard or higher will default to NQB.
          - Real-time last BBO quote at-time_of_day-time from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks).
          - 15-minute delayed NBBO quote at-time_of_day-time from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) subscription.
        
        #### Historical request:
          Returns the last NBBO quote reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) at a specified millisecond of the day.
      x-sample-urls:
        - url: http://localhost:25503/v3/stock/at_time/quote?symbol=SPY&start_date=20240116&end_date=20240116&time_of_day=09:30:00.100
          description: "Returns the last quote for a given symbol between specified dates (inclusive) with a one minute interval"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/time_of_day"
        - $ref: "#/components/parameters/venue"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns the last quote for a given symbol between specified dates (inclusive) with a one minute interval
          content:
            text/csv:
              schema:
                type: array
                items: &id021
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "timestamp,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\n2024-01-16T09:30:00.1,15,1,475.28,0,8,7,475.28,0\r\
                \n"
            application/json:
              schema: &id022
                type: array
                items: *id021
              example:
                ask_size:
                - 8
                bid_size:
                - 15
                ask_exchange:
                - 7
                ask_condition:
                - 0
                bid_exchange:
                - 1
                ask:
                - 475.28
                bid:
                - 475.28
                bid_condition:
                - 0
                timestamp:
                - '2024-01-16T09:30:00.1'
            application/x-ndjson:
              schema: *id022
              example: '{"ask_size":8,"bid_size":15,"ask_exchange":7,"ask_condition":0,"bid_exchange":1,"ask":475.28,"bid":475.28,"bid_condition":0,"timestamp":"2024-01-16T09:30:00.1"}'

#
# OPTIONS ENDPOINTS
#

  /option/list/symbols:
    x-min-subscription: free
    get:
      summary: Symbols
      operationId: option_list_symbols
      tags:
        - Option
        - List
      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://localhost:25503/v3/option/list/symbols
          description: "List all symbols for options"
      parameters:
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: List all symbols for options
          content:
            text/csv:
              schema:
                type: array
                items: &id023
                  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: &id024
                type: array
                items: *id023
              example:
                symbol:
                - A
                - AA
                - AAAP
                - AAAU
                - AABA
            application/x-ndjson:
              schema: *id024
              example: '{"symbol":"A"}

                {"symbol":"AA"}

                {"symbol":"AAAP"}

                {"symbol":"AAAU"}

                {"symbol":"AABA"}'

  /option/list/dates/{request_type}:
    x-min-subscription: free
    get:
      summary: Dates
      operationId: option_list_dates
      tags:
        - Option
        - List
      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://localhost: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://localhost: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"
      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: &id025
                  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.
                    date:
                      type: string
                      format: date
                      description: The date formated as YYYY-MM-DD.
              example: "symbol,expiration,strike,right,date\r\nAAPL,2022-09-30,80.000,CALL,2022-09-16\r\nAAPL,2022-09-30,80.000,CALL,2022-09-19\r\
                \nAAPL,2022-09-30,80.000,CALL,2022-09-12\r\nAAPL,2022-09-30,80.000,CALL,2022-09-13\r\nAAPL,2022-09-30,80.000,CALL,2022-09-14\r\
                \n"
            application/json:
              schema: &id026
                type: array
                items: *id025
              example:
                date:
                - '2022-09-16'
                - '2022-09-19'
                - '2022-09-12'
                - '2022-09-13'
                - '2022-09-14'
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                strike:
                - 80.0
                - 80.0
                - 80.0
                - 80.0
                - 80.0
                expiration:
                - '2022-09-30'
                - '2022-09-30'
                - '2022-09-30'
                - '2022-09-30'
                - '2022-09-30'
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
            application/x-ndjson:
              schema: *id026
              example: '{"date":"2022-09-16","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"}

                {"date":"2022-09-19","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"}

                {"date":"2022-09-12","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"}

                {"date":"2022-09-13","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"}

                {"date":"2022-09-14","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"}'

  /option/list/expirations:
    x-min-subscription: free
    get:
      summary: Expirations
      operationId: option_list_expirations
      tags:
        - Option
        - List
      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://localhost:25503/v3/option/list/expirations?symbol=AAPL
          description: "List all expirations for an option with a given symbol"
      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: &id027
                  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\n\
                AAPL,2012-06-29\r\n"
            application/json:
              schema: &id028
                type: array
                items: *id027
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                expiration:
                - '2012-06-01'
                - '2012-06-08'
                - '2012-06-16'
                - '2012-06-22'
                - '2012-06-29'
            application/x-ndjson:
              schema: *id028
              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"}'

  /option/list/strikes:
    x-min-subscription: free
    get:
      summary: Strikes
      operationId: option_list_strikes
      tags:
        - Option
        - List
      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://localhost:25503/v3/option/list/strikes?symbol=AAPL&expiration=20220930
          description: "List all strikes for an option with a given symbol and expiration date"
      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: &id029
                  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: &id030
                type: array
                items: *id029
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                strike:
                - 80.0
                - 128.0
                - 160.0
                - 144.0
                - 240.0
            application/x-ndjson:
              schema: *id030
              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}'

  /option/list/contracts/{request_type}:
    x-min-subscription: value
    get:
      summary: Contracts
      operationId: option_list_contracts
      tags:
        - Option
        - List
      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://localhost:25503/v3/option/list/contracts/trade?date=20220930
          description: "List all contracts for an option trade with a given date"
        - url: http://localhost:25503/v3/option/list/contracts/quote?symbol=AAPL&date=20220930
          description: "List all contracts for an option quote with a given symbol and date"
      parameters:
        - $ref: "#/components/parameters/request_type"
        - $ref: "#/components/parameters/opt_multi_symbol"
        - $ref: "#/components/parameters/date"
        - $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: &id031
                  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\n\
                AAL,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: &id032
                type: array
                items: *id031
              example:
                symbol:
                - ABNB
                - AAPL
                - AAL
                - ABNB
                - AAPL
                strike:
                - 260.0
                - 260.0
                - 14.5
                - 80.0
                - 80.0
                expiration:
                - '2023-06-16'
                - '2023-06-16'
                - '2022-09-30'
                - '2022-11-04'
                - '2022-11-04'
                right:
                - CALL
                - CALL
                - CALL
                - PUT
                - PUT
            application/x-ndjson:
              schema: *id032
              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"}'

  /option/snapshot/ohlc:
    x-min-subscription: value
    get:
      summary: Open High Low Close
      operationId: option_snapshot_ohlc
      tags:
        - Option
        - Snapshot
      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://localhost:25503/v3/option/snapshot/ohlc?symbol=AAPL&expiration=20260116&right=call&strike=275.000
          description: "Returns OHLC for a given option contract"
        - url: http://localhost:25503/v3/option/snapshot/ohlc?symbol=AAPL&expiration=*
          description: "Returns OHLC for all option contracts"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns OHLC for a given option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id033
                  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: &id034
                type: array
                items: *id033
              example:
                volume:
                - 202
                symbol:
                - AAPL
                high:
                - 1.78
                low:
                - 1.51
                strike:
                - 275.0
                count:
                - 29
                expiration:
                - '2026-01-16'
                right:
                - CALL
                close:
                - 1.51
                open:
                - 1.78
                timestamp:
                - '2025-08-20T15:25:31.03'
            application/x-ndjson:
              schema: *id034
              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"}'

  /option/snapshot/trade:
    x-min-subscription: standard
    get:
      summary: Trade
      operationId: option_snapshot_trade
      tags:
        - Option
        - Snapshot
      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://localhost:25503/v3/option/snapshot/trade?symbol=AAPL&expiration=2026-01-16&right=call&strike=275.000
          description: "Returns last trade for an option contract"
        - url: http://localhost:25503/v3/option/snapshot/trade?symbol=AAPL&expiration=2026-01-16
          description: "Returns last trade for all option contracts with an expiration of 2026-01-16"
      parameters:
        - $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: Returns last NBBO quote for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id035
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
              example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,18902138,255,255,255,255,130,2,22,3.90\r\n"
            application/json:
              schema: &id036
                type: array
                items: *id035
              example:
                symbol:
                - AAPL
                strike:
                - 220.0
                right:
                - CALL
                sequence:
                - 18902138
                condition:
                - 130
                size:
                - 2
                price:
                - 3.9
                ext_condition2:
                - 255
                ext_condition1:
                - 255
                expiration:
                - '2024-11-08'
                ext_condition4:
                - 255
                exchange:
                - 22
                ext_condition3:
                - 255
                timestamp:
                - '2024-11-04T09:30:00.471'
            application/x-ndjson:
              schema: *id036
              example: '{"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":18902138,"condition":130,"size":2,"price":3.90,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"timestamp":"2024-11-04T09:30:00.471"}'

  /option/snapshot/quote:
    x-min-subscription: value
    get:
      summary: Quote
      operationId: option_snapshot_quote
      tags:
        - Option
        - Snapshot
      description: |
        
        - Retrieve a real-time last NBBO quote 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://localhost:25503/v3/option/snapshot/quote?symbol=AAPL&expiration=20260116&right=call&strike=275.000
          description: "Returns last NBBO quote for an option contract"
        - url: http://localhost:25503/v3/option/snapshot/quote?symbol=AAPL&expiration=*
          description: "Returns last NBBO quote for all option contracts"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns last NBBO quote for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id104
                  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.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "timestamp,symbol,expiration,strike,right,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\
                \n2025-08-20T15:59:59.805,AAPL,2026-01-16,275.000,CALL,5,6,1.47,50,25,6,1.50,50\r\n"
            application/json:
              schema: &id105
                type: array
                items: *id104
              example:
                symbol:
                - AAPL
                ask_size:
                - 25
                ask_condition:
                - 50
                strike:
                - 275.0
                right:
                - CALL
                bid_size:
                - 5
                ask_exchange:
                - 6
                bid_exchange:
                - 6
                ask:
                - 1.5
                expiration:
                - '2026-01-16'
                bid:
                - 1.47
                bid_condition:
                - 50
                timestamp:
                - '2025-08-20T15:59:59.805'
            application/x-ndjson:
              schema: *id105
              example: '{"symbol":"AAPL","ask_size":25,"ask_condition":50,"strike":275.000,"right":"CALL","bid_size":5,"ask_exchange":6,"bid_exchange":6,"ask":1.50,"expiration":"2026-01-16","bid":1.47,"bid_condition":50,"timestamp":"2025-08-20T15:59:59.805"}'

  /option/snapshot/open_interest:
    x-min-subscription: value
    get:
      summary: Open Interest
      operationId: option_snapshot_open_interest
      tags:
        - Option
        - Snapshot
      description: |
        - Retrieve the last open interest message of an option contract.
        - Open interest is reported around 06:30 ET every morning by OPRA and reflects the open interest at the of the previous trading day. 
        - 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://localhost:25503/v3/option/snapshot/open_interest?symbol=AAPL&expiration=20260116&right=call&strike=275.00
          description: "Returns open interest for an option contract"
        - url: http://localhost:25503/v3/option/snapshot/open_interest?symbol=AAPL&expiration=*
          description: "Returns open interest for all option contracts"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns open interest for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id037
                  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_interest:
                      type: integer
                      description: The total amount of outstanding contracts.
              example: "timestamp,symbol,expiration,strike,right,open_interest\r\n2025-08-20T06:30:13,AAPL,2026-01-16,275.000,CALL,8066\r\
                \n"
            application/json:
              schema: &id038
                type: array
                items: *id037
              example:
                symbol:
                - AAPL
                strike:
                - 275.0
                open_interest:
                - 8066
                expiration:
                - '2026-01-16'
                right:
                - CALL
                timestamp:
                - '2025-08-20T06:30:13'
            application/x-ndjson:
              schema: *id038
              example: '{"symbol":"AAPL","strike":275.000,"open_interest":8066,"expiration":"2026-01-16","right":"CALL","timestamp":"2025-08-20T06:30:13"}'

  /option/snapshot/greeks/implied_volatility:
    x-min-subscription: standard
    get:
      summary: Implied Volatility
      operationId: option_snapshot_greeks_implied_volatility
      tags:
        - Option
        - Snapshot
      description: |
        Returns implied volatilies calculated using the national best bid, mid, and ask price
        of the option respectively. The underlying price represents whatever the last underlying price was at the
        ``underlying_timestamp`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/snapshot/greeks/implied_volatility?symbol=AAPL&expiration=20260116&strike=275.000&right=call
          description: "Returns implied volatility for an option contract"
        - url: http://localhost:25503/v3/option/snapshot/greeks/implied_volatility?symbol=AAPL&expiration=*
          description: "Returns implied volatility for all option contracts"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/stock_price"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns implied volatility for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id039
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: string
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,ask,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2026-01-16,275.000,CALL,2025-08-20T15:59:59.805,1.47,1.50,0.2142,-0.0003,2025-08-20T16:36:52.257,225.74\r\
                \n"
            application/json:
              schema: &id040
                type: array
                items: *id039
              example:
                symbol:
                - AAPL
                underlying_price:
                - 225.74
                strike:
                - 275.0
                ask:
                - 1.5
                expiration:
                - '2026-01-16'
                right:
                - CALL
                implied_vol:
                - 0.2142
                bid:
                - 1.47
                underlying_timestamp:
                - '2025-08-20T16:36:52.257'
                iv_error:
                - -0.0003
                timestamp:
                - '2025-08-20T15:59:59.805'
            application/x-ndjson:
              schema: *id040
              example: '{"symbol":"AAPL","underlying_price":225.74,"strike":275.000,"ask":1.50,"expiration":"2026-01-16","right":"CALL","implied_vol":0.2142,"bid":1.47,"underlying_timestamp":"2025-08-20T16:36:52.257","iv_error":-0.0003,"timestamp":"2025-08-20T15:59:59.805"}'

  # /option/snapshot/trade_greeks/implied_volatility:
  #   x-min-subscription: professional
  #   get:
  #     operationId: option_snapshot_trade_greeks_implied_volatility
  #     tags:
  #       - Option
  #       - Snapshot
  #     description: ""
  #     parameters:
  #       - $ref: "#/components/parameters/single_symbol"
  #       - $ref: "#/components/parameters/expiration"
  #       - $ref: "#/components/parameters/strike"
  #       - $ref: "#/components/parameters/right"
  #       - $ref: "#/components/parameters/annual_dividend"
  #       - $ref: "#/components/parameters/rate_type"
  #       - $ref: "#/components/parameters/rate_value"
  #       - $ref: "#/components/parameters/stock_price"
  #       - $ref: "#/components/parameters/format"
  #     responses:
  #       "200":
  #         $ref: "#/components/responses/200_OK"

  /option/snapshot/greeks/all:
    x-min-subscription: professional
    get:
      summary: All Greeks
      operationId: option_snapshot_greeks_all
      tags:
        - Option
        - Snapshot
      description: |
        - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided expiration.
        - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output.
        - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying.
        > 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://localhost:25503/v3/option/snapshot/greeks/all?symbol=AAPL&expiration=2026-05-15&strike=170.00&right=call
          description: "Returns all greeks for an option contract"
        - url: http://localhost:25503/v3/option/snapshot/greeks/all?symbol=AAPL&expiration=*
          description: "Returns all greeks for all option contracts"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/stock_price"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns all greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id041
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    delta:
                      type: number
                      description: The delta.
                    theta:
                      type: string
                      description: The Theta.
                    vega:
                      type: number
                      description: The vega.
                    rho:
                      type: number
                      description: The rho.
                    epsilon:
                      type: string
                      description: The epsilon.
                    lambda:
                      type: number
                      description: The lambda.
                    gamma:
                      type: number
                      description: The gamma.
                    vanna:
                      type: string
                      description: The vanna.
                    charm:
                      type: number
                      description: The charm.
                    vomma:
                      type: number
                      description: The vomma.
                    veta:
                      type: number
                      description: The veta.
                    vera:
                      type: number
                      description: The vera.
                    speed:
                      type: number
                      description: The speed.
                    zomma:
                      type: number
                      description: The zomma.
                    color:
                      type: string
                      description: The color.
                    ultima:
                      type: string
                      description: The ultima.
                    d1:
                      type: number
                      description: The d1.
                    d2:
                      type: number
                      description: The d2.
                    dual_delta:
                      type: string
                      description: The dual delta.
                    dual_gamma:
                      type: number
                      description: The dual gamma.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,ask,delta,theta,vega,rho,epsilon,lambda,gamma,vanna,charm,vomma,veta,vera,speed,zomma,color,ultima,d1,d2,dual_delta,dual_gamma,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2026-05-15,170.000,CALL,2025-08-20T15:59:59.677,63.65,64.25,0.9085,-0.0352,31.7235,103.2513,-150.0314,3.2071,0.0027,-0.5710,0.0925,146.8562,22.9525,0.0000,0.0000,0.0000,-0.0816,-100.0000,1.3319,1.0689,-0.8302,0.0003,0.3075,0.0000,2025-08-20T16:36:52.257,225.74\r\
                \n"
            application/json:
              schema: &id042
                type: array
                items: *id041
              example:
                symbol:
                - AAPL
                dual_delta:
                - -0.8302
                color:
                - -0.0816
                zomma:
                - 0.0
                delta:
                - 0.9085
                implied_vol:
                - 0.3075
                theta:
                - -0.0352
                d1:
                - 1.3319
                speed:
                - 0.0
                d2:
                - 1.0689
                epsilon:
                - -150.0314
                lambda:
                - 3.2071
                vomma:
                - 146.8562
                underlying_timestamp:
                - '2025-08-20T16:36:52.257'
                timestamp:
                - '2025-08-20T15:59:59.677'
                underlying_price:
                - 225.74
                strike:
                - 170.0
                vera:
                - 0.0
                right:
                - CALL
                veta:
                - 22.9525
                iv_error:
                - 0.0
                ultima:
                - -100.0
                charm:
                - 0.0925
                ask:
                - 64.25
                rho:
                - 103.2513
                expiration:
                - '2026-05-15'
                vanna:
                - -0.571
                dual_gamma:
                - 0.0003
                bid:
                - 63.65
                vega:
                - 31.7235
                gamma:
                - 0.0027
            application/x-ndjson:
              schema: *id042
              example: '{"symbol":"AAPL","dual_delta":-0.8302,"color":-0.0816,"zomma":0.0000,"delta":0.9085,"implied_vol":0.3075,"theta":-0.0352,"d1":1.3319,"speed":0.0000,"d2":1.0689,"epsilon":-150.0314,"lambda":3.2071,"vomma":146.8562,"underlying_timestamp":"2025-08-20T16:36:52.257","timestamp":"2025-08-20T15:59:59.677","underlying_price":225.74,"strike":170.000,"vera":0.0000,"right":"CALL","veta":22.9525,"iv_error":0.0000,"ultima":-100.0000,"charm":0.0925,"ask":64.25,"rho":103.2513,"expiration":"2026-05-15","vanna":-0.5710,"dual_gamma":0.0003,"bid":63.65,"vega":31.7235,"gamma":0.0027}'

  # /option/snapshot/trade_greeks/all:
  #   x-min-subscription: professional
  #   get:
  #     operationId: option_snapshot_trade_greeks_all
  #     tags:
  #       - Option
  #       - Snapshot
  #     description: ""
  #     parameters:
  #       - $ref: "#/components/parameters/single_symbol"
  #       - $ref: "#/components/parameters/expiration"
  #       - $ref: "#/components/parameters/strike"
  #       - $ref: "#/components/parameters/right"
  #       - $ref: "#/components/parameters/annual_dividend"
  #       - $ref: "#/components/parameters/rate_type"
  #       - $ref: "#/components/parameters/rate_value"
  #       - $ref: "#/components/parameters/stock_price"
  #       - $ref: "#/components/parameters/format"
  #     responses:
  #       "200":
  #         $ref: "#/components/responses/200_OK"

  /option/snapshot/greeks/first_order:
    x-min-subscription: standard
    get:
      summary: First Order Greeks
      operationId: option_snapshot_greeks_first_order
      tags:
        - Option
        - Snapshot
      description: |
        - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided expiration.
        - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output.
        - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying.
        > 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://localhost:25503/v3/option/snapshot/greeks/first_order?symbol=AAPL&expiration=20260116&strike=275.000&right=call
          description: "Returns first order greeks for an option contract"
        - url: http://localhost:25503/v3/option/snapshot/greeks/first_order?symbol=AAPL&expiration=*
          description: "Returns first order greeks for all option contracts"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/stock_price"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns first order greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id043
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    delta:
                      type: number
                      description: The delta.
                    theta:
                      type: string
                      description: The Theta.
                    vega:
                      type: number
                      description: The vega.
                    rho:
                      type: number
                      description: The rho.
                    epsilon:
                      type: string
                      description: The epsilon.
                    lambda:
                      type: number
                      description: The lambda.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: string
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,ask,delta,theta,vega,rho,epsilon,lambda,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2026-01-16,275.000,CALL,2025-08-20T15:59:59.805,1.47,1.50,0.1060,-0.0217,26.3226,9.1050,-9.7049,16.1782,0.2142,-0.0003,2025-08-20T16:37:06.988,225.74\r\
                \n"
            application/json:
              schema: &id044
                type: array
                items: *id043
              example:
                symbol:
                - AAPL
                underlying_price:
                - 225.74
                strike:
                - 275.0
                delta:
                - 0.106
                right:
                - CALL
                implied_vol:
                - 0.2142
                theta:
                - -0.0217
                iv_error:
                - -0.0003
                epsilon:
                - -9.7049
                lambda:
                - 16.1782
                ask:
                - 1.5
                rho:
                - 9.105
                expiration:
                - '2026-01-16'
                bid:
                - 1.47
                underlying_timestamp:
                - '2025-08-20T16:37:06.988'
                vega:
                - 26.3226
                timestamp:
                - '2025-08-20T15:59:59.805'
            application/x-ndjson:
              schema: *id044
              example: '{"symbol":"AAPL","underlying_price":225.74,"strike":275.000,"delta":0.1060,"right":"CALL","implied_vol":0.2142,"theta":-0.0217,"iv_error":-0.0003,"epsilon":-9.7049,"lambda":16.1782,"ask":1.50,"rho":9.1050,"expiration":"2026-01-16","bid":1.47,"underlying_timestamp":"2025-08-20T16:37:06.988","vega":26.3226,"timestamp":"2025-08-20T15:59:59.805"}'

  # /option/snapshot/trade_greeks/first_order:
  #   x-min-subscription: professional
  #   get:
  #     operationId: option_snapshot_trade_greeks_first_order
  #     tags:
  #       - Option
  #       - Snapshot
  #     description: ""
  #     parameters:
  #       - $ref: "#/components/parameters/single_symbol"
  #       - $ref: "#/components/parameters/expiration"
  #       - $ref: "#/components/parameters/strike"
  #       - $ref: "#/components/parameters/right"
  #       - $ref: "#/components/parameters/annual_dividend"
  #       - $ref: "#/components/parameters/rate_type"
  #       - $ref: "#/components/parameters/rate_value"
  #       - $ref: "#/components/parameters/stock_price"
  #       - $ref: "#/components/parameters/format"
  #     responses:
  #       "200":
  #         $ref: "#/components/responses/200_OK"

  /option/snapshot/greeks/second_order:
    x-min-subscription: professional
    get:
      summary: Second Order Greeks
      operationId: option_snapshot_greeks_second_order
      tags:
        - Option
        - Snapshot
      description: |
        - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a provided expiration.
        - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output.
        - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying.
        > 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://localhost:25503/v3/option/snapshot/greeks/second_order?symbol=AAPL&expiration=20260116&strike=275.00
          description: "Returns second order greeks for an option contract"
        - url: http://localhost:25503/v3/option/snapshot/greeks/second_order?symbol=AAPL&expiration=*
          description: "Returns second order greeks for all option contracts"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/stock_price"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns second order greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id045
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    gamma:
                      type: number
                      description: The gamma.
                    vanna:
                      type: number
                      description: The vanna.
                    charm:
                      type: string
                      description: The charm.
                    vomma:
                      type: number
                      description: The vomma.
                    veta:
                      type: number
                      description: The veta.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: string
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,ask,gamma,vanna,charm,vomma,veta,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2026-01-16,275.000,CALL,2025-08-20T15:59:59.805,1.47,1.50,0.0059,1.1833,-0.3716,212.2670,18.8522,0.2142,-0.0003,2025-08-20T16:37:06.988,225.74\r\
                \nAAPL,2026-01-16,275.000,PUT,2025-08-20T15:59:59.839,48.75,49.70,0.0064,0.9320,-0.4210,108.3415,18.2234,0.3106,0.0000,2025-08-20T16:37:06.988,225.74\r\
                \n"
            application/json:
              schema: &id046
                type: array
                items: *id045
              example:
                symbol:
                - AAPL
                - AAPL
                underlying_price:
                - 225.74
                - 225.74
                strike:
                - 275.0
                - 275.0
                right:
                - CALL
                - PUT
                veta:
                - 18.8522
                - 18.2234
                implied_vol:
                - 0.2142
                - 0.3106
                iv_error:
                - -0.0003
                - 0.0
                charm:
                - -0.3716
                - -0.421
                ask:
                - 1.5
                - 49.7
                expiration:
                - '2026-01-16'
                - '2026-01-16'
                vanna:
                - 1.1833
                - 0.932
                vomma:
                - 212.267
                - 108.3415
                bid:
                - 1.47
                - 48.75
                underlying_timestamp:
                - '2025-08-20T16:37:06.988'
                - '2025-08-20T16:37:06.988'
                gamma:
                - 0.0059
                - 0.0064
                timestamp:
                - '2025-08-20T15:59:59.805'
                - '2025-08-20T15:59:59.839'
            application/x-ndjson:
              schema: *id046
              example: '{"symbol":"AAPL","underlying_price":225.74,"strike":275.000,"right":"CALL","veta":18.8522,"implied_vol":0.2142,"iv_error":-0.0003,"charm":-0.3716,"ask":1.50,"expiration":"2026-01-16","vanna":1.1833,"vomma":212.2670,"bid":1.47,"underlying_timestamp":"2025-08-20T16:37:06.988","gamma":0.0059,"timestamp":"2025-08-20T15:59:59.805"}

                {"symbol":"AAPL","underlying_price":225.74,"strike":275.000,"right":"PUT","veta":18.2234,"implied_vol":0.3106,"iv_error":0.0000,"charm":-0.4210,"ask":49.70,"expiration":"2026-01-16","vanna":0.9320,"vomma":108.3415,"bid":48.75,"underlying_timestamp":"2025-08-20T16:37:06.988","gamma":0.0064,"timestamp":"2025-08-20T15:59:59.839"}'

  # /option/snapshot/trade_greeks/second_order:
  #   x-min-subscription: professional
  #   get:
  #     operationId: option_snapshot_trade_greeks_second_order
  #     tags:
  #       - Option
  #       - Snapshot
  #     description: ""
  #     parameters:
  #       - $ref: "#/components/parameters/single_symbol"
  #       - $ref: "#/components/parameters/expiration"
  #       - $ref: "#/components/parameters/strike"
  #       - $ref: "#/components/parameters/right"
  #       - $ref: "#/components/parameters/annual_dividend"
  #       - $ref: "#/components/parameters/rate_type"
  #       - $ref: "#/components/parameters/rate_value"
  #       - $ref: "#/components/parameters/stock_price"
  #       - $ref: "#/components/parameters/format"
  #     responses:
  #       "200":
  #         $ref: "#/components/responses/200_OK"

  /option/snapshot/greeks/third_order:
    x-min-subscription: professional
    get:
      summary: Third Order Greeks
      operationId: option_snapshot_greeks_third_order
      tags:
        - Option
        - Snapshot
      description: |
        - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a provided expiration.
        - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output.
        - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying.
        > 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://localhost:25503/v3/option/snapshot/greeks/third_order?symbol=AAPL&expiration=20260116&strike=275.00
          description: "Returns third order greeks for an option contract"
        - url: http://localhost:25503/v3/option/snapshot/greeks/third_order?symbol=AAPL&expiration=*
          description: "Returns third order greeks for all option contracts"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/stock_price"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns third order greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id047
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    speed:
                      type: number
                      description: The speed.
                    zomma:
                      type: number
                      description: The zomma.
                    color:
                      type: string
                      description: The color.
                    ultima:
                      type: string
                      description: The ultima.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: string
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,ask,speed,zomma,color,ultima,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2026-01-16,275.000,CALL,2025-08-20T15:59:59.805,1.47,1.50,0.0000,0.0000,-0.3832,-100.0000,0.2142,-0.0003,2025-08-20T16:37:06.988,225.74\r\
                \nAAPL,2026-01-16,275.000,PUT,2025-08-20T15:59:59.839,48.75,49.70,0.0000,0.0000,-1.8378,-100.0000,0.3106,0.0000,2025-08-20T16:37:06.988,225.74\r\
                \n"
            application/json:
              schema: &id048
                type: array
                items: *id047
              example:
                symbol:
                - AAPL
                - AAPL
                underlying_price:
                - 225.74
                - 225.74
                color:
                - -0.3832
                - -1.8378
                strike:
                - 275.0
                - 275.0
                zomma:
                - 0.0
                - 0.0
                right:
                - CALL
                - PUT
                implied_vol:
                - 0.2142
                - 0.3106
                iv_error:
                - -0.0003
                - 0.0
                speed:
                - 0.0
                - 0.0
                ultima:
                - -100.0
                - -100.0
                ask:
                - 1.5
                - 49.7
                expiration:
                - '2026-01-16'
                - '2026-01-16'
                bid:
                - 1.47
                - 48.75
                underlying_timestamp:
                - '2025-08-20T16:37:06.988'
                - '2025-08-20T16:37:06.988'
                timestamp:
                - '2025-08-20T15:59:59.805'
                - '2025-08-20T15:59:59.839'
            application/x-ndjson:
              schema: *id048
              example: '{"symbol":"AAPL","underlying_price":225.74,"color":-0.3832,"strike":275.000,"zomma":0.0000,"right":"CALL","implied_vol":0.2142,"iv_error":-0.0003,"speed":0.0000,"ultima":-100.0000,"ask":1.50,"expiration":"2026-01-16","bid":1.47,"underlying_timestamp":"2025-08-20T16:37:06.988","timestamp":"2025-08-20T15:59:59.805"}

                {"symbol":"AAPL","underlying_price":225.74,"color":-1.8378,"strike":275.000,"zomma":0.0000,"right":"PUT","implied_vol":0.3106,"iv_error":0.0000,"speed":0.0000,"ultima":-100.0000,"ask":49.70,"expiration":"2026-01-16","bid":48.75,"underlying_timestamp":"2025-08-20T16:37:06.988","timestamp":"2025-08-20T15:59:59.839"}'

  # /option/snapshot/trade_greeks/third_order:
  #   x-min-subscription: professional
  #   get:
  #     operationId: option_snapshot_trade_greeks_third_order
  #     tags:
  #       - Option
  #       - Snapshot
  #     description: ""
  #     parameters:
  #       - $ref: "#/components/parameters/single_symbol"
  #       - $ref: "#/components/parameters/expiration"
  #       - $ref: "#/components/parameters/strike"
  #       - $ref: "#/components/parameters/right"
  #       - $ref: "#/components/parameters/annual_dividend"
  #       - $ref: "#/components/parameters/rate_type"
  #       - $ref: "#/components/parameters/rate_value"
  #       - $ref: "#/components/parameters/stock_price"
  #       - $ref: "#/components/parameters/format"
  #     responses:
  #       "200":
  #         $ref: "#/components/responses/200_OK"

  /option/history/eod:
    x-min-subscription: free
    get:
      summary: End of Day
      operationId: option_history_eod
      tags:
        - Option
        - History
      description: |
        - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for options, Thetadata generates a national EOD report at 17:15 ET each day.
        - ``created`` represents the datetime the report was generated and ``last_trade`` represents the datetime of the last trade. 
        - The quote in the response represents the last NBBO reported by OPRA at the time of report generation. 
        - You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html).
        > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We will expose further history for the EOD quote in the near future.
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/eod?symbol=AAPL&expiration=20241115&strike=170.000&right=call&start_date=20241104&end_date=20241104
          description: "Returns EOD report for an option contract"
        - url: http://localhost:25503/v3/option/history/eod?symbol=AAPL&expiration=*&start_date=20241104&end_date=20241104
          description: "Returns EOD report for all option contracts"
      parameters:
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns EOD report for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id049
                  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.
                    created:
                      type: string
                      format: date-time
                      description: The date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    last_trade:
                      type: string
                      format: date-time
                      description: The last trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    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.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "symbol,expiration,strike,right,created,last_trade,open,high,low,close,volume,count,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\
                \nAAPL,2024-11-15,170.000,CALL,2024-11-04T17:16:56.205,2024-11-04T15:48:12.005,52.54,52.75,52.40,52.40,10,3,70,60,52.05,50,15,47,52.45,50\r\
                \n"
            application/json:
              schema: &id050
                type: array
                items: *id049
              example:
                symbol:
                - AAPL
                ask_size:
                - 15
                last_trade:
                - '2024-11-04T15:48:12.005'
                created:
                - '2024-11-04T17:16:56.205'
                ask_condition:
                - 50
                strike:
                - 170.0
                count:
                - 3
                right:
                - CALL
                volume:
                - 10
                high:
                - 52.75
                low:
                - 52.4
                bid_size:
                - 70
                ask_exchange:
                - 47
                bid_exchange:
                - 60
                ask:
                - 52.45
                expiration:
                - '2024-11-15'
                bid:
                - 52.05
                bid_condition:
                - 50
                close:
                - 52.4
                open:
                - 52.54
            application/x-ndjson:
              schema: *id050
              example: '{"symbol":"AAPL","ask_size":15,"last_trade":"2024-11-04T15:48:12.005","created":"2024-11-04T17:16:56.205","ask_condition":50,"strike":170.000,"count":3,"right":"CALL","volume":10,"high":52.75,"low":52.40,"bid_size":70,"ask_exchange":47,"bid_exchange":60,"ask":52.45,"expiration":"2024-11-15","bid":52.05,"bid_condition":50,"close":52.40,"open":52.54}'

  /option/history/ohlc:
    x-min-subscription: value
    get:
      summary: Open High Low Close
      operationId: option_history_ohlc
      tags:
        - Option
        - History
      description: |
        - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. 
        - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar:  ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``.
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/ohlc?symbol=AAPL&expiration=20231103&strike=170.000&right=call&date=20231103&interval=1m
          description: "Returns OHLC for an option contract"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration_no_star"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns OHLC for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id051
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    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.
                    vwap:
                      type: number
                      description: The volume weighted average price of the given interval.
              example: "symbol,expiration,strike,right,timestamp,open,high,low,close,volume,count,vwap\r\nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:30:00,4.48,7.05,3.60,4.00,147,24,4.39\r\
                \nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:31:00,3.85,4.65,3.65,4.65,39,19,4.31\r\nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:32:00,4.75,5.20,4.65,5.00,45,14,4.45\r\
                \nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:33:00,4.95,5.05,4.48,4.49,142,23,4.53\r\nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:34:00,4.50,5.05,4.50,4.73,29,11,4.56\r\
                \n"
            application/json:
              schema: &id052
                type: array
                items: *id051
              example:
                volume:
                - 147
                - 39
                - 45
                - 142
                - 29
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                high:
                - 7.05
                - 4.65
                - 5.2
                - 5.05
                - 5.05
                low:
                - 3.6
                - 3.65
                - 4.65
                - 4.48
                - 4.5
                strike:
                - 170.0
                - 170.0
                - 170.0
                - 170.0
                - 170.0
                vwap:
                - 4.39
                - 4.31
                - 4.45
                - 4.53
                - 4.56
                count:
                - 24
                - 19
                - 14
                - 23
                - 11
                expiration:
                - '2023-11-03'
                - '2023-11-03'
                - '2023-11-03'
                - '2023-11-03'
                - '2023-11-03'
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                close:
                - 4.0
                - 4.65
                - 5.0
                - 4.49
                - 4.73
                open:
                - 4.48
                - 3.85
                - 4.75
                - 4.95
                - 4.5
                timestamp:
                - '2023-11-03T09:30:00'
                - '2023-11-03T09:31:00'
                - '2023-11-03T09:32:00'
                - '2023-11-03T09:33:00'
                - '2023-11-03T09:34:00'
            application/x-ndjson:
              schema: *id052
              example: '{"volume":147,"symbol":"AAPL","high":7.05,"low":3.60,"strike":170.000,"vwap":4.39,"count":24,"expiration":"2023-11-03","right":"CALL","close":4.00,"open":4.48,"timestamp":"2023-11-03T09:30:00"}

                {"volume":39,"symbol":"AAPL","high":4.65,"low":3.65,"strike":170.000,"vwap":4.31,"count":19,"expiration":"2023-11-03","right":"CALL","close":4.65,"open":3.85,"timestamp":"2023-11-03T09:31:00"}

                {"volume":45,"symbol":"AAPL","high":5.20,"low":4.65,"strike":170.000,"vwap":4.45,"count":14,"expiration":"2023-11-03","right":"CALL","close":5.00,"open":4.75,"timestamp":"2023-11-03T09:32:00"}

                {"volume":142,"symbol":"AAPL","high":5.05,"low":4.48,"strike":170.000,"vwap":4.53,"count":23,"expiration":"2023-11-03","right":"CALL","close":4.49,"open":4.95,"timestamp":"2023-11-03T09:33:00"}

                {"volume":29,"symbol":"AAPL","high":5.05,"low":4.50,"strike":170.000,"vwap":4.56,"count":11,"expiration":"2023-11-03","right":"CALL","close":4.73,"open":4.50,"timestamp":"2023-11-03T09:34:00"}'

  /option/history/trade:
    x-min-subscription: standard
    get:
      summary: Trade
      operationId: option_history_trade
      tags:
        - Option
        - History
      description: |
        - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). 
        - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
        - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) for options, so they can be ignored.
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/trade?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104
          description: "Returns every trade for an option contract"
        - url: http://localhost:25503/v3/option/history/trade?symbol=AAPL&expiration=*&date=20241104
          description: "Returns every trade for all option contracts"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        # - $ref: "#/components/parameters/interval"  # NOT CURRENTLY SUPPORTED IN v2
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns every trade for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id053
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
              example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,18902138,255,255,255,255,130,2,22,3.90\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.626,19368856,255,255,255,255,130,1,6,4.25\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.698,19403970,255,255,255,255,130,1,6,4.22\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,19598457,255,255,255,255,18,1,5,4.15\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,19598464,255,255,255,255,18,1,5,4.15\r\n"
            application/json:
              schema: &id054
                type: array
                items: *id053
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                strike:
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                sequence:
                - 18902138
                - 19368856
                - 19403970
                - 19598457
                - 19598464
                condition:
                - 130
                - 130
                - 130
                - 18
                - 18
                size:
                - 2
                - 1
                - 1
                - 1
                - 1
                price:
                - 3.9
                - 4.25
                - 4.22
                - 4.15
                - 4.15
                ext_condition2:
                - 255
                - 255
                - 255
                - 255
                - 255
                ext_condition1:
                - 255
                - 255
                - 255
                - 255
                - 255
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                ext_condition4:
                - 255
                - 255
                - 255
                - 255
                - 255
                exchange:
                - 22
                - 6
                - 6
                - 5
                - 5
                ext_condition3:
                - 255
                - 255
                - 255
                - 255
                - 255
                timestamp:
                - '2024-11-04T09:30:00.471'
                - '2024-11-04T09:30:01.626'
                - '2024-11-04T09:30:01.698'
                - '2024-11-04T09:30:02.064'
                - '2024-11-04T09:30:02.064'
            application/x-ndjson:
              schema: *id054
              example: '{"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":18902138,"condition":130,"size":2,"price":3.90,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"timestamp":"2024-11-04T09:30:00.471"}

                {"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":19368856,"condition":130,"size":1,"price":4.25,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"timestamp":"2024-11-04T09:30:01.626"}

                {"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":19403970,"condition":130,"size":1,"price":4.22,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"timestamp":"2024-11-04T09:30:01.698"}

                {"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":19598457,"condition":18,"size":1,"price":4.15,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-04T09:30:02.064"}

                {"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":19598464,"condition":18,"size":1,"price":4.15,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-04T09:30:02.064"}'

  /option/history/quote:
    x-min-subscription: value
    get:
      summary: Quote
      operationId: option_history_quote
      tags:
        - Option
        - History
      description: |
        - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). 
        - If the ``interval`` parameter is specified, the quote for each interval represents the last quote at the interval's timestamp.
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/quote?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104&interval=1m
          description: "Returns every quote for an option contract"
        - url: http://localhost:25503/v3/option/history/quote?symbol=AAPL&expiration=*&date=20241104&interval=1m
          description: "Returns every quote for all option contracts"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns every quote for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id055
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "symbol,expiration,strike,right,timestamp,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00,0,42,0.00,50,0,42,0.00,50\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:31:00,598,5,4.55,50,424,9,4.70,50\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:32:00,58,46,4.30,50,221,11,4.40,50\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:33:00,394,43,3.90,50,45,47,4.00,50\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:34:00,194,11,4.15,50,121,11,4.30,50\r\n"
            application/json:
              schema: &id056
                type: array
                items: *id055
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                ask_size:
                - 0
                - 424
                - 221
                - 45
                - 121
                ask_condition:
                - 50
                - 50
                - 50
                - 50
                - 50
                strike:
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                bid_size:
                - 0
                - 598
                - 58
                - 394
                - 194
                ask_exchange:
                - 42
                - 9
                - 11
                - 47
                - 11
                bid_exchange:
                - 42
                - 5
                - 46
                - 43
                - 11
                ask:
                - 0.0
                - 4.7
                - 4.4
                - 4.0
                - 4.3
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                bid:
                - 0.0
                - 4.55
                - 4.3
                - 3.9
                - 4.15
                bid_condition:
                - 50
                - 50
                - 50
                - 50
                - 50
                timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:31:00'
                - '2024-11-04T09:32:00'
                - '2024-11-04T09:33:00'
                - '2024-11-04T09:34:00'
            application/x-ndjson:
              schema: *id056
              example: '{"symbol":"AAPL","ask_size":0,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":0,"ask_exchange":42,"bid_exchange":42,"ask":0.00,"expiration":"2024-11-08","bid":0.00,"bid_condition":50,"timestamp":"2024-11-04T09:30:00"}

                {"symbol":"AAPL","ask_size":424,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":598,"ask_exchange":9,"bid_exchange":5,"ask":4.70,"expiration":"2024-11-08","bid":4.55,"bid_condition":50,"timestamp":"2024-11-04T09:31:00"}

                {"symbol":"AAPL","ask_size":221,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":58,"ask_exchange":11,"bid_exchange":46,"ask":4.40,"expiration":"2024-11-08","bid":4.30,"bid_condition":50,"timestamp":"2024-11-04T09:32:00"}

                {"symbol":"AAPL","ask_size":45,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":394,"ask_exchange":47,"bid_exchange":43,"ask":4.00,"expiration":"2024-11-08","bid":3.90,"bid_condition":50,"timestamp":"2024-11-04T09:33:00"}

                {"symbol":"AAPL","ask_size":121,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":194,"ask_exchange":11,"bid_exchange":11,"ask":4.30,"expiration":"2024-11-08","bid":4.15,"bid_condition":50,"timestamp":"2024-11-04T09:34:00"}'

  /option/history/trade_quote:
    x-min-subscription: standard
    get:
      summary: Trade Quote
      operationId: option_history_trade_quote
      tags:
        - Option
        - History
      description: |
        - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) paired with the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at the time of trade.
        - A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. 
        - To match trades with quotes timestamps that are ``<`` the trade timestamp, specify the ``exclusive``parameter to ``true``. After thorough testing, we have determined that using ``exclusive=true`` might yield better results for various applications.
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/trade_quote?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104
          description: "Returns every trade quote for an option contract"
        - url: http://localhost:25503/v3/option/history/trade_quote?symbol=AAPL&expiration=*&date=20241104
          description: "Returns every trade quote for all option contracts"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/exclusive"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns every trade quote for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id057
                  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.
                    trade_timestamp:
                      type: string
                      format: date-time
                      description: The trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    quote_timestamp:
                      type: string
                      format: date-time
                      description: The quote date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "symbol,expiration,strike,right,trade_timestamp,quote_timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,2024-11-04T09:30:00.396,18902138,255,255,255,255,130,2,22,3.90,14,47,3.90,50,14,47,4.05,50\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.626,2024-11-04T09:30:01.594,19368856,255,255,255,255,130,1,6,4.25,93,76,4.15,50,35,73,4.30,50\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.698,2024-11-04T09:30:01.643,19403970,255,255,255,255,130,1,6,4.22,59,69,4.15,50,59,69,4.30,50\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,2024-11-04T09:30:02.039,19598457,255,255,255,255,18,1,5,4.15,31,69,4.15,50,81,11,4.30,50\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,2024-11-04T09:30:02.039,19598464,255,255,255,255,18,1,5,4.15,31,69,4.15,50,81,11,4.30,50\r\
                \n"
            application/json:
              schema: &id058
                type: array
                items: *id057
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                ask_size:
                - 14
                - 35
                - 59
                - 81
                - 81
                trade_timestamp:
                - '2024-11-04T09:30:00.471'
                - '2024-11-04T09:30:01.626'
                - '2024-11-04T09:30:01.698'
                - '2024-11-04T09:30:02.064'
                - '2024-11-04T09:30:02.064'
                ask_condition:
                - 50
                - 50
                - 50
                - 50
                - 50
                strike:
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                sequence:
                - 18902138
                - 19368856
                - 19403970
                - 19598457
                - 19598464
                condition:
                - 130
                - 130
                - 130
                - 18
                - 18
                size:
                - 2
                - 1
                - 1
                - 1
                - 1
                bid_size:
                - 14
                - 93
                - 59
                - 31
                - 31
                ask_exchange:
                - 47
                - 73
                - 69
                - 11
                - 11
                price:
                - 3.9
                - 4.25
                - 4.22
                - 4.15
                - 4.15
                ext_condition2:
                - 255
                - 255
                - 255
                - 255
                - 255
                bid_exchange:
                - 47
                - 76
                - 69
                - 69
                - 69
                ask:
                - 4.05
                - 4.3
                - 4.3
                - 4.3
                - 4.3
                quote_timestamp:
                - '2024-11-04T09:30:00.396'
                - '2024-11-04T09:30:01.594'
                - '2024-11-04T09:30:01.643'
                - '2024-11-04T09:30:02.039'
                - '2024-11-04T09:30:02.039'
                ext_condition1:
                - 255
                - 255
                - 255
                - 255
                - 255
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                ext_condition4:
                - 255
                - 255
                - 255
                - 255
                - 255
                exchange:
                - 22
                - 6
                - 6
                - 5
                - 5
                ext_condition3:
                - 255
                - 255
                - 255
                - 255
                - 255
                bid:
                - 3.9
                - 4.15
                - 4.15
                - 4.15
                - 4.15
                bid_condition:
                - 50
                - 50
                - 50
                - 50
                - 50
            application/x-ndjson:
              schema: *id058
              example: '{"symbol":"AAPL","ask_size":14,"trade_timestamp":"2024-11-04T09:30:00.471","ask_condition":50,"strike":220.000,"right":"CALL","sequence":18902138,"condition":130,"size":2,"bid_size":14,"ask_exchange":47,"price":3.90,"ext_condition2":255,"bid_exchange":47,"ask":4.05,"quote_timestamp":"2024-11-04T09:30:00.396","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"bid":3.90,"bid_condition":50}

                {"symbol":"AAPL","ask_size":35,"trade_timestamp":"2024-11-04T09:30:01.626","ask_condition":50,"strike":220.000,"right":"CALL","sequence":19368856,"condition":130,"size":1,"bid_size":93,"ask_exchange":73,"price":4.25,"ext_condition2":255,"bid_exchange":76,"ask":4.30,"quote_timestamp":"2024-11-04T09:30:01.594","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"bid":4.15,"bid_condition":50}

                {"symbol":"AAPL","ask_size":59,"trade_timestamp":"2024-11-04T09:30:01.698","ask_condition":50,"strike":220.000,"right":"CALL","sequence":19403970,"condition":130,"size":1,"bid_size":59,"ask_exchange":69,"price":4.22,"ext_condition2":255,"bid_exchange":69,"ask":4.30,"quote_timestamp":"2024-11-04T09:30:01.643","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"bid":4.15,"bid_condition":50}

                {"symbol":"AAPL","ask_size":81,"trade_timestamp":"2024-11-04T09:30:02.064","ask_condition":50,"strike":220.000,"right":"CALL","sequence":19598457,"condition":18,"size":1,"bid_size":31,"ask_exchange":11,"price":4.15,"ext_condition2":255,"bid_exchange":69,"ask":4.30,"quote_timestamp":"2024-11-04T09:30:02.039","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"bid":4.15,"bid_condition":50}

                {"symbol":"AAPL","ask_size":81,"trade_timestamp":"2024-11-04T09:30:02.064","ask_condition":50,"strike":220.000,"right":"CALL","sequence":19598464,"condition":18,"size":1,"bid_size":31,"ask_exchange":11,"price":4.15,"ext_condition2":255,"bid_exchange":69,"ask":4.30,"quote_timestamp":"2024-11-04T09:30:02.039","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"bid":4.15,"bid_condition":50}'

  /option/history/open_interest:
    x-min-subscription: value
    get:
      summary: Open Interest
      operationId: option_history_open_interest
      tags:
        - Option
        - History
      description: |
        - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at approximately 06:30 ET.
        - A new open interest message might not be sent by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) if there is no open interest for the option contract.
        - The reported open interest represents the open interest at the end of the previous trading day.
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/open_interest?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104
          description: "Returns open interest for an option contract"
        - url: http://localhost:25503/v3/option/history/open_interest?symbol=AAPL&expiration=*&date=20241104
          description: "Returns open interest for all option contracts"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns open interest for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id059
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    open_interest:
                      type: integer
                      description: The total amount of outstanding contracts.
              example: "symbol,expiration,strike,right,timestamp,open_interest\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T06:30:04,2732\r\
                \n"
            application/json:
              schema: &id060
                type: array
                items: *id059
              example:
                symbol:
                - AAPL
                strike:
                - 220.0
                open_interest:
                - 2732
                expiration:
                - '2024-11-08'
                right:
                - CALL
                timestamp:
                - '2024-11-04T06:30:04'
            application/x-ndjson:
              schema: *id060
              example: '{"symbol":"AAPL","strike":220.000,"open_interest":2732,"expiration":"2024-11-08","right":"CALL","timestamp":"2024-11-04T06:30:04"}'

  /option/history/greeks/eod:
    x-min-subscription: standard
    get:
      summary: End of Day Greeks
      operationId: option_history_greeks_eod
      tags:
        - Option
        - History
      description: |
        - Returns the data for all contracts that share the same provided symbol and expiration. 
        - Uses Theta Data's EOD reports that get generated at 17:15 ET each day. The closing option price and closing underlying price are used for the greeks calculation.
        - **Set `expiration` to ``*`` if you want to retrieve data for every option that shares the same ``symbol``. (note: Any ``expiration=*`` must be requested day by day)**
        > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We are working to expose this over the coming months. Obtaining the quote at the end of the day requires much more processing than the trades, so we initially generated our history for trades.
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/greeks/eod?symbol=AAPL&expiration=20241108&strike=220.000&right=call&start_date=20241104&end_date=20241104
          description: "Returns EOD report for an option contract"
        - url: http://localhost:25503/v3/option/history/greeks/eod?symbol=AAPL&expiration=*&start_date=20241104&end_date=20241104
          description: "Returns EOD report for all option contracts"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns EOD report for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id061
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    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.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    delta:
                      type: number
                      description: The delta.
                    theta:
                      type: string
                      description: The Theta.
                    vega:
                      type: number
                      description: The vega.
                    rho:
                      type: number
                      description: The rho.
                    epsilon:
                      type: string
                      description: The epsilon.
                    lambda:
                      type: number
                      description: The lambda.
                    gamma:
                      type: number
                      description: The gamma.
                    vanna:
                      type: string
                      description: The vanna.
                    charm:
                      type: number
                      description: The charm.
                    vomma:
                      type: number
                      description: The vomma.
                    veta:
                      type: number
                      description: The veta.
                    vera:
                      type: number
                      description: The vera.
                    speed:
                      type: number
                      description: The speed.
                    zomma:
                      type: number
                      description: The zomma.
                    color:
                      type: string
                      description: The color.
                    ultima:
                      type: string
                      description: The ultima.
                    d1:
                      type: number
                      description: The d1.
                    d2:
                      type: number
                      description: The d2.
                    dual_delta:
                      type: string
                      description: The dual delta.
                    dual_gamma:
                      type: number
                      description: The dual gamma.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,open,high,low,close,volume,count,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition,delta,theta,vega,rho,epsilon,lambda,gamma,vanna,charm,vomma,veta,vera,speed,zomma,color,ultima,d1,d2,dual_delta,dual_gamma,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T15:59:59.828,3.90,4.85,3.35,4.15,7425,1511,9,11,4.10,50,12,5,4.25,50,0.6083,-0.3892,8.9221,1.4334,-1.4791,32.3623,0.0495,-0.2765,3.6779,1.7667,0.0149,0.0000,0.0000,0.0000,-0.0163,-15.6407,0.2750,0.2401,-0.5945,0.0000,0.3334,0.0001,2024-11-04T17:15:28.71,221.870\r\
                \n"
            application/json:
              schema: &id062
                type: array
                items: *id061
              example:
                symbol:
                - AAPL
                ask_size:
                - 12
                dual_delta:
                - -0.5945
                color:
                - -0.0163
                zomma:
                - 0.0
                delta:
                - 0.6083
                implied_vol:
                - 0.3334
                theta:
                - -0.3892
                d1:
                - 0.275
                speed:
                - 0.0
                d2:
                - 0.2401
                epsilon:
                - -1.4791
                high:
                - 4.85
                lambda:
                - 32.3623
                low:
                - 3.35
                ask_exchange:
                - 5
                bid_exchange:
                - 11
                vomma:
                - 1.7667
                bid_condition:
                - 50
                underlying_timestamp:
                - '2024-11-04T17:15:28.71'
                close:
                - 4.15
                timestamp:
                - '2024-11-04T15:59:59.828'
                underlying_price:
                - 221.87
                ask_condition:
                - 50
                strike:
                - 220.0
                count:
                - 1511
                vera:
                - 0.0
                right:
                - CALL
                veta:
                - 0.0149
                iv_error:
                - 0.0001
                ultima:
                - -15.6407
                volume:
                - 7425
                charm:
                - 3.6779
                bid_size:
                - 9
                ask:
                - 4.25
                rho:
                - 1.4334
                expiration:
                - '2024-11-08'
                vanna:
                - -0.2765
                dual_gamma:
                - 0.0
                bid:
                - 4.1
                open:
                - 3.9
                vega:
                - 8.9221
                gamma:
                - 0.0495
            application/x-ndjson:
              schema: *id062
              example: '{"symbol":"AAPL","ask_size":12,"dual_delta":-0.5945,"color":-0.0163,"zomma":0.0000,"delta":0.6083,"implied_vol":0.3334,"theta":-0.3892,"d1":0.2750,"speed":0.0000,"d2":0.2401,"epsilon":-1.4791,"high":4.85,"lambda":32.3623,"low":3.35,"ask_exchange":5,"bid_exchange":11,"vomma":1.7667,"bid_condition":50,"underlying_timestamp":"2024-11-04T17:15:28.71","close":4.15,"timestamp":"2024-11-04T15:59:59.828","underlying_price":221.870,"ask_condition":50,"strike":220.000,"count":1511,"vera":0.0000,"right":"CALL","veta":0.0149,"iv_error":0.0001,"ultima":-15.6407,"volume":7425,"charm":3.6779,"bid_size":9,"ask":4.25,"rho":1.4334,"expiration":"2024-11-08","vanna":-0.2765,"dual_gamma":0.0000,"bid":4.10,"open":3.90,"vega":8.9221,"gamma":0.0495}'

  /option/history/greeks/all:
    x-min-subscription: professional
    get:
      summary: All Greeks
      operationId: option_history_greeks_all
      tags:
        - Option
        - History
      description: |
        - Returns the data for all contracts that share the same provided symbol and expiration. 
        - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. 
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/greeks/all?symbol=AAPL&expiration=20241108&date=20241104&interval=10m
          description: "Returns all greeks for an option contract"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration_no_star"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns all greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id063
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    delta:
                      type: number
                      description: The delta.
                    theta:
                      type: number
                      description: The Theta.
                    vega:
                      type: number
                      description: The vega.
                    rho:
                      type: number
                      description: The rho.
                    epsilon:
                      type: number
                      description: The epsilon.
                    lambda:
                      type: number
                      description: The lambda.
                    gamma:
                      type: number
                      description: The gamma.
                    vanna:
                      type: number
                      description: The vanna.
                    charm:
                      type: number
                      description: The charm.
                    vomma:
                      type: number
                      description: The vomma.
                    veta:
                      type: number
                      description: The veta.
                    vera:
                      type: number
                      description: The vera.
                    speed:
                      type: number
                      description: The speed.
                    zomma:
                      type: number
                      description: The zomma.
                    color:
                      type: number
                      description: The color.
                    ultima:
                      type: number
                      description: The ultima.
                    d1:
                      type: string
                      description: The d1.
                    d2:
                      type: string
                      description: The d2.
                    dual_delta:
                      type: number
                      description: The dual delta.
                    dual_gamma:
                      type: number
                      description: The dual gamma.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,ask,delta,theta,vega,rho,epsilon,lambda,gamma,vanna,charm,vomma,veta,vera,speed,zomma,color,ultima,d1,d2,dual_delta,dual_gamma,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:30:00,0.00,0.00,0.0000,0.0000,0.0000,0.0000,0.0000,261.9304,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0001,-6.5422,-6.5683,0.0000,0.0000,0.2500,100.0000,2024-11-04T09:30:00,221.00\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:40:00,0.00,0.02,0.0026,-0.0138,0.1873,0.0062,-0.0063,55.3974,0.0005,0.0393,-1.0623,2.5389,0.0136,0.0000,0.0000,0.0000,-0.0005,21.4427,-2.7911,-2.8526,-0.0021,0.0000,0.5874,0.0455,2024-11-04T09:40:00,220.56\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:50:00,0.00,0.02,0.0025,-0.0130,0.1807,0.0059,-0.0060,56.7822,0.0005,0.0388,-1.0265,2.5262,0.0133,0.0000,0.0000,0.0000,-0.0005,22.1272,-2.8050,-2.8652,-0.0020,0.0000,0.5749,-0.0199,2024-11-04T09:50:00,221.20\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T10:00:00,0.00,0.02,0.0025,-0.0129,0.1825,0.0060,-0.0061,57.9900,0.0006,0.0399,-1.0319,2.6034,0.0136,0.0000,0.0000,0.0000,-0.0005,23.2345,-2.8027,-2.8616,-0.0021,0.0000,0.5625,-0.0299,2024-11-04T10:00:00,222.06\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T10:10:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,254.5285,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0004,-6.3404,-6.3666,0.0000,0.0000,0.2500,100.0000,2024-11-04T10:10:00,222.17\r\
                \n"
            application/json:
              schema: &id064
                type: array
                items: *id063
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                dual_delta:
                - 0.0
                - -0.0021
                - -0.002
                - -0.0021
                - 0.0
                color:
                - 0.0
                - -0.0005
                - -0.0005
                - -0.0005
                - 0.0
                zomma:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                delta:
                - 0.0
                - 0.0026
                - 0.0025
                - 0.0025
                - 0.0
                implied_vol:
                - 0.25
                - 0.5874
                - 0.5749
                - 0.5625
                - 0.25
                theta:
                - 0.0
                - -0.0138
                - -0.013
                - -0.0129
                - 0.0
                d1:
                - -6.5422
                - -2.7911
                - -2.805
                - -2.8027
                - -6.3404
                speed:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                d2:
                - -6.5683
                - -2.8526
                - -2.8652
                - -2.8616
                - -6.3666
                epsilon:
                - 0.0
                - -0.0063
                - -0.006
                - -0.0061
                - 0.0
                lambda:
                - 261.9304
                - 55.3974
                - 56.7822
                - 57.99
                - 254.5285
                vomma:
                - 0.0
                - 2.5389
                - 2.5262
                - 2.6034
                - 0.0
                underlying_timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:40:00'
                - '2024-11-04T09:50:00'
                - '2024-11-04T10:00:00'
                - '2024-11-04T10:10:00'
                timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:40:00'
                - '2024-11-04T09:50:00'
                - '2024-11-04T10:00:00'
                - '2024-11-04T10:10:00'
                underlying_price:
                - 221.0
                - 220.56
                - 221.2
                - 222.06
                - 222.17
                strike:
                - 262.5
                - 262.5
                - 262.5
                - 262.5
                - 262.5
                vera:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                veta:
                - 0.0
                - 0.0136
                - 0.0133
                - 0.0136
                - 0.0
                iv_error:
                - 100.0
                - 0.0455
                - -0.0199
                - -0.0299
                - 100.0
                ultima:
                - 0.0001
                - 21.4427
                - 22.1272
                - 23.2345
                - 0.0004
                charm:
                - 0.0
                - -1.0623
                - -1.0265
                - -1.0319
                - 0.0
                ask:
                - 0.0
                - 0.02
                - 0.02
                - 0.02
                - 0.01
                rho:
                - 0.0
                - 0.0062
                - 0.0059
                - 0.006
                - 0.0
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                vanna:
                - 0.0
                - 0.0393
                - 0.0388
                - 0.0399
                - 0.0
                dual_gamma:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                bid:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                vega:
                - 0.0
                - 0.1873
                - 0.1807
                - 0.1825
                - 0.0
                gamma:
                - 0.0
                - 0.0005
                - 0.0005
                - 0.0006
                - 0.0
            application/x-ndjson:
              schema: *id064
              example: '{"symbol":"AAPL","dual_delta":0.0000,"color":0.0000,"zomma":0.0000,"delta":0.0000,"implied_vol":0.2500,"theta":0.0000,"d1":-6.5422,"speed":0.0000,"d2":-6.5683,"epsilon":0.0000,"lambda":261.9304,"vomma":0.0000,"underlying_timestamp":"2024-11-04T09:30:00","timestamp":"2024-11-04T09:30:00","underlying_price":221.00,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0000,"iv_error":100.0000,"ultima":0.0001,"charm":0.0000,"ask":0.00,"rho":0.0000,"expiration":"2024-11-08","vanna":0.0000,"dual_gamma":0.0000,"bid":0.00,"vega":0.0000,"gamma":0.0000}

                {"symbol":"AAPL","dual_delta":-0.0021,"color":-0.0005,"zomma":0.0000,"delta":0.0026,"implied_vol":0.5874,"theta":-0.0138,"d1":-2.7911,"speed":0.0000,"d2":-2.8526,"epsilon":-0.0063,"lambda":55.3974,"vomma":2.5389,"underlying_timestamp":"2024-11-04T09:40:00","timestamp":"2024-11-04T09:40:00","underlying_price":220.56,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0136,"iv_error":0.0455,"ultima":21.4427,"charm":-1.0623,"ask":0.02,"rho":0.0062,"expiration":"2024-11-08","vanna":0.0393,"dual_gamma":0.0000,"bid":0.00,"vega":0.1873,"gamma":0.0005}

                {"symbol":"AAPL","dual_delta":-0.0020,"color":-0.0005,"zomma":0.0000,"delta":0.0025,"implied_vol":0.5749,"theta":-0.0130,"d1":-2.8050,"speed":0.0000,"d2":-2.8652,"epsilon":-0.0060,"lambda":56.7822,"vomma":2.5262,"underlying_timestamp":"2024-11-04T09:50:00","timestamp":"2024-11-04T09:50:00","underlying_price":221.20,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0133,"iv_error":-0.0199,"ultima":22.1272,"charm":-1.0265,"ask":0.02,"rho":0.0059,"expiration":"2024-11-08","vanna":0.0388,"dual_gamma":0.0000,"bid":0.00,"vega":0.1807,"gamma":0.0005}

                {"symbol":"AAPL","dual_delta":-0.0021,"color":-0.0005,"zomma":0.0000,"delta":0.0025,"implied_vol":0.5625,"theta":-0.0129,"d1":-2.8027,"speed":0.0000,"d2":-2.8616,"epsilon":-0.0061,"lambda":57.9900,"vomma":2.6034,"underlying_timestamp":"2024-11-04T10:00:00","timestamp":"2024-11-04T10:00:00","underlying_price":222.06,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0136,"iv_error":-0.0299,"ultima":23.2345,"charm":-1.0319,"ask":0.02,"rho":0.0060,"expiration":"2024-11-08","vanna":0.0399,"dual_gamma":0.0000,"bid":0.00,"vega":0.1825,"gamma":0.0006}

                {"symbol":"AAPL","dual_delta":0.0000,"color":0.0000,"zomma":0.0000,"delta":0.0000,"implied_vol":0.2500,"theta":0.0000,"d1":-6.3404,"speed":0.0000,"d2":-6.3666,"epsilon":0.0000,"lambda":254.5285,"vomma":0.0000,"underlying_timestamp":"2024-11-04T10:10:00","timestamp":"2024-11-04T10:10:00","underlying_price":222.17,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0000,"iv_error":100.0000,"ultima":0.0004,"charm":0.0000,"ask":0.01,"rho":0.0000,"expiration":"2024-11-08","vanna":0.0000,"dual_gamma":0.0000,"bid":0.00,"vega":0.0000,"gamma":0.0000}'

  /option/history/trade_greeks/all:
    x-min-subscription: professional
    get:
      summary: All Trade Greeks
      operationId: option_history_trade_greeks_all
      tags:
        - Option
        - History
      description: |
        - Returns the data for all contracts that share the same provided symbol and expiration. 
        - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html).
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/trade_greeks/all?symbol=AAPL&expiration=20231117&date=20231110
          description: "Returns all trade greeks for an option contract"
        - url: http://localhost:25503/v3/option/history/trade_greeks/all?symbol=AAPL&expiration=*&date=20231110
          description: "Returns all trade greeks for an full chain of option contracts"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns all trade greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id065
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: string
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
                    delta:
                      type: number
                      description: The delta.
                    theta:
                      type: string
                      description: The Theta.
                    vega:
                      type: number
                      description: The vega.
                    rho:
                      type: number
                      description: The rho.
                    epsilon:
                      type: string
                      description: The epsilon.
                    lambda:
                      type: number
                      description: The lambda.
                    gamma:
                      type: number
                      description: The gamma.
                    vanna:
                      type: number
                      description: The vanna.
                    charm:
                      type: string
                      description: The charm.
                    vomma:
                      type: number
                      description: The vomma.
                    veta:
                      type: number
                      description: The veta.
                    vera:
                      type: number
                      description: The vera.
                    speed:
                      type: number
                      description: The speed.
                    zomma:
                      type: number
                      description: The zomma.
                    color:
                      type: string
                      description: The color.
                    ultima:
                      type: string
                      description: The ultima.
                    d1:
                      type: string
                      description: The d1.
                    d2:
                      type: string
                      description: The d2.
                    dual_delta:
                      type: string
                      description: The dual delta.
                    dual_gamma:
                      type: number
                      description: The dual gamma.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: string
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,delta,theta,vega,rho,epsilon,lambda,gamma,vanna,charm,vomma,veta,vera,speed,zomma,color,ultima,d1,d2,dual_delta,dual_gamma,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.004,-1391330475,255,255,255,255,18,1,9,0.59,0.2289,-0.1031,7.7122,0.7960,-0.8073,71.4109,0.0674,1.3174,-6.7146,24.9086,0.3553,0.0000,0.0000,0.0000,-0.0129,-100.0000,-0.7424,-0.7668,-0.2213,0.0000,0.1762,-0.0008,2023-11-10T09:30:00,183.89\r\
                \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.154,-1391317465,255,255,255,255,18,1,47,0.59,0.2289,-0.1031,7.7122,0.7960,-0.8073,71.4109,0.0674,1.3174,-6.7146,24.9086,0.3553,0.0000,0.0000,0.0000,-0.0129,-100.0000,-0.7424,-0.7668,-0.2213,0.0000,0.1762,-0.0008,2023-11-10T09:30:00,183.89\r\
                \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.22,-1391313694,255,255,255,255,18,8,6,0.52,0.2162,-0.0947,7.4656,0.7526,-0.7625,76.6064,0.0689,1.4186,-6.8508,28.3594,0.3755,0.0000,0.0000,0.0000,-0.0118,-100.0000,-0.7849,-0.8081,-0.2093,0.0000,0.1669,-0.0018,2023-11-10T09:30:00,183.89\r\
                \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.221,-1391313652,255,255,255,255,130,1,6,0.57,0.2256,-0.1009,7.6504,0.7849,-0.7958,72.7109,0.0678,1.3432,-6.7516,25.7650,0.3605,0.0000,0.0000,0.0000,-0.0126,-100.0000,-0.7531,-0.7772,-0.2182,0.0000,0.1738,0.0012,2023-11-10T09:30:00,183.89\r\
                \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.452,-1391297309,255,255,255,255,18,6,31,0.60,0.2308,-0.1044,7.7484,0.8025,-0.8140,70.6522,0.0672,1.3022,-6.6920,24.4114,0.3523,0.0000,0.0000,0.0000,-0.0130,-100.0000,-0.7360,-0.7607,-0.2231,0.0000,0.1777,0.0013,2023-11-10T09:30:00,183.89\r\
                \n"
            application/json:
              schema: &id066
                type: array
                items: *id065
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                dual_delta:
                - -0.2213
                - -0.2213
                - -0.2093
                - -0.2182
                - -0.2231
                color:
                - -0.0129
                - -0.0129
                - -0.0118
                - -0.0126
                - -0.013
                zomma:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                delta:
                - 0.2289
                - 0.2289
                - 0.2162
                - 0.2256
                - 0.2308
                implied_vol:
                - 0.1762
                - 0.1762
                - 0.1669
                - 0.1738
                - 0.1777
                theta:
                - -0.1031
                - -0.1031
                - -0.0947
                - -0.1009
                - -0.1044
                d1:
                - -0.7424
                - -0.7424
                - -0.7849
                - -0.7531
                - -0.736
                speed:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                d2:
                - -0.7668
                - -0.7668
                - -0.8081
                - -0.7772
                - -0.7607
                epsilon:
                - -0.8073
                - -0.8073
                - -0.7625
                - -0.7958
                - -0.814
                lambda:
                - 71.4109
                - 71.4109
                - 76.6064
                - 72.7109
                - 70.6522
                price:
                - 0.59
                - 0.59
                - 0.52
                - 0.57
                - 0.6
                ext_condition2:
                - 255
                - 255
                - 255
                - 255
                - 255
                ext_condition1:
                - 255
                - 255
                - 255
                - 255
                - 255
                ext_condition4:
                - 255
                - 255
                - 255
                - 255
                - 255
                vomma:
                - 24.9086
                - 24.9086
                - 28.3594
                - 25.765
                - 24.4114
                ext_condition3:
                - 255
                - 255
                - 255
                - 255
                - 255
                underlying_timestamp:
                - '2023-11-10T09:30:00'
                - '2023-11-10T09:30:00'
                - '2023-11-10T09:30:00'
                - '2023-11-10T09:30:00'
                - '2023-11-10T09:30:00'
                timestamp:
                - '2023-11-10T09:30:00.004'
                - '2023-11-10T09:30:00.154'
                - '2023-11-10T09:30:00.22'
                - '2023-11-10T09:30:00.221'
                - '2023-11-10T09:30:00.452'
                underlying_price:
                - 183.89
                - 183.89
                - 183.89
                - 183.89
                - 183.89
                strike:
                - 187.5
                - 187.5
                - 187.5
                - 187.5
                - 187.5
                vera:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                veta:
                - 0.3553
                - 0.3553
                - 0.3755
                - 0.3605
                - 0.3523
                iv_error:
                - -0.0008
                - -0.0008
                - -0.0018
                - 0.0012
                - 0.0013
                ultima:
                - -100.0
                - -100.0
                - -100.0
                - -100.0
                - -100.0
                sequence:
                - -1391330475
                - -1391317465
                - -1391313694
                - -1391313652
                - -1391297309
                condition:
                - 18
                - 18
                - 18
                - 130
                - 18
                size:
                - 1
                - 1
                - 8
                - 1
                - 6
                charm:
                - -6.7146
                - -6.7146
                - -6.8508
                - -6.7516
                - -6.692
                rho:
                - 0.796
                - 0.796
                - 0.7526
                - 0.7849
                - 0.8025
                expiration:
                - '2023-11-17'
                - '2023-11-17'
                - '2023-11-17'
                - '2023-11-17'
                - '2023-11-17'
                exchange:
                - 9
                - 47
                - 6
                - 6
                - 31
                vanna:
                - 1.3174
                - 1.3174
                - 1.4186
                - 1.3432
                - 1.3022
                dual_gamma:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                vega:
                - 7.7122
                - 7.7122
                - 7.4656
                - 7.6504
                - 7.7484
                gamma:
                - 0.0674
                - 0.0674
                - 0.0689
                - 0.0678
                - 0.0672
            application/x-ndjson:
              schema: *id066
              example: '{"symbol":"AAPL","dual_delta":-0.2213,"color":-0.0129,"zomma":0.0000,"delta":0.2289,"implied_vol":0.1762,"theta":-0.1031,"d1":-0.7424,"speed":0.0000,"d2":-0.7668,"epsilon":-0.8073,"lambda":71.4109,"price":0.59,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":24.9086,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.004","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3553,"iv_error":-0.0008,"ultima":-100.0000,"sequence":-1391330475,"condition":18,"size":1,"charm":-6.7146,"rho":0.7960,"expiration":"2023-11-17","exchange":9,"vanna":1.3174,"dual_gamma":0.0000,"vega":7.7122,"gamma":0.0674}

                {"symbol":"AAPL","dual_delta":-0.2213,"color":-0.0129,"zomma":0.0000,"delta":0.2289,"implied_vol":0.1762,"theta":-0.1031,"d1":-0.7424,"speed":0.0000,"d2":-0.7668,"epsilon":-0.8073,"lambda":71.4109,"price":0.59,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":24.9086,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.154","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3553,"iv_error":-0.0008,"ultima":-100.0000,"sequence":-1391317465,"condition":18,"size":1,"charm":-6.7146,"rho":0.7960,"expiration":"2023-11-17","exchange":47,"vanna":1.3174,"dual_gamma":0.0000,"vega":7.7122,"gamma":0.0674}

                {"symbol":"AAPL","dual_delta":-0.2093,"color":-0.0118,"zomma":0.0000,"delta":0.2162,"implied_vol":0.1669,"theta":-0.0947,"d1":-0.7849,"speed":0.0000,"d2":-0.8081,"epsilon":-0.7625,"lambda":76.6064,"price":0.52,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":28.3594,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.22","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3755,"iv_error":-0.0018,"ultima":-100.0000,"sequence":-1391313694,"condition":18,"size":8,"charm":-6.8508,"rho":0.7526,"expiration":"2023-11-17","exchange":6,"vanna":1.4186,"dual_gamma":0.0000,"vega":7.4656,"gamma":0.0689}

                {"symbol":"AAPL","dual_delta":-0.2182,"color":-0.0126,"zomma":0.0000,"delta":0.2256,"implied_vol":0.1738,"theta":-0.1009,"d1":-0.7531,"speed":0.0000,"d2":-0.7772,"epsilon":-0.7958,"lambda":72.7109,"price":0.57,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":25.7650,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.221","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3605,"iv_error":0.0012,"ultima":-100.0000,"sequence":-1391313652,"condition":130,"size":1,"charm":-6.7516,"rho":0.7849,"expiration":"2023-11-17","exchange":6,"vanna":1.3432,"dual_gamma":0.0000,"vega":7.6504,"gamma":0.0678}

                {"symbol":"AAPL","dual_delta":-0.2231,"color":-0.0130,"zomma":0.0000,"delta":0.2308,"implied_vol":0.1777,"theta":-0.1044,"d1":-0.7360,"speed":0.0000,"d2":-0.7607,"epsilon":-0.8140,"lambda":70.6522,"price":0.60,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":24.4114,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.452","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3523,"iv_error":0.0013,"ultima":-100.0000,"sequence":-1391297309,"condition":18,"size":6,"charm":-6.6920,"rho":0.8025,"expiration":"2023-11-17","exchange":31,"vanna":1.3022,"dual_gamma":0.0000,"vega":7.7484,"gamma":0.0672}'

  /option/history/greeks/first_order:
    x-min-subscription: standard
    get:
      summary: First Order Greeks
      operationId: option_history_greeks_first_order
      tags:
        - Option
        - History
      description: |
        - Returns the data for all contracts that share the same provided symbol and expiration. 
        - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. 
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/greeks/first_order?symbol=AAPL&expiration=20241108&date=20241104&interval=5m
          description: "Returns first order greeks for an option contract"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration_no_star"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns first order greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id067
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    delta:
                      type: number
                      description: The delta.
                    theta:
                      type: number
                      description: The Theta.
                    vega:
                      type: number
                      description: The vega.
                    rho:
                      type: number
                      description: The rho.
                    epsilon:
                      type: number
                      description: The epsilon.
                    lambda:
                      type: number
                      description: The lambda.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,ask,delta,theta,vega,rho,epsilon,lambda,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:30:00,0.00,0.00,0.0000,0.0000,0.0000,0.0000,0.0000,261.9304,0.2500,100.0000,2024-11-04T09:30:00,221.00\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:35:00,0.00,0.02,0.0026,-0.0141,0.1913,0.0063,-0.0064,55.2930,0.5874,0.0721,2024-11-04T09:35:00,220.66\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:40:00,0.00,0.02,0.0026,-0.0138,0.1873,0.0062,-0.0063,55.3974,0.5874,0.0455,2024-11-04T09:40:00,220.56\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:45:00,0.00,0.02,0.0025,-0.0133,0.1832,0.0060,-0.0061,56.1024,0.5812,0.0075,2024-11-04T09:45:00,220.86\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:50:00,0.00,0.02,0.0025,-0.0130,0.1807,0.0059,-0.0060,56.7822,0.5749,-0.0199,2024-11-04T09:50:00,221.20\r\
                \n"
            application/json:
              schema: &id068
                type: array
                items: *id067
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                underlying_price:
                - 221.0
                - 220.66
                - 220.56
                - 220.86
                - 221.2
                strike:
                - 262.5
                - 262.5
                - 262.5
                - 262.5
                - 262.5
                delta:
                - 0.0
                - 0.0026
                - 0.0026
                - 0.0025
                - 0.0025
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                implied_vol:
                - 0.25
                - 0.5874
                - 0.5874
                - 0.5812
                - 0.5749
                theta:
                - 0.0
                - -0.0141
                - -0.0138
                - -0.0133
                - -0.013
                iv_error:
                - 100.0
                - 0.0721
                - 0.0455
                - 0.0075
                - -0.0199
                epsilon:
                - 0.0
                - -0.0064
                - -0.0063
                - -0.0061
                - -0.006
                lambda:
                - 261.9304
                - 55.293
                - 55.3974
                - 56.1024
                - 56.7822
                ask:
                - 0.0
                - 0.02
                - 0.02
                - 0.02
                - 0.02
                rho:
                - 0.0
                - 0.0063
                - 0.0062
                - 0.006
                - 0.0059
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                bid:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                underlying_timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:35:00'
                - '2024-11-04T09:40:00'
                - '2024-11-04T09:45:00'
                - '2024-11-04T09:50:00'
                vega:
                - 0.0
                - 0.1913
                - 0.1873
                - 0.1832
                - 0.1807
                timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:35:00'
                - '2024-11-04T09:40:00'
                - '2024-11-04T09:45:00'
                - '2024-11-04T09:50:00'
            application/x-ndjson:
              schema: *id068
              example: '{"symbol":"AAPL","underlying_price":221.00,"strike":262.500,"delta":0.0000,"right":"CALL","implied_vol":0.2500,"theta":0.0000,"iv_error":100.0000,"epsilon":0.0000,"lambda":261.9304,"ask":0.00,"rho":0.0000,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:30:00","vega":0.0000,"timestamp":"2024-11-04T09:30:00"}

                {"symbol":"AAPL","underlying_price":220.66,"strike":262.500,"delta":0.0026,"right":"CALL","implied_vol":0.5874,"theta":-0.0141,"iv_error":0.0721,"epsilon":-0.0064,"lambda":55.2930,"ask":0.02,"rho":0.0063,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:35:00","vega":0.1913,"timestamp":"2024-11-04T09:35:00"}

                {"symbol":"AAPL","underlying_price":220.56,"strike":262.500,"delta":0.0026,"right":"CALL","implied_vol":0.5874,"theta":-0.0138,"iv_error":0.0455,"epsilon":-0.0063,"lambda":55.3974,"ask":0.02,"rho":0.0062,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:40:00","vega":0.1873,"timestamp":"2024-11-04T09:40:00"}

                {"symbol":"AAPL","underlying_price":220.86,"strike":262.500,"delta":0.0025,"right":"CALL","implied_vol":0.5812,"theta":-0.0133,"iv_error":0.0075,"epsilon":-0.0061,"lambda":56.1024,"ask":0.02,"rho":0.0060,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:45:00","vega":0.1832,"timestamp":"2024-11-04T09:45:00"}

                {"symbol":"AAPL","underlying_price":221.20,"strike":262.500,"delta":0.0025,"right":"CALL","implied_vol":0.5749,"theta":-0.0130,"iv_error":-0.0199,"epsilon":-0.0060,"lambda":56.7822,"ask":0.02,"rho":0.0059,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:50:00","vega":0.1807,"timestamp":"2024-11-04T09:50:00"}'

  /option/history/trade_greeks/first_order:
    x-min-subscription: professional
    get:
      summary: First Order Trade Greeks
      operationId: option_history_trade_greeks_first_order
      tags:
        - Option
        - History
      description: |
        - Returns the data for all contracts that share the same provided symbol and expiration.
        - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html).
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/trade_greeks/first_order?symbol=AAPL&expiration=20241108&date=20241104
          description: "Returns first order trade greeks for an option contract"
        - url: http://localhost:25503/v3/option/history/trade_greeks/first_order?symbol=AAPL&expiration=*&date=20241104
          description: "Returns first order trade greeks for an full chain of option contracts"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns first order trade greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id069
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
                    delta:
                      type: number
                      description: The delta.
                    theta:
                      type: string
                      description: The Theta.
                    vega:
                      type: number
                      description: The vega.
                    rho:
                      type: number
                      description: The rho.
                    epsilon:
                      type: string
                      description: The epsilon.
                    lambda:
                      type: number
                      description: The lambda.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,delta,theta,vega,rho,epsilon,lambda,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:53:54.069,156249981,255,255,255,255,125,1,9,0.01,0.0025,-0.0134,0.1858,0.0061,-0.0062,56.6408,0.5749,0.0132,2024-11-04T09:53:54,221.33\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:14.764,546105677,255,255,255,255,131,2,5,81.32,0.9976,-0.0520,0.1690,1.5274,-2.4186,2.7139,1.5937,0.0000,2024-11-04T11:47:14,221.22\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:56.669,548097371,255,255,255,255,130,3,7,81.16,1.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0011,2024-11-04T11:47:56,221.18\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:03.852,548397162,255,255,255,255,130,3,6,81.26,0.9976,-0.0522,0.1697,1.5274,-2.4179,2.7152,1.5937,0.0000,2024-11-04T11:48:03,221.16\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:51.11,550463381,255,255,255,255,131,1,5,81.27,0.9993,-0.0279,0.0544,1.5317,-2.4223,2.7198,1.3968,0.0000,2024-11-04T11:48:51,221.19\r\
                \n"
            application/json:
              schema: &id070
                type: array
                items: *id069
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                underlying_price:
                - 221.33
                - 221.22
                - 221.18
                - 221.16
                - 221.19
                strike:
                - 262.5
                - 140.0
                - 140.0
                - 140.0
                - 140.0
                delta:
                - 0.0025
                - 0.9976
                - 1.0
                - 0.9976
                - 0.9993
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                implied_vol:
                - 0.5749
                - 1.5937
                - 0.0
                - 1.5937
                - 1.3968
                theta:
                - -0.0134
                - -0.052
                - 0.0
                - -0.0522
                - -0.0279
                iv_error:
                - 0.0132
                - 0.0
                - 0.0011
                - 0.0
                - 0.0
                epsilon:
                - -0.0062
                - -2.4186
                - 0.0
                - -2.4179
                - -2.4223
                sequence:
                - 156249981
                - 546105677
                - 548097371
                - 548397162
                - 550463381
                condition:
                - 125
                - 131
                - 130
                - 130
                - 131
                lambda:
                - 56.6408
                - 2.7139
                - 0.0
                - 2.7152
                - 2.7198
                size:
                - 1
                - 2
                - 3
                - 3
                - 1
                price:
                - 0.01
                - 81.32
                - 81.16
                - 81.26
                - 81.27
                ext_condition2:
                - 255
                - 255
                - 255
                - 255
                - 255
                rho:
                - 0.0061
                - 1.5274
                - 0.0
                - 1.5274
                - 1.5317
                ext_condition1:
                - 255
                - 255
                - 255
                - 255
                - 255
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                ext_condition4:
                - 255
                - 255
                - 255
                - 255
                - 255
                exchange:
                - 9
                - 5
                - 7
                - 6
                - 5
                ext_condition3:
                - 255
                - 255
                - 255
                - 255
                - 255
                underlying_timestamp:
                - '2024-11-04T09:53:54'
                - '2024-11-04T11:47:14'
                - '2024-11-04T11:47:56'
                - '2024-11-04T11:48:03'
                - '2024-11-04T11:48:51'
                vega:
                - 0.1858
                - 0.169
                - 0.0
                - 0.1697
                - 0.0544
                timestamp:
                - '2024-11-04T09:53:54.069'
                - '2024-11-04T11:47:14.764'
                - '2024-11-04T11:47:56.669'
                - '2024-11-04T11:48:03.852'
                - '2024-11-04T11:48:51.11'
            application/x-ndjson:
              schema: *id070
              example: '{"symbol":"AAPL","underlying_price":221.33,"strike":262.500,"delta":0.0025,"right":"CALL","implied_vol":0.5749,"theta":-0.0134,"iv_error":0.0132,"epsilon":-0.0062,"sequence":156249981,"condition":125,"lambda":56.6408,"size":1,"price":0.01,"ext_condition2":255,"rho":0.0061,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":9,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:53:54","vega":0.1858,"timestamp":"2024-11-04T09:53:54.069"}

                {"symbol":"AAPL","underlying_price":221.22,"strike":140.000,"delta":0.9976,"right":"CALL","implied_vol":1.5937,"theta":-0.0520,"iv_error":0.0000,"epsilon":-2.4186,"sequence":546105677,"condition":131,"lambda":2.7139,"size":2,"price":81.32,"ext_condition2":255,"rho":1.5274,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:14","vega":0.1690,"timestamp":"2024-11-04T11:47:14.764"}

                {"symbol":"AAPL","underlying_price":221.18,"strike":140.000,"delta":1.0000,"right":"CALL","implied_vol":0.0000,"theta":0.0000,"iv_error":0.0011,"epsilon":0.0000,"sequence":548097371,"condition":130,"lambda":0.0000,"size":3,"price":81.16,"ext_condition2":255,"rho":0.0000,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":7,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:56","vega":0.0000,"timestamp":"2024-11-04T11:47:56.669"}

                {"symbol":"AAPL","underlying_price":221.16,"strike":140.000,"delta":0.9976,"right":"CALL","implied_vol":1.5937,"theta":-0.0522,"iv_error":0.0000,"epsilon":-2.4179,"sequence":548397162,"condition":130,"lambda":2.7152,"size":3,"price":81.26,"ext_condition2":255,"rho":1.5274,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:03","vega":0.1697,"timestamp":"2024-11-04T11:48:03.852"}

                {"symbol":"AAPL","underlying_price":221.19,"strike":140.000,"delta":0.9993,"right":"CALL","implied_vol":1.3968,"theta":-0.0279,"iv_error":0.0000,"epsilon":-2.4223,"sequence":550463381,"condition":131,"lambda":2.7198,"size":1,"price":81.27,"ext_condition2":255,"rho":1.5317,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:51","vega":0.0544,"timestamp":"2024-11-04T11:48:51.11"}'

  /option/history/greeks/second_order:
    x-min-subscription: professional
    get:
      summary: Second Order Greeks
      operationId: option_history_greeks_second_order
      tags:
        - Option
        - History
      description: |
        - Returns the data for all contracts that share the same provided symbol and expiration. 
        - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. 
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/greeks/second_order?symbol=AAPL&expiration=20241108&date=20241104&interval=1h
          description: "Returns second order greeks for an option contract"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration_no_star"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns second order greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id071
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    gamma:
                      type: number
                      description: The gamma.
                    vanna:
                      type: number
                      description: The vanna.
                    charm:
                      type: number
                      description: The charm.
                    vomma:
                      type: number
                      description: The vomma.
                    veta:
                      type: number
                      description: The veta.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,ask,gamma,vanna,charm,vomma,veta,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:30:00,0.00,0.00,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T09:30:00,221.00\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T10:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T10:30:00,221.73\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T11:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T11:30:00,221.49\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T12:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T12:30:00,221.11\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T13:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T13:30:00,222.03\r\
                \n"
            application/json:
              schema: &id072
                type: array
                items: *id071
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                underlying_price:
                - 221.0
                - 221.73
                - 221.49
                - 221.11
                - 222.03
                strike:
                - 262.5
                - 262.5
                - 262.5
                - 262.5
                - 262.5
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                veta:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                implied_vol:
                - 0.25
                - 0.25
                - 0.25
                - 0.25
                - 0.25
                iv_error:
                - 100.0
                - 100.0
                - 100.0
                - 100.0
                - 100.0
                charm:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                ask:
                - 0.0
                - 0.01
                - 0.01
                - 0.01
                - 0.01
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                vanna:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                vomma:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                bid:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                underlying_timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T10:30:00'
                - '2024-11-04T11:30:00'
                - '2024-11-04T12:30:00'
                - '2024-11-04T13:30:00'
                gamma:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T10:30:00'
                - '2024-11-04T11:30:00'
                - '2024-11-04T12:30:00'
                - '2024-11-04T13:30:00'
            application/x-ndjson:
              schema: *id072
              example: '{"symbol":"AAPL","underlying_price":221.00,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.00,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T09:30:00","gamma":0.0000,"timestamp":"2024-11-04T09:30:00"}

                {"symbol":"AAPL","underlying_price":221.73,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.01,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T10:30:00","gamma":0.0000,"timestamp":"2024-11-04T10:30:00"}

                {"symbol":"AAPL","underlying_price":221.49,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.01,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T11:30:00","gamma":0.0000,"timestamp":"2024-11-04T11:30:00"}

                {"symbol":"AAPL","underlying_price":221.11,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.01,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T12:30:00","gamma":0.0000,"timestamp":"2024-11-04T12:30:00"}

                {"symbol":"AAPL","underlying_price":222.03,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.01,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T13:30:00","gamma":0.0000,"timestamp":"2024-11-04T13:30:00"}'

  /option/history/trade_greeks/second_order:
    x-min-subscription: professional
    get:
      summary: Second Order Trade Greeks
      operationId: option_history_trade_greeks_second_order
      tags:
        - Option
        - History
      description: |
        - Returns the data for all contracts that share the same provided symbol and expiration.
        - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html).
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/trade_greeks/second_order?symbol=AAPL&expiration=20241108&date=20241104
          description: "Returns second order trade greeks for an option contract"
        - url: http://localhost:25503/v3/option/history/trade_greeks/second_order?symbol=AAPL&expiration=*&date=20241104
          description: "Returns second order trade greeks for an full chain of option contracts"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns second order trade greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id073
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
                    gamma:
                      type: number
                      description: The gamma.
                    vanna:
                      type: number
                      description: The vanna.
                    charm:
                      type: string
                      description: The charm.
                    vomma:
                      type: number
                      description: The vomma.
                    veta:
                      type: number
                      description: The veta.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,gamma,vanna,charm,vomma,veta,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:53:54.069,156249981,255,255,255,255,125,1,9,0.01,0.0006,0.0398,-1.0514,2.5798,0.0137,0.5749,0.0132,2024-11-04T09:53:54,221.33\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:14.764,546105677,255,255,255,255,131,2,5,81.32,0.0001,-0.0121,0.8843,0.7986,0.0063,1.5937,0.0000,2024-11-04T11:47:14,221.22\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:56.669,548097371,255,255,255,255,130,3,7,81.16,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0011,2024-11-04T11:47:56,221.18\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:03.852,548397162,255,255,255,255,130,3,6,81.26,0.0001,-0.0122,0.8879,0.8011,0.0064,1.5937,0.0000,2024-11-04T11:48:03,221.16\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:51.11,550463381,255,255,255,255,131,1,5,81.27,0.0000,-0.0051,0.3271,0.3817,0.0025,1.3968,0.0000,2024-11-04T11:48:51,221.19\r\
                \n"
            application/json:
              schema: &id074
                type: array
                items: *id073
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                underlying_price:
                - 221.33
                - 221.22
                - 221.18
                - 221.16
                - 221.19
                strike:
                - 262.5
                - 140.0
                - 140.0
                - 140.0
                - 140.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                veta:
                - 0.0137
                - 0.0063
                - 0.0
                - 0.0064
                - 0.0025
                implied_vol:
                - 0.5749
                - 1.5937
                - 0.0
                - 1.5937
                - 1.3968
                iv_error:
                - 0.0132
                - 0.0
                - 0.0011
                - 0.0
                - 0.0
                sequence:
                - 156249981
                - 546105677
                - 548097371
                - 548397162
                - 550463381
                condition:
                - 125
                - 131
                - 130
                - 130
                - 131
                size:
                - 1
                - 2
                - 3
                - 3
                - 1
                charm:
                - -1.0514
                - 0.8843
                - 0.0
                - 0.8879
                - 0.3271
                price:
                - 0.01
                - 81.32
                - 81.16
                - 81.26
                - 81.27
                ext_condition2:
                - 255
                - 255
                - 255
                - 255
                - 255
                ext_condition1:
                - 255
                - 255
                - 255
                - 255
                - 255
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                ext_condition4:
                - 255
                - 255
                - 255
                - 255
                - 255
                exchange:
                - 9
                - 5
                - 7
                - 6
                - 5
                vanna:
                - 0.0398
                - -0.0121
                - 0.0
                - -0.0122
                - -0.0051
                vomma:
                - 2.5798
                - 0.7986
                - 0.0
                - 0.8011
                - 0.3817
                ext_condition3:
                - 255
                - 255
                - 255
                - 255
                - 255
                underlying_timestamp:
                - '2024-11-04T09:53:54'
                - '2024-11-04T11:47:14'
                - '2024-11-04T11:47:56'
                - '2024-11-04T11:48:03'
                - '2024-11-04T11:48:51'
                gamma:
                - 0.0006
                - 0.0001
                - 0.0
                - 0.0001
                - 0.0
                timestamp:
                - '2024-11-04T09:53:54.069'
                - '2024-11-04T11:47:14.764'
                - '2024-11-04T11:47:56.669'
                - '2024-11-04T11:48:03.852'
                - '2024-11-04T11:48:51.11'
            application/x-ndjson:
              schema: *id074
              example: '{"symbol":"AAPL","underlying_price":221.33,"strike":262.500,"right":"CALL","veta":0.0137,"implied_vol":0.5749,"iv_error":0.0132,"sequence":156249981,"condition":125,"size":1,"charm":-1.0514,"price":0.01,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":9,"vanna":0.0398,"vomma":2.5798,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:53:54","gamma":0.0006,"timestamp":"2024-11-04T09:53:54.069"}

                {"symbol":"AAPL","underlying_price":221.22,"strike":140.000,"right":"CALL","veta":0.0063,"implied_vol":1.5937,"iv_error":0.0000,"sequence":546105677,"condition":131,"size":2,"charm":0.8843,"price":81.32,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"vanna":-0.0121,"vomma":0.7986,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:14","gamma":0.0001,"timestamp":"2024-11-04T11:47:14.764"}

                {"symbol":"AAPL","underlying_price":221.18,"strike":140.000,"right":"CALL","veta":0.0000,"implied_vol":0.0000,"iv_error":0.0011,"sequence":548097371,"condition":130,"size":3,"charm":0.0000,"price":81.16,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":7,"vanna":0.0000,"vomma":0.0000,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:56","gamma":0.0000,"timestamp":"2024-11-04T11:47:56.669"}

                {"symbol":"AAPL","underlying_price":221.16,"strike":140.000,"right":"CALL","veta":0.0064,"implied_vol":1.5937,"iv_error":0.0000,"sequence":548397162,"condition":130,"size":3,"charm":0.8879,"price":81.26,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"vanna":-0.0122,"vomma":0.8011,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:03","gamma":0.0001,"timestamp":"2024-11-04T11:48:03.852"}

                {"symbol":"AAPL","underlying_price":221.19,"strike":140.000,"right":"CALL","veta":0.0025,"implied_vol":1.3968,"iv_error":0.0000,"sequence":550463381,"condition":131,"size":1,"charm":0.3271,"price":81.27,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"vanna":-0.0051,"vomma":0.3817,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:51","gamma":0.0000,"timestamp":"2024-11-04T11:48:51.11"}'

  /option/history/greeks/third_order:
    x-min-subscription: professional
    get:
      summary: Third Order Greeks
      operationId: option_history_greeks_third_order
      tags:
        - Option
        - History
      description: |
        - Returns the data for all contracts that share the same provided symbol and expiration. 
        - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. 
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/greeks/third_order?symbol=AAPL&expiration=20241108&date=20241104&interval=1h
          description: "Returns third order greeks for an option contract"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration_no_star"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns third order greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id075
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    speed:
                      type: number
                      description: The speed.
                    zomma:
                      type: number
                      description: The zomma.
                    color:
                      type: number
                      description: The color.
                    ultima:
                      type: number
                      description: The ultima.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,ask,speed,zomma,color,ultima,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:30:00,0.00,0.00,0.0000,0.0000,0.0000,0.0001,0.2500,100.0000,2024-11-04T09:30:00,221.00\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T10:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0002,0.2500,100.0000,2024-11-04T10:30:00,221.73\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T11:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0002,0.2500,100.0000,2024-11-04T11:30:00,221.49\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T12:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0001,0.2500,100.0000,2024-11-04T12:30:00,221.11\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T13:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0003,0.2500,100.0000,2024-11-04T13:30:00,222.03\r\
                \n"
            application/json:
              schema: &id076
                type: array
                items: *id075
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                underlying_price:
                - 221.0
                - 221.73
                - 221.49
                - 221.11
                - 222.03
                color:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                strike:
                - 262.5
                - 262.5
                - 262.5
                - 262.5
                - 262.5
                zomma:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                implied_vol:
                - 0.25
                - 0.25
                - 0.25
                - 0.25
                - 0.25
                iv_error:
                - 100.0
                - 100.0
                - 100.0
                - 100.0
                - 100.0
                speed:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                ultima:
                - 0.0001
                - 0.0002
                - 0.0002
                - 0.0001
                - 0.0003
                ask:
                - 0.0
                - 0.01
                - 0.01
                - 0.01
                - 0.01
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                bid:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                underlying_timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T10:30:00'
                - '2024-11-04T11:30:00'
                - '2024-11-04T12:30:00'
                - '2024-11-04T13:30:00'
                timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T10:30:00'
                - '2024-11-04T11:30:00'
                - '2024-11-04T12:30:00'
                - '2024-11-04T13:30:00'
            application/x-ndjson:
              schema: *id076
              example: '{"symbol":"AAPL","underlying_price":221.00,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0001,"ask":0.00,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:30:00","timestamp":"2024-11-04T09:30:00"}

                {"symbol":"AAPL","underlying_price":221.73,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0002,"ask":0.01,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T10:30:00","timestamp":"2024-11-04T10:30:00"}

                {"symbol":"AAPL","underlying_price":221.49,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0002,"ask":0.01,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T11:30:00","timestamp":"2024-11-04T11:30:00"}

                {"symbol":"AAPL","underlying_price":221.11,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0001,"ask":0.01,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T12:30:00","timestamp":"2024-11-04T12:30:00"}

                {"symbol":"AAPL","underlying_price":222.03,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0003,"ask":0.01,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T13:30:00","timestamp":"2024-11-04T13:30:00"}'

  /option/history/trade_greeks/third_order:
    x-min-subscription: professional
    get:
      summary: Third Order Trade Greeks
      operationId: option_history_trade_greeks_third_order
      tags:
        - Option
        - History
      description: |
        - Returns the data for all contracts that share the same provided symbol and expiration.
        - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html).
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/trade_greeks/third_order?symbol=AAPL&expiration=20241108&date=20241104
          description: "Returns third order trade greeks for an option contract"
        - url: http://localhost:25503/v3/option/history/trade_greeks/third_order?symbol=AAPL&expiration=*&date=20241104
          description: "Returns third order trade greeks for an full chain of option contracts"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns third order trade greeks for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id077
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
                    speed:
                      type: number
                      description: The speed.
                    zomma:
                      type: number
                      description: The zomma.
                    color:
                      type: string
                      description: The color.
                    ultima:
                      type: number
                      description: The ultima.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,speed,zomma,color,ultima,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:53:54.069,156249981,255,255,255,255,125,1,9,0.01,0.0000,0.0000,-0.0005,22.3494,0.5749,0.0132,2024-11-04T09:53:54,221.33\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:14.764,546105677,255,255,255,255,131,2,5,81.32,0.0000,0.0000,-0.0013,2.2683,1.5937,0.0000,2024-11-04T11:47:14,221.22\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:56.669,548097371,255,255,255,255,130,3,7,81.16,0.0000,0.0000,0.0000,0.0000,0.0000,0.0011,2024-11-04T11:47:56,221.18\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:03.852,548397162,255,255,255,255,130,3,6,81.26,0.0000,0.0000,-0.0013,2.2709,1.5937,0.0000,2024-11-04T11:48:03,221.16\r\
                \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:51.11,550463381,255,255,255,255,131,1,5,81.27,0.0000,0.0000,-0.0003,1.8578,1.3968,0.0000,2024-11-04T11:48:51,221.19\r\
                \n"
            application/json:
              schema: &id078
                type: array
                items: *id077
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                underlying_price:
                - 221.33
                - 221.22
                - 221.18
                - 221.16
                - 221.19
                color:
                - -0.0005
                - -0.0013
                - 0.0
                - -0.0013
                - -0.0003
                strike:
                - 262.5
                - 140.0
                - 140.0
                - 140.0
                - 140.0
                zomma:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                implied_vol:
                - 0.5749
                - 1.5937
                - 0.0
                - 1.5937
                - 1.3968
                iv_error:
                - 0.0132
                - 0.0
                - 0.0011
                - 0.0
                - 0.0
                speed:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                ultima:
                - 22.3494
                - 2.2683
                - 0.0
                - 2.2709
                - 1.8578
                sequence:
                - 156249981
                - 546105677
                - 548097371
                - 548397162
                - 550463381
                condition:
                - 125
                - 131
                - 130
                - 130
                - 131
                size:
                - 1
                - 2
                - 3
                - 3
                - 1
                price:
                - 0.01
                - 81.32
                - 81.16
                - 81.26
                - 81.27
                ext_condition2:
                - 255
                - 255
                - 255
                - 255
                - 255
                ext_condition1:
                - 255
                - 255
                - 255
                - 255
                - 255
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                ext_condition4:
                - 255
                - 255
                - 255
                - 255
                - 255
                exchange:
                - 9
                - 5
                - 7
                - 6
                - 5
                ext_condition3:
                - 255
                - 255
                - 255
                - 255
                - 255
                underlying_timestamp:
                - '2024-11-04T09:53:54'
                - '2024-11-04T11:47:14'
                - '2024-11-04T11:47:56'
                - '2024-11-04T11:48:03'
                - '2024-11-04T11:48:51'
                timestamp:
                - '2024-11-04T09:53:54.069'
                - '2024-11-04T11:47:14.764'
                - '2024-11-04T11:47:56.669'
                - '2024-11-04T11:48:03.852'
                - '2024-11-04T11:48:51.11'
            application/x-ndjson:
              schema: *id078
              example: '{"symbol":"AAPL","underlying_price":221.33,"color":-0.0005,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.5749,"iv_error":0.0132,"speed":0.0000,"ultima":22.3494,"sequence":156249981,"condition":125,"size":1,"price":0.01,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":9,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:53:54","timestamp":"2024-11-04T09:53:54.069"}

                {"symbol":"AAPL","underlying_price":221.22,"color":-0.0013,"strike":140.000,"zomma":0.0000,"right":"CALL","implied_vol":1.5937,"iv_error":0.0000,"speed":0.0000,"ultima":2.2683,"sequence":546105677,"condition":131,"size":2,"price":81.32,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:14","timestamp":"2024-11-04T11:47:14.764"}

                {"symbol":"AAPL","underlying_price":221.18,"color":0.0000,"strike":140.000,"zomma":0.0000,"right":"CALL","implied_vol":0.0000,"iv_error":0.0011,"speed":0.0000,"ultima":0.0000,"sequence":548097371,"condition":130,"size":3,"price":81.16,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":7,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:56","timestamp":"2024-11-04T11:47:56.669"}

                {"symbol":"AAPL","underlying_price":221.16,"color":-0.0013,"strike":140.000,"zomma":0.0000,"right":"CALL","implied_vol":1.5937,"iv_error":0.0000,"speed":0.0000,"ultima":2.2709,"sequence":548397162,"condition":130,"size":3,"price":81.26,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:03","timestamp":"2024-11-04T11:48:03.852"}

                {"symbol":"AAPL","underlying_price":221.19,"color":-0.0003,"strike":140.000,"zomma":0.0000,"right":"CALL","implied_vol":1.3968,"iv_error":0.0000,"speed":0.0000,"ultima":1.8578,"sequence":550463381,"condition":131,"size":1,"price":81.27,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:51","timestamp":"2024-11-04T11:48:51.11"}'

  /option/history/greeks/implied_volatility:
    x-min-subscription: standard
    get:
      summary: Implied Volatility
      operationId: option_history_greeks_implied_volatility
      tags:
        - Option
        - History
      description: |
        - Returns implied volatilies calculated using the national best bid, mid, and ask price of the option respectively. 
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/greeks/implied_volatility?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104&interval=5m
          description: "Returns 5m interval implied volatility for an option contract"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration_no_star"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns 5m interval implied volatility for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id079
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the bid price.
                    midpoint:
                      type: number
                      description: The midpoint calculated by averaging the bid & ask prices.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the ask price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,bid,bid_implied_vol,midpoint,implied_vol,ask,ask_implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00,0.00,0.0000,0.00,0.0000,0.00,0.0000,100.0000,2024-11-04T09:30:00,221.00\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:35:00,3.75,0.3640,3.80,0.3693,3.85,0.3747,0.0000,2024-11-04T09:35:00,220.66\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:40:00,3.70,0.3643,3.75,0.3698,3.80,0.3752,0.0000,2024-11-04T09:40:00,220.56\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:45:00,3.75,0.3518,3.80,0.3574,3.85,0.3627,0.0000,2024-11-04T09:45:00,220.86\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:50:00,3.85,0.3417,3.90,0.3474,3.95,0.3527,0.0000,2024-11-04T09:50:00,221.20\r\
                \n"
            application/json:
              schema: &id080
                type: array
                items: *id079
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                underlying_price:
                - 221.0
                - 220.66
                - 220.56
                - 220.86
                - 221.2
                strike:
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                implied_vol:
                - 0.0
                - 0.3693
                - 0.3698
                - 0.3574
                - 0.3474
                iv_error:
                - 100.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                bid_implied_vol:
                - 0.0
                - 0.364
                - 0.3643
                - 0.3518
                - 0.3417
                ask:
                - 0.0
                - 3.85
                - 3.8
                - 3.85
                - 3.95
                midpoint:
                - 0.0
                - 3.8
                - 3.75
                - 3.8
                - 3.9
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                ask_implied_vol:
                - 0.0
                - 0.3747
                - 0.3752
                - 0.3627
                - 0.3527
                bid:
                - 0.0
                - 3.75
                - 3.7
                - 3.75
                - 3.85
                underlying_timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:35:00'
                - '2024-11-04T09:40:00'
                - '2024-11-04T09:45:00'
                - '2024-11-04T09:50:00'
                timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:35:00'
                - '2024-11-04T09:40:00'
                - '2024-11-04T09:45:00'
                - '2024-11-04T09:50:00'
            application/x-ndjson:
              schema: *id080
              example: '{"symbol":"AAPL","underlying_price":221.00,"strike":220.000,"right":"CALL","implied_vol":0.0000,"iv_error":100.0000,"bid_implied_vol":0.0000,"ask":0.00,"midpoint":0.00,"expiration":"2024-11-08","ask_implied_vol":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T09:30:00","timestamp":"2024-11-04T09:30:00"}

                {"symbol":"AAPL","underlying_price":220.66,"strike":220.000,"right":"CALL","implied_vol":0.3693,"iv_error":0.0000,"bid_implied_vol":0.3640,"ask":3.85,"midpoint":3.80,"expiration":"2024-11-08","ask_implied_vol":0.3747,"bid":3.75,"underlying_timestamp":"2024-11-04T09:35:00","timestamp":"2024-11-04T09:35:00"}

                {"symbol":"AAPL","underlying_price":220.56,"strike":220.000,"right":"CALL","implied_vol":0.3698,"iv_error":0.0000,"bid_implied_vol":0.3643,"ask":3.80,"midpoint":3.75,"expiration":"2024-11-08","ask_implied_vol":0.3752,"bid":3.70,"underlying_timestamp":"2024-11-04T09:40:00","timestamp":"2024-11-04T09:40:00"}

                {"symbol":"AAPL","underlying_price":220.86,"strike":220.000,"right":"CALL","implied_vol":0.3574,"iv_error":0.0000,"bid_implied_vol":0.3518,"ask":3.85,"midpoint":3.80,"expiration":"2024-11-08","ask_implied_vol":0.3627,"bid":3.75,"underlying_timestamp":"2024-11-04T09:45:00","timestamp":"2024-11-04T09:45:00"}

                {"symbol":"AAPL","underlying_price":221.20,"strike":220.000,"right":"CALL","implied_vol":0.3474,"iv_error":0.0000,"bid_implied_vol":0.3417,"ask":3.95,"midpoint":3.90,"expiration":"2024-11-08","ask_implied_vol":0.3527,"bid":3.85,"underlying_timestamp":"2024-11-04T09:50:00","timestamp":"2024-11-04T09:50:00"}'

  /option/history/trade_greeks/implied_volatility:
    x-min-subscription: professional
    get:
      summary: Trade Implied Volatility
      operationId: option_history_trade_greeks_implied_volatility
      tags:
        - Option
        - History
      description: |
        - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). 
        - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html).
      x-sample-urls:
        - url: http://localhost:25503/v3/option/history/trade_greeks/implied_volatility?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104
          description: "Returns implied volatility for an option contract"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/annual_dividend"
        - $ref: "#/components/parameters/rate_type"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns implied volatility for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id081
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
                    implied_vol:
                      type: number
                      description: The implied volatiltiy calculated using the trade price.
                    iv_error:
                      type: number
                      description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the
                        actual value reported in the quote. This value will increase as the strike price recedes from the
                        underlying price.'
                    underlying_timestamp:
                      type: string
                      format: date-time
                      description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    underlying_price:
                      type: number
                      description: The midpoint of the underlying at the time of the option trade.
              example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,implied_vol,iv_error,underlying_timestamp,underlying_price\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,18902138,255,255,255,255,130,2,22,3.90,0.3598,0.0002,2024-11-04T09:30:00,221.00\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.626,19368856,255,255,255,255,130,1,6,4.25,0.3876,0.0000,2024-11-04T09:30:01,221.17\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.698,19403970,255,255,255,255,130,1,6,4.22,0.3842,-0.0002,2024-11-04T09:30:01,221.17\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,19598457,255,255,255,255,18,1,5,4.15,0.3640,-0.0001,2024-11-04T09:30:02,221.37\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,19598464,255,255,255,255,18,1,5,4.15,0.3640,-0.0001,2024-11-04T09:30:02,221.37\r\
                \n"
            application/json:
              schema: &id082
                type: array
                items: *id081
              example:
                symbol:
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                - AAPL
                underlying_price:
                - 221.0
                - 221.17
                - 221.17
                - 221.37
                - 221.37
                strike:
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                - 220.0
                right:
                - CALL
                - CALL
                - CALL
                - CALL
                - CALL
                implied_vol:
                - 0.3598
                - 0.3876
                - 0.3842
                - 0.364
                - 0.364
                iv_error:
                - 0.0002
                - 0.0
                - -0.0002
                - -0.0001
                - -0.0001
                sequence:
                - 18902138
                - 19368856
                - 19403970
                - 19598457
                - 19598464
                condition:
                - 130
                - 130
                - 130
                - 18
                - 18
                size:
                - 2
                - 1
                - 1
                - 1
                - 1
                price:
                - 3.9
                - 4.25
                - 4.22
                - 4.15
                - 4.15
                ext_condition2:
                - 255
                - 255
                - 255
                - 255
                - 255
                ext_condition1:
                - 255
                - 255
                - 255
                - 255
                - 255
                expiration:
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                - '2024-11-08'
                ext_condition4:
                - 255
                - 255
                - 255
                - 255
                - 255
                exchange:
                - 22
                - 6
                - 6
                - 5
                - 5
                ext_condition3:
                - 255
                - 255
                - 255
                - 255
                - 255
                underlying_timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:30:01'
                - '2024-11-04T09:30:01'
                - '2024-11-04T09:30:02'
                - '2024-11-04T09:30:02'
                timestamp:
                - '2024-11-04T09:30:00.471'
                - '2024-11-04T09:30:01.626'
                - '2024-11-04T09:30:01.698'
                - '2024-11-04T09:30:02.064'
                - '2024-11-04T09:30:02.064'
            application/x-ndjson:
              schema: *id082
              example: '{"symbol":"AAPL","underlying_price":221.00,"strike":220.000,"right":"CALL","implied_vol":0.3598,"iv_error":0.0002,"sequence":18902138,"condition":130,"size":2,"price":3.90,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:00","timestamp":"2024-11-04T09:30:00.471"}

                {"symbol":"AAPL","underlying_price":221.17,"strike":220.000,"right":"CALL","implied_vol":0.3876,"iv_error":0.0000,"sequence":19368856,"condition":130,"size":1,"price":4.25,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:01","timestamp":"2024-11-04T09:30:01.626"}

                {"symbol":"AAPL","underlying_price":221.17,"strike":220.000,"right":"CALL","implied_vol":0.3842,"iv_error":-0.0002,"sequence":19403970,"condition":130,"size":1,"price":4.22,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:01","timestamp":"2024-11-04T09:30:01.698"}

                {"symbol":"AAPL","underlying_price":221.37,"strike":220.000,"right":"CALL","implied_vol":0.3640,"iv_error":-0.0001,"sequence":19598457,"condition":18,"size":1,"price":4.15,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:02","timestamp":"2024-11-04T09:30:02.064"}

                {"symbol":"AAPL","underlying_price":221.37,"strike":220.000,"right":"CALL","implied_vol":0.3640,"iv_error":-0.0001,"sequence":19598464,"condition":18,"size":1,"price":4.15,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:02","timestamp":"2024-11-04T09:30:02.064"}'

  /option/at_time/trade:
    x-min-subscription: standard
    get:
      summary: Trade
      operationId: option_at_time_trade
      tags:
        - Option
        - At-Time
      description: |
        - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a specified millisecond of the day.
        - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
        - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) for options, so they can be ignored.
        - The ``time_of_day``parameter represents the 00:00:00.000 ET that the trade should be provided for.
      x-sample-urls:
        - url: http://localhost:25503/v3/option/at_time/trade?symbol=AAPL&expiration=20241108&strike=220.000&right=call&start_date=20241104&end_date=20241104&time_of_day=09:30:01.000
          description: "Returns the last trade for an option contract"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/time_of_day"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns the last trade for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id083
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
              example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,18902138,255,255,255,255,130,2,22,3.90\r\n"
            application/json:
              schema: &id084
                type: array
                items: *id083
              example:
                symbol:
                - AAPL
                strike:
                - 220.0
                right:
                - CALL
                sequence:
                - 18902138
                condition:
                - 130
                size:
                - 2
                price:
                - 3.9
                ext_condition2:
                - 255
                ext_condition1:
                - 255
                expiration:
                - '2024-11-08'
                ext_condition4:
                - 255
                exchange:
                - 22
                ext_condition3:
                - 255
                timestamp:
                - '2024-11-04T09:30:00.471'
            application/x-ndjson:
              schema: *id084
              example: '{"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":18902138,"condition":130,"size":2,"price":3.90,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"timestamp":"2024-11-04T09:30:00.471"}'

  /option/at_time/quote:
    x-min-subscription: value
    get:
      summary: Quote
      operationId: option_at_time_quote
      tags:
        - Option
        - At-Time
      description: |
        - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a specified millisecond of the day.
        - The ``time_of_day``parameter represents the 00:00:00.000 ET that the quote should be provided for.
      x-sample-urls:
        - url: http://localhost:25503/v3/option/at_time/quote?symbol=AAPL&expiration=20241108&strike=220.000&right=call&start_date=20241104&end_date=20241104&time_of_day=09:30:01.000
          description: "Returns the last quote for an option contract"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/time_of_day"
        - $ref: "#/components/parameters/expiration"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns the last quote for an option contract
          content:
            text/csv:
              schema:
                type: array
                items: &id085
                  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.
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "symbol,expiration,strike,right,timestamp,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\
                \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.91,129,69,3.95,50,14,47,4.10,50\r\n"
            application/json:
              schema: &id086
                type: array
                items: *id085
              example:
                symbol:
                - AAPL
                ask_size:
                - 14
                ask_condition:
                - 50
                strike:
                - 220.0
                right:
                - CALL
                bid_size:
                - 129
                ask_exchange:
                - 47
                bid_exchange:
                - 69
                ask:
                - 4.1
                expiration:
                - '2024-11-08'
                bid:
                - 3.95
                bid_condition:
                - 50
                timestamp:
                - '2024-11-04T09:30:00.91'
            application/x-ndjson:
              schema: *id086
              example: '{"symbol":"AAPL","ask_size":14,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":129,"ask_exchange":47,"bid_exchange":69,"ask":4.10,"expiration":"2024-11-08","bid":3.95,"bid_condition":50,"timestamp":"2024-11-04T09:30:00.91"}'

#
# INDEX ENDPOINTS
#
  /index/list/symbols:
    x-min-subscription: free
    get:
      summary: Symbols
      operationId: index_list_symbols
      tags:
        - Index
        - List
      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://localhost:25503/v3/index/list/symbols
          description: "List all symbols for indices"
      parameters:
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: List all symbols for indices
          content:
            text/csv:
              schema:
                type: array
                items: &id087
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: The symbol of the contract, or stock / underlying asset / option / index.
              example: "symbol\r\nAASGI\r\nAASUS\r\nACNAC\r\nACNIT\r\nACNRE\r\n"
            application/json:
              schema: &id088
                type: array
                items: *id087
              example:
                symbol:
                - AASGI
                - AASUS
                - ACNAC
                - ACNIT
                - ACNRE
            application/x-ndjson:
              schema: *id088
              example: '{"symbol":"AASGI"}

                {"symbol":"AASUS"}

                {"symbol":"ACNAC"}

                {"symbol":"ACNIT"}

                {"symbol":"ACNRE"}'

  /index/list/dates:
    x-min-subscription: free
    get:
      summary: Dates
      operationId: index_list_dates
      tags:
        - Index
        - List
      description: |
        Lists all dates of data that are available for a index with a given request type and symbol. This endpoint is updated overnight.
      x-sample-urls:
        - url: http://localhost:25503/v3/index/list/dates?symbol=SPX
          description: "List all dates for a index for a given symbol"
      parameters:
        - $ref: "#/components/parameters/multi_symbol"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: List all dates for a index for a given symbol
          content:
            text/csv:
              schema:
                type: array
                items: &id089
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: The symbol of the contract, or stock / underlying asset / option / index.
                    date:
                      type: string
                      format: date
                      description: The date formated as YYYY-MM-DD.
              example: "symbol,date\r\nSPX,2023-04-20\r\nSPX,2023-04-21\r\nSPX,2023-04-17\r\nSPX,2023-04-18\r\nSPX,2023-04-19\r\
                \n"
            application/json:
              schema: &id090
                type: array
                items: *id089
              example:
                date:
                - '2023-04-20'
                - '2023-04-21'
                - '2023-04-17'
                - '2023-04-18'
                - '2023-04-19'
                symbol:
                - SPX
                - SPX
                - SPX
                - SPX
                - SPX
            application/x-ndjson:
              schema: *id090
              example: '{"date":"2023-04-20","symbol":"SPX"}

                {"date":"2023-04-21","symbol":"SPX"}

                {"date":"2023-04-17","symbol":"SPX"}

                {"date":"2023-04-18","symbol":"SPX"}

                {"date":"2023-04-19","symbol":"SPX"}'

  /index/snapshot/ohlc:
    x-min-subscription: standard
    get:
      summary: Open High Low Close
      operationId: index_snapshot_ohlc
      tags:
        - Index
        - Snapshot
      description: |
        - Retrieves the real-time current day OHLC.
        - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX.
      x-sample-urls:
        - url: http://localhost:25503/v3/index/snapshot/ohlc?symbol=SPX
          description: "Returns OHLC for a given index price change"
      parameters:
        - $ref: "#/components/parameters/multi_symbol"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns OHLC for a given index price change
          content:
            text/csv:
              schema:
                type: array
                items: &id091
                  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.
                    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,open,high,low,close,volume,count\r\n2025-08-20T16:02:06,SPX,6406.62,6408.40,6343.86,6395.78,0,0\r\
                \n"
            application/json:
              schema: &id092
                type: array
                items: *id091
              example:
                volume:
                - 0
                symbol:
                - SPX
                high:
                - 6408.4
                low:
                - 6343.86
                count:
                - 0
                close:
                - 6395.78
                open:
                - 6406.62
                timestamp:
                - '2025-08-20T16:02:06'
            application/x-ndjson:
              schema: *id092
              example: '{"volume":0,"symbol":"SPX","high":6408.40,"low":6343.86,"count":0,"close":6395.78,"open":6406.62,"timestamp":"2025-08-20T16:02:06"}'

  /index/snapshot/price:
    x-min-subscription: standard
    get:
      summary: Price
      operationId: index_snapshot_price
      tags:
        - Index
        - Snapshot
      description: |
        - Retrieves a real-time last index price.
        - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX.
      x-sample-urls:
        - url: http://localhost:25503/v3/index/snapshot/price?symbol=SPX
          description: "Returns last index price"
      parameters:
        - $ref: "#/components/parameters/multi_symbol"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns last index price
          content:
            text/csv:
              schema:
                type: array
                items: &id093
                  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.
                    price:
                      type: number
                      description: The trade price.
              example: "timestamp,symbol,price\r\n2025-08-20T16:02:06,SPX,6395.78\r\n"
            application/json:
              schema: &id094
                type: array
                items: *id093
              example:
                symbol:
                - SPX
                price:
                - 6395.78
                timestamp:
                - '2025-08-20T16:02:06'
            application/x-ndjson:
              schema: *id094
              example: '{"symbol":"SPX","price":6395.78,"timestamp":"2025-08-20T16:02:06"}'

  /index/history/eod:
    x-min-subscription: free
    get:
      summary: End of Day
      operationId: index_history_eod
      tags:
        - Index
        - History
      description: |
        - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD report, Theta Data generates a national EOD report at 17:15 each day.
      x-sample-urls:
        - url: http://localhost:25503/v3/index/history/eod?symbol=SPX&start_date=20241104&end_date=20241108
          description: "Returns EOD report for a given symbol between specified dates (inclusive)"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns EOD report for a given symbol between specified dates (inclusive)
          content:
            text/csv:
              schema:
                type: array
                items: &id095
                  type: object
                  properties:
                    created:
                      type: string
                      format: date-time
                      description: The date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    last_trade:
                      type: string
                      format: date-time
                      description: The last trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format.
                    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.
                    bid_size:
                      type: integer
                      description: The last NBBO bid size.
                    bid_exchange:
                      type: integer
                      description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    bid:
                      type: number
                      description: The last NBBO bid price.
                    bid_condition:
                      type: integer
                      description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
                    ask_size:
                      type: integer
                      description: The last NBBO ask size.
                    ask_exchange:
                      type: integer
                      description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html).
                    ask:
                      type: number
                      description: The last NBBO ask price.
                    ask_condition:
                      type: integer
                      description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html).
              example: "created,last_trade,open,high,low,close,volume,count,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\
                \n2024-11-04T17:19:50.198,2024-11-04T16:03:03,5725.15,5741.43,5696.51,5712.69,0,0,0,0,0.00,0,0,0,0.00,0\r\n\
                2024-11-05T17:15:03.061,2024-11-05T16:02:30,5722.43,5783.44,5722.10,5782.76,0,0,0,0,0.00,0,0,0,0.00,0\r\n\
                2024-11-06T17:16:28.297,2024-11-06T16:01:37,5864.89,5936.14,5864.89,5929.04,0,0,0,0,0.00,0,0,0,0.00,0\r\n\
                2024-11-07T17:17:17.218,2024-11-07T16:02:49,5947.21,5983.84,5947.21,5973.10,0,0,0,0,0.00,0,0,0,0.00,0\r\n\
                2024-11-08T17:21:08.187,2024-11-08T16:01:15,5976.76,6012.45,5976.76,5995.54,0,0,0,0,0.00,0,0,0,0.00,0\r\n"
            application/json:
              schema: &id096
                type: array
                items: *id095
              example:
                ask_size:
                - 0
                - 0
                - 0
                - 0
                - 0
                last_trade:
                - '2024-11-04T16:03:03'
                - '2024-11-05T16:02:30'
                - '2024-11-06T16:01:37'
                - '2024-11-07T16:02:49'
                - '2024-11-08T16:01:15'
                created:
                - '2024-11-04T17:19:50.198'
                - '2024-11-05T17:15:03.061'
                - '2024-11-06T17:16:28.297'
                - '2024-11-07T17:17:17.218'
                - '2024-11-08T17:21:08.187'
                ask_condition:
                - 0
                - 0
                - 0
                - 0
                - 0
                count:
                - 0
                - 0
                - 0
                - 0
                - 0
                volume:
                - 0
                - 0
                - 0
                - 0
                - 0
                high:
                - 5741.43
                - 5783.44
                - 5936.14
                - 5983.84
                - 6012.45
                low:
                - 5696.51
                - 5722.1
                - 5864.89
                - 5947.21
                - 5976.76
                bid_size:
                - 0
                - 0
                - 0
                - 0
                - 0
                ask_exchange:
                - 0
                - 0
                - 0
                - 0
                - 0
                bid_exchange:
                - 0
                - 0
                - 0
                - 0
                - 0
                ask:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                bid:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                bid_condition:
                - 0
                - 0
                - 0
                - 0
                - 0
                close:
                - 5712.69
                - 5782.76
                - 5929.04
                - 5973.1
                - 5995.54
                open:
                - 5725.15
                - 5722.43
                - 5864.89
                - 5947.21
                - 5976.76
            application/x-ndjson:
              schema: *id096
              example: '{"ask_size":0,"last_trade":"2024-11-04T16:03:03","created":"2024-11-04T17:19:50.198","ask_condition":0,"count":0,"volume":0,"high":5741.43,"low":5696.51,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5712.69,"open":5725.15}

                {"ask_size":0,"last_trade":"2024-11-05T16:02:30","created":"2024-11-05T17:15:03.061","ask_condition":0,"count":0,"volume":0,"high":5783.44,"low":5722.10,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5782.76,"open":5722.43}

                {"ask_size":0,"last_trade":"2024-11-06T16:01:37","created":"2024-11-06T17:16:28.297","ask_condition":0,"count":0,"volume":0,"high":5936.14,"low":5864.89,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5929.04,"open":5864.89}

                {"ask_size":0,"last_trade":"2024-11-07T16:02:49","created":"2024-11-07T17:17:17.218","ask_condition":0,"count":0,"volume":0,"high":5983.84,"low":5947.21,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5973.10,"open":5947.21}

                {"ask_size":0,"last_trade":"2024-11-08T16:01:15","created":"2024-11-08T17:21:08.187","ask_condition":0,"count":0,"volume":0,"high":6012.45,"low":5976.76,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5995.54,"open":5976.76}'

  /index/history/ohlc:
    x-min-subscription: standard
    get:
      summary: Open High Low Close
      operationId: index_history_ohlc
      tags:
        - Index
        - History
      description: |
        - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar.
        - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar:  ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``.
        - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX.
      x-sample-urls:
        - url: http://localhost:25503/v3/index/history/ohlc?symbol=SPX&start_date=20241104&end_date=20241104&interval=1m
          description: "Returns OHLC for a given symbol between specified dates (inclusive) with a one minute interval"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns OHLC for a given symbol between specified dates (inclusive) with a one minute interval
          content:
            text/csv:
              schema:
                type: array
                items: &id097
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    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.
                    vwap:
                      type: number
                      description: The volume weighted average price of the given interval.
              example: "timestamp,open,high,low,close,volume,count,vwap\r\n2024-11-04T09:30:00,5725.15,5731.27,5725.15,5728.56,0,0,0.00\r\
                \n2024-11-04T09:31:00,5728.90,5730.40,5724.53,5725.42,0,0,0.00\r\n2024-11-04T09:32:00,5725.48,5729.20,5723.55,5726.54,0,0,0.00\r\
                \n2024-11-04T09:33:00,5726.57,5726.71,5723.13,5723.13,0,0,0.00\r\n2024-11-04T09:34:00,5722.88,5723.33,5717.35,5717.64,0,0,0.00\r\
                \n"
            application/json:
              schema: &id098
                type: array
                items: *id097
              example:
                volume:
                - 0
                - 0
                - 0
                - 0
                - 0
                high:
                - 5731.27
                - 5730.4
                - 5729.2
                - 5726.71
                - 5723.33
                low:
                - 5725.15
                - 5724.53
                - 5723.55
                - 5723.13
                - 5717.35
                vwap:
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                - 0.0
                count:
                - 0
                - 0
                - 0
                - 0
                - 0
                close:
                - 5728.56
                - 5725.42
                - 5726.54
                - 5723.13
                - 5717.64
                open:
                - 5725.15
                - 5728.9
                - 5725.48
                - 5726.57
                - 5722.88
                timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:31:00'
                - '2024-11-04T09:32:00'
                - '2024-11-04T09:33:00'
                - '2024-11-04T09:34:00'
            application/x-ndjson:
              schema: *id098
              example: '{"volume":0,"high":5731.27,"low":5725.15,"vwap":0.00,"count":0,"close":5728.56,"open":5725.15,"timestamp":"2024-11-04T09:30:00"}

                {"volume":0,"high":5730.40,"low":5724.53,"vwap":0.00,"count":0,"close":5725.42,"open":5728.90,"timestamp":"2024-11-04T09:31:00"}

                {"volume":0,"high":5729.20,"low":5723.55,"vwap":0.00,"count":0,"close":5726.54,"open":5725.48,"timestamp":"2024-11-04T09:32:00"}

                {"volume":0,"high":5726.71,"low":5723.13,"vwap":0.00,"count":0,"close":5723.13,"open":5726.57,"timestamp":"2024-11-04T09:33:00"}

                {"volume":0,"high":5723.33,"low":5717.35,"vwap":0.00,"count":0,"close":5717.64,"open":5722.88,"timestamp":"2024-11-04T09:34:00"}'

  /index/history/price:
    x-min-subscription: value
    get:
      summary: Price
      operationId: index_history_price
      tags:
        - Index
        - History
      description: |
        - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX.
        - When the ``interval`` parameter is specified, the returned data represents the price at the exact time of each timestamp. If the timestamp in the response is 10:30:00, the price field represents the price at that exact time of the day.
        - A price update from the exchange is omitted if the price remained the same from the previous update.
      x-sample-urls:
        - url: http://localhost:25503/v3/index/history/price?symbol=SPX&date=20241104&interval=1m
          description: "Returns historical index price reports"
      parameters:
        - $ref: "#/components/parameters/date"
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/interval"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns historical index price reports
          content:
            text/csv:
              schema:
                type: array
                items: &id099
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    price:
                      type: number
                      description: The trade price.
              example: "timestamp,price\r\n2024-11-04T09:30:00,0.0\r\n2024-11-04T09:31:00,5728.56\r\n2024-11-04T09:32:00,5725.48\r\
                \n2024-11-04T09:33:00,5726.57\r\n2024-11-04T09:34:00,5722.88\r\n"
            application/json:
              schema: &id100
                type: array
                items: *id099
              example:
                price:
                - 0.0
                - 5728.56
                - 5725.48
                - 5726.57
                - 5722.88
                timestamp:
                - '2024-11-04T09:30:00'
                - '2024-11-04T09:31:00'
                - '2024-11-04T09:32:00'
                - '2024-11-04T09:33:00'
                - '2024-11-04T09:34:00'
            application/x-ndjson:
              schema: *id100
              example: '{"price":0.0,"timestamp":"2024-11-04T09:30:00"}

                {"price":5728.56,"timestamp":"2024-11-04T09:31:00"}

                {"price":5725.48,"timestamp":"2024-11-04T09:32:00"}

                {"price":5726.57,"timestamp":"2024-11-04T09:33:00"}

                {"price":5722.88,"timestamp":"2024-11-04T09:34:00"}'

  /index/at_time/price:
    x-min-subscription: value
    get:
      summary: Price
      operationId: index_at_time_price
      tags:
        - Index
        - At-Time
      description: |
        - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX.
        - The ``time_of_day`` parameter represents the 00:00:00.000 ET that the price should be provided for.
      x-sample-urls:
        - url: http://localhost:25503/v3/index/at_time/price?symbol=SPX&start_date=20241104&end_date=20241108&time_of_day=09:30:01.000
          description: "Returns specific at time historical index price reports"
      parameters:
        - $ref: "#/components/parameters/single_symbol"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/time_of_day"
        - $ref: "#/components/parameters/format"
      responses:
        '200':
          description: Returns specific at time historical index price reports
          content:
            text/csv:
              schema:
                type: array
                items: &id101
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format.
                    sequence:
                      type: integer
                      description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                    ext_condition1:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition2:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition3:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    ext_condition4:
                      type: integer
                      description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s).
                        These can be ignored for options.
                    condition:
                      type: integer
                      description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html).
                    size:
                      type: integer
                      description: The amount of contracts / shares traded.
                    exchange:
                      type: integer
                      description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed.
                    price:
                      type: number
                      description: The trade price.
              example: "timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\
                \n2024-11-04T09:30:01,0,255,255,255,255,0,0,5,5725.15\r\n2024-11-05T09:30:01,0,255,255,255,255,0,0,5,5722.43\r\
                \n2024-11-06T09:30:01,0,255,255,255,255,0,0,5,5864.89\r\n2024-11-07T09:30:01,0,255,255,255,255,0,0,5,5947.21\r\
                \n2024-11-08T09:30:01,0,255,255,255,255,0,0,5,5976.76\r\n"
            application/json:
              schema: &id102
                type: array
                items: *id101
              example:
                sequence:
                - 0
                - 0
                - 0
                - 0
                - 0
                condition:
                - 0
                - 0
                - 0
                - 0
                - 0
                size:
                - 0
                - 0
                - 0
                - 0
                - 0
                price:
                - 5725.15
                - 5722.43
                - 5864.89
                - 5947.21
                - 5976.76
                ext_condition2:
                - 255
                - 255
                - 255
                - 255
                - 255
                ext_condition1:
                - 255
                - 255
                - 255
                - 255
                - 255
                ext_condition4:
                - 255
                - 255
                - 255
                - 255
                - 255
                exchange:
                - 5
                - 5
                - 5
                - 5
                - 5
                ext_condition3:
                - 255
                - 255
                - 255
                - 255
                - 255
                timestamp:
                - '2024-11-04T09:30:01'
                - '2024-11-05T09:30:01'
                - '2024-11-06T09:30:01'
                - '2024-11-07T09:30:01'
                - '2024-11-08T09:30:01'
            application/x-ndjson:
              schema: *id102
              example: '{"sequence":0,"condition":0,"size":0,"price":5725.15,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-04T09:30:01"}

                {"sequence":0,"condition":0,"size":0,"price":5722.43,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-05T09:30:01"}

                {"sequence":0,"condition":0,"size":0,"price":5864.89,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-06T09:30:01"}

                {"sequence":0,"condition":0,"size":0,"price":5947.21,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-07T09:30:01"}

                {"sequence":0,"condition":0,"size":0,"price":5976.76,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-08T09:30:01"}'


components:
  parameters:
    # required parameters
    single_symbol:
      name: symbol
      in: query
      description: The stock or index symbol, or underlying symbol for options.
      required: true
      schema:
        type: string

    multi_symbol:
      name: symbol
      in: query
      description: The stock or index symbol, or underlying symbol for options. Specify '*' for all symbols or a comma separated list when appropriate.
      required: true
      schema:
        type: array
        items:
          type: string

    opt_multi_symbol:
      name: symbol
      in: query
      description: The stock or index symbol, or underlying symbol for options.
      required: false
      schema:
        type: array
        items:
          type: string

    date:
      name: date
      in: query
      description: The date to fetch data for.
      required: true
      schema:
        type: string
        format: date

    end_date:
      name: end_date
      in: query
      description: The end date (inclusive).
      required: true
      schema:
        type: string
        format: date

    start_date:
      name: start_date
      in: query
      description: The start date (inclusive).
      required: true
      schema:
        type: string
        format: date

    opt_end_date:
      name: end_date
      in: query
      description: The end date (inclusive).
      required: false
      schema:
        type: string
        format: date

    opt_start_date:
      name: start_date
      in: query
      description: The start date (inclusive).
      required: false
      schema:
        type: string
        format: date

    time_of_day:
      name: time_of_day
      in: query
      description: The time of the day to fetch data for; assumed to be America/New_York.
      required: true
      schema:
        type: string
        format: time

    expiration:
      name: expiration
      in: query
      description: The expiration of the contract in `YYYY-MM-DD` or `YYYYMMDD` format, or `*` for all expirations.
      required: true
      schema:
        type: string
        format: date

    expiration_no_star:
      name: expiration
      in: query
      description: The expiration of the contract in `YYYY-MM-DD` or `YYYYMMDD` format.
      required: true
      schema:
        type: string
        format: date

    strike:
      name: strike
      in: query
      description: The strike price of the contract in dollars (ie `100.00` for `$100.00`), or `*` for all strikes.
      required: false
      schema:
        type: string
        default: "*"

    interval:
      name: interval
      in: query
      description: The size of the time interval must be one of the available options listed below.
      required: true
      schema:
        type: string
        enum:
          - tick
          - 10ms
          - 100ms
          - 500ms
          - 1s
          - 5s
          - 10s
          - 15s
          - 30s
          - 1m
          - 5m
          - 10m
          - 15m
          - 30m
          - 1h
        default: 1s

    security_type:
      name: security_type
      in: path
      description: The security type.
      required: true
      schema:
        type: string
        enum:
          - stock
          - option
          - index

    request_type:
      name: request_type
      in: path
      description: The request type.
      required: true
      schema:
        type: string
        enum:
          - trade
          - quote


    # non-required parameters
    annual_dividend:
      name: annual_dividend
      in: query
      description: The annualized expected dividend amount to be used in Greeks calculations.
      required: false
      schema:
        type: number
        format: float

    end_time:
      name: end_time
      in: query
      description: The end time (inclusive) in the specified day.
      required: false
      schema:
        type: string
        format: time
        default: "16:00:00"

    exclusive:
      name: exclusive
      in: query
      description: If you prefer to match quotes with timestamps that are < the trade timestamp.
      required: false
      schema:
        type: boolean
        default: true

    format:
      name: format
      in: query
      description: The format of the data when returned to the user.
      required: false
      schema:
        type: string
        enum:
          - csv
          - json
          - ndjson
        default: csv

    rate_type:
      name: rate_type
      in: query
      description: The interest rate type to be used in a Greeks calculation.
      required: false
      schema:
        type: string
        enum:
          - sofr
          - treasury_m1
          - treasury_m3
          - treasury_m6
          - treasury_y1
          - treasury_y2
          - treasury_y3
          - treasury_y5
          - treasury_y7
          - treasury_y10
          - treasury_y20
          - treasury_y30
        default: sofr

    rate_value:
      name: rate_value
      in: query
      description: The interest rate, as a percent, to be used in a Greeks calculation.
      required: false
      schema:
        type: number
        format: float
      example: 5.0

    right:
      name: right
      in: query
      description: The right (call or put) of the contract.
      required: false
      schema:
        type: string
        enum:
          - call
          - put
          - both
        default: both

    start_time:
      name: start_time
      in: query
      description: The start time (inclusive) in the specified day.
      required: false
      schema:
        type: string
        format: time
        default: "09:30:00"

    stock_price:
      name: stock_price
      in: query
      description: The underlying stock price to be used in the Greeks calculation.
      required: false
      schema:
        type: number
        format: float

    venue:
      name: venue
      in: query
      description: Used to specify the venue of the real time or historic request. ``nqb`` = Nasdaq Basic; ``utp_cta`` = merged UTP & CTA.
      required: false
      schema:
        type: string
        enum:
          - nqb
          - utp_cta
        default: nqb

  responses:
    200_OK:
      description: ""
      content:
        text/csv:
          schema:
            type: string


