openapi: 3.1.0
info:
  title: 'Theta Data'
  description: 'Theta Data'
  version: 2.0.0
servers:
  - url: 'http://127.0.0.1:25510/v2'
security: []
paths:
  '/list/roots/{sec}':
    x-min-subscription: free
    get:
      summary: List Roots
      tags:
        - List
      operationId: get-v2-list-roots
      description: |
        ## Behavior
        A root can be defined as a unique identified for a stock / underlying asset.
        Common terms also include: symbol, ticker, and underlying.
        This endpoint returns all traded roots for a given security type (i.e. stock, index, or option).
        This endpoint is updated overnight.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.

        **List all roots for options**

        [http://127.0.0.1:25510/v2/list/roots/option](http://127.0.0.1:25510/v2/list/roots/option)

        **List all roots for stocks**

        [http://127.0.0.1:25510/v2/list/roots/stock](http://127.0.0.1:25510/v2/list/roots/stock)


        **List all roots for indices**

        [http://127.0.0.1:25510/v2/list/roots/index](http://127.0.0.1:25510/v2/list/roots/index)

      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                description: "The response to the request made. If there is a caught error, the error_type field won't be null."
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: An array of roots / symbols / tickers; ["root"]
                    items:
                      type: string
                    example: ["AAPL"]
      parameters:
        - $ref: '#/components/parameters/use_csv'
        - $ref: '#/components/parameters/sec'
  /list/expirations:
    x-min-subscription: free
    get:
      summary: List Expirations
      tags:
        - List
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                description: "The response to the request made. If there is a caught error, the error_type field won't be null."
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: An array of expirations formatted as YYYYMMDD; ["date"]
                    items:
                      type: integer
                    example: [20241011,20241018,]
      operationId: get-v2-list-expirations
      description: |
        ## Behavior
        Returns all expirations for an underlying root.
        This endpoint is updated overnight.
        ***Sample data contains partial output of the request as the full response to the request is too large to display on this webpage.***

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/list/expirations?root=AAPL](http://127.0.0.1:25510/v2/list/expirations?root=AAPL)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/use_csv'
  /list/strikes:
    x-min-subscription: free
    get:
      summary: List Strikes
      tags:
        - List
      operationId: get-v2-list-strikes
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                description: "The response to the request made. If there is a caught error, the error_type field won't be null."
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: 'An array of strikes that are in 1/10th of a cent. For instance, $140.00 is equivalent to 140000; ["strike"]'
                    items:
                      type: integer
                    example: [140000,142000,]
      description: |
        ## Behavior
        List all strike prices that are traded for an underlying root and expiration date. The strike price in 1/10th of a cent. A $140.00 strike price would be 140000.
        This endpoint is updated overnight.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/list/strikes?root=AAPL&exp=20220930](http://127.0.0.1:25510/v2/list/strikes?root=AAPL&exp=20220930)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/use_csv'
  '/list/dates/{sec}/{req}':
    x-min-subscription: free
    get:
      summary: List Dates
      tags:
        - List
      operationId: get-v2-list-dates
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                description: "The response to the request made. If there is a caught error, the error_type field won't be null."
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: An array of dates formatted as YYYYMMDD; ["date"]
                    items:
                      type: integer
                    example: [20241101,20241104]
      description: |
        ## Behavior
        Lists all dates of data that are available for a given security type, request type, and contract. To list all dates of data available for an option chain, simply omit the ``strike`` and ``right`` parameters and only include the ``exp`` and ``root`` parameters. Make sure you're ``sec`` is ``option``. There is data for at least one of the contracts on the chain for each day on the returned list. It does not mean that every option contract under that expiration will have data.
        This endpoint is updated overnight.
        ***Sample data contains partial output of the request as the full response to the request is too large to display on this webpage.***

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.

        **List all dates for a stock**

        [http://127.0.0.1:25510/v2/list/dates/stock/quote?root=AAPL](http://127.0.0.1:25510/v2/list/dates/stock/quote?root=AAPL)

        **List all dates for an index**

        [http://127.0.0.1:25510/v2/list/dates/index/trade?root=SPX](http://127.0.0.1:25510/v2/list/dates/index/trade?root=SPX)


        **List all dates for an option chain:**

        [http://127.0.0.1:25510/v2/list/dates/option/quote?root=AAPL&exp=20220930](http://127.0.0.1:25510/v2/list/dates/option/quote?root=AAPL&exp=20220930)


        **List all dates for an option**:

        [http://127.0.0.1:25510/v2/list/dates/option/quote?root=AAPL&exp=20220930&strike=140000&right=C](http://127.0.0.1:25510/v2/list/dates/option/quote?root=AAPL&exp=20220930&strike=140000&right=C)

      parameters:
        - $ref: '#/components/parameters/sec'
        - $ref: '#/components/parameters/req'
        - $ref: '#/components/parameters/root'
        - name: exp
          in: query
          description: (Required for options) The expiration date of the option contract formatted as YYYYMMDD.
          schema:
            type: integer
          example: 20220930
        - name: strike
          in: query
          description: (For options only) The strike price in 1/10th of a cent. A $140.00 strike price would be 140000.
          schema:
            type: integer
          example: 140000
        - name: right
          in: query
          description: (For options only) The right of the option. 'C' for call; 'P' for put.
          schema:
            type: string
            enum:
              - C
              - P
            example: C
        - $ref: '#/components/parameters/use_csv'
      requestBody:
        content: {}
  '/list/contracts/option/{req}':
    x-min-subscription: value
    get:
      summary: List Contracts
      tags:
        - List
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["root", "expiration", "strike", "right"].
                    items:
                      type: array
                      properties:
                        root:
                          type: string
                          description: The root symbol or ticker (e.g., "AAPL").
                        expiration:
                          type: integer
                          format: date
                          description: The expiration date in YYYYMMDD format.
                        strike:
                          type: integer
                          description: The strike price (scaled by 1000, e.g., `260000` represents `260.00`).
                        right:
                          type: string
                          enum:
                            - P
                            - C
                          description: The option type ("P" for Put, "C" for Call).
                    example:
                      - ["AAPL", 20230616, 260000, "P"]
                      - ["AAPL", 20230616, 260000, "C"]
      operationId: get-v2-list-contracts-option
      description: |
        ## Behavior
        Lists all contracts that were traded or quoted on a particular date.
        List Contacts is updated real-time.
        If the ``root`` parameter is specified, the returned contracts will be filtered to match the root.
        Multiple roots can be specified by separating them with commas such as ``root=AAPL,SPY,AMD``
        This endpoint is updated real-time.

        ***Sample data contains partial output of the request as the full response to the request is too large to display on this webpage.***

        ## Throttle

        ***A mandatory 500 millisecond overhead is applied to this request*** to limit bandwidth consumption. This type of request should increase your overall throughput as you will know exactly what is available for each trading day. If the 500 millisecond overhead is an issue, please contact support and they can remove it depending on the circumstances.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.

        **List all traded contracts**

        [http://127.0.0.1:25510/v2/list/contracts/option/trade?start_date=20230512](http://127.0.0.1:25510/v2/list/contracts/option/trade?start_date=20230512)


        **List all quoted contracts**

        [http://127.0.0.1:25510/v2/list/contracts/option/quote?start_date=20230512](http://127.0.0.1:25510/v2/list/contracts/option/quote?start_date=20230512)


        **List all quoted contracts with root filter**

        [http://127.0.0.1:25510/v2/list/contracts/option/quote?start_date=20230512&root=AAPL,SPY](http://127.0.0.1:25510/v2/list/contracts/option/quote?start_date=20230512&root=AAPL,SPY)


        **List all open interest contracts**

        [http://127.0.0.1:25510/v2/list/contracts/option/open_interest?start_date=20230512](http://127.0.0.1:25510/v2/list/contracts/option/open_interest?start_date=20230512)

      parameters:
        - $ref: '#/components/parameters/req'
        - $ref: '#/components/parameters/root'
        - name: start_date
          in: query
          description: The date to list all contracts for. Formatted as YYYYMMDD.
          required: true
          schema:
            type: string
            default: '20230512'
            example: '20230512'
        - $ref: '#/components/parameters/use_csv'
      requestBody:
        content: {}


  /snapshot/stock/trade:
    x-min-subscription: standard
    get:
      summary: Trade Snapshot
      tags:
        - Stocks
        - Snapshots
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [14400004,1,32,255,1,115,1,5,65,191.68,7,0,0,0,20240102]
                      - [14400004,2,32,255,1,115,1,20,65,191.68,7,0,0,0,20240102]
      operationId: get-v2-snapshot-stock-trade
      description: |
        ## Behavior

        - 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#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.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/snapshot/stock/trade?root=AAPL](http://127.0.0.1:25510/v2/snapshot/stock/trade?root=AAPL)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/venue'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
  /snapshot/stock/quote:
    x-min-subscription: value
    get:
      summary: Quote Snapshot
      tags:
        - Stocks
        - Snapshots
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day", "bid_size", "bid_exchange", "bid", "bid_condition", "ask_size", "ask_exchange", "ask", "ask_condition", "date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid_size:
                          type: integer
                          description: The last NBBO bid size.
                        bid_exchange:
                          type: integer
                          description: The last NBBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last NBBO bid price.
                        bid_condition:
                          type: integer
                          description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last NBBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask:
                          type: double
                          description: The last NBBO ask price.
                        ask_condition:
                          type: integer
                          description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [35100000,38,69,5.40,50,21,69,5.60,50,20231103]
                      - [36000000,24,60,5.35,50,31,60,5.50,50,20231103]
      operationId: get-v2-snapshot-stock-quote
      description: |
        ## Behavior
        - 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#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#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.
        - [Want a snapshot for an entire chain?](/operations/get-v2-bulk_snapshot-stock-quote)

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/snapshot/stock/quote?root=AAPL](http://127.0.0.1:25510/v2/snapshot/stock/quote?root=AAPL)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/venue'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
  /snapshot/stock/ohlc:
    x-min-subscription: value
    get:
      summary: OHLC Snapshot
      tags:
        - Stocks
        - Snapshots
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","open","high","low","close","volume","count","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts traded.
                        count:
                          type: integer
                          description: The amount of trades.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [45000000,186.615000,186.670000,186.530000,186.540000,87758,1319,20240102]
                      - [45060000,186.540000,186.715000,186.530200,186.630000,92924,1125,20240102]
      operationId: get-v2-snapshot-stock-ohlc
      description: |
        ## Behavior

        - 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#stocks).

        - Returns a 15-minute delayed session OHLC from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs) account has the [stocks value subscription](https://www.thetadata.net/subscribe#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.
        - [Want a snapshot for an entire chain?](/operations/get-v2-bulk_snapshot-stock-ohlc)

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/snapshot/stock/ohlc?root=AAPL](http://127.0.0.1:25510/v2/snapshot/stock/ohlc?root=AAPL)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/venue'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"

  /bulk_snapshot/stock/quote:
    x-min-subscription: standard
    get:
      summary: Bulk Quote Snapshot
      tags:
        - Stocks
        - 'Bulk Snapshots'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: Milliseconds since 00:00:00.000 (midnight) ET.
                            bid_size:
                              type: integer
                              description: The last BBO bid size.
                            bid_exchange:
                              type: string
                              description: The last BBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                            bid:
                              type: number
                              description: The last BBO bid price.
                            bid_condition:
                              type: string
                              description: The last BBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                            ask_size:
                              type: integer
                              description: The last BBO ask size.
                            ask_exchange:
                              type: string
                              description: The last BBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                            ask:
                              type: number
                              description: The last BBO ask price.
                            ask_condition:
                              type: string
                              description: The last BBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                            date:
                              type: integer
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                    example:
                      - ticks:
                          - [70840632,100,29,469.0000,0,100,29,571.5000,0,20250129]
                        contract:
                          root: CVCO
                      - ticks:
                          - [72000032,100,29,22.9800,0,100,29,38.9800,0,20250129]
                        contract:
                          root: KLXY
      operationId: get-v2-bulk_snapshot-stock-quote
      description: |
        ## Behavior

        - Returns a real-time last BBO quote for every stock 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#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.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_snapshot/stock/quote?root=0](http://127.0.0.1:25510/v2/bulk_snapshot/stock/quote?root=0)


        ## Output Descriptions
        Field     | Description
        ----------|----------
        ms_of_day | The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
        bid_size  | The last BBO bid size.
        bid_exchange | The last BBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
        bid       | The last BBO bid price.
        bid_condition | The last BBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
        ask_size  | The last BBO ask size.
        ask_exchange | The last BBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
        ask       | The last BBO ask price.
        ask_condition | The last BBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
        date      | The date formated as YYYYMMDD.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
        - $ref: '#/components/parameters/venue'
  /bulk_snapshot/stock/ohlc:
    x-min-subscription: standard
    get:
      summary: Bulk OHLC Snapshot
      tags:
        - Stocks
        - 'Bulk Snapshots'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","open","high","low","close","volume","count","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts traded.
                        count:
                          type: integer
                          description: The amount of trades.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [45000000,186.615000,186.670000,186.530000,186.540000,87758,1319,20240102]
                      - [45060000,186.540000,186.715000,186.530200,186.630000,92924,1125,20240102]
      operationId: get-v2-bulk_snapshot-stock-ohlc
      description: |
        ## Behavior

        - Returns a real-time session OHLC for every stock 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#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.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_snapshot/stock/ohlc?root=0](http://127.0.0.1:25510/v2/bulk_snapshot/stock/ohlc?root=0)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
        - $ref: '#/components/parameters/venue'

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

        #### Historical request behavior:
        Returns the last trade reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs#equities-cta-utp) at a specified millisecond of the day.
        Trade condition mappings can be found [here](/Articles/Data-And-Requests/Values/Trade-Conditions.html).

        The ``ivl``parameter represents the milliseconds since 00:00:00.000 ET that the trade should be provided for.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.

        [http://127.0.0.1:25510/v2/at_time/stock/trade?root=SPY&start_date=20240116&end_date=20240116&ivl=57600000](http://127.0.0.1:25510/v2/at_time/stock/trade?root=SPY&start_date=20240116&end_date=20240116&ivl=57600000)
      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/ivl_at_time"
        - $ref: "#/components/parameters/rth"
        - $ref: '#/components/parameters/venue'
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade (the time the trade was reported). Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [57600000,10146941,32,255,255,255,0,560,1,474.9500,0,1,0,0,20240116]
      tags:
        - Stocks
        - 'At Time'
    x-min-subscription: standard
  /at_time/stock/quote:
    get:
      summary: Quote At Time
      operationId: get-at_time-stock-quote
      description: |
        ## Behavior
        #### Real-time request behavior:
          - Subscription tier standard or higher will default to NQB.
          - Real-time last BBO quote at-ivl-time from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs#nasdaq-basic) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe#stocks).
          - 15-minute delayed NBBO quote at-ivl-time from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs#equities-cta-utp) account has the [stocks value subscription](https://www.thetadata.net/subscribe#stocks) subscription.
        
        #### Historical request behavior:
          Returns the last NBBO quote reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs#equities-cta-utp) at a specified millisecond of the day.
        The ``ivl``parameter represents the milliseconds since 00:00:00.000 ET that the quote should be provided for.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.

        [http://127.0.0.1:25510/v2/at_time/stock/quote?root=SPY&start_date=20240116&end_date=20240116&ivl=57600000](http://127.0.0.1:25510/v2/at_time/stock/quote?root=SPY&start_date=20240116&end_date=20240116&ivl=57600000)
      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/ivl_at_time"
        - $ref: "#/components/parameters/rth"
        - $ref: '#/components/parameters/venue'
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: Milliseconds since 00:00:00.000 (midnight) ET.
                        bid_size:
                          type: integer
                          description: The last NBBO bid size.
                        bid_exchange:
                          type: integer
                          description: The last NBBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last NBBO bid price.
                        bid_condition:
                          type: integer
                          description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last NBBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask_condition:
                          type: integer
                          description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [57600000,8,1,474.95,0,17,7,474.96,0,20240116]
      tags:
        - Stocks
        - 'At Time'
    x-min-subscription: value

  /hist/stock/eod:
    x-min-subscription: free
    get:
      summary: EOD Report
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","ms_of_day2","open","high","low","close","volume","count","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        ms_of_day2:
                          type: integer
                          description: The time of the closing trade . Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts 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/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last NBBO bid price.
                        bid_condition:
                          type: integer
                          description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last NBBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask:
                          type: double
                          description: The last NBBO ask price.
                        ask_condition:
                          type: integer
                          description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [62273606,62271877,187.030,188.440,183.885,185.640,80680243,1003582,2,7,18.534,0,2,1,18.536,0,20240102]
                      - [62189883,62188586,184.200,185.880,183.430,184.250,58308345,654127,5,7,18.405,0,2,1,18.410,0,20240103]
      operationId: get-v2-hist-stock-eod
      description: |
        ## Behavior

        Since [the equity SIPs](/Articles/Data-And-Requests/The-SIPs) only generate a partial EOD
        report, Theta Data generates a national EOD report at 17:15 ET each day.
        ``ms_of_day`` represents the time of day the report was generated and
        ``ms_of_day2`` represents the time of the last trade. The quote in the response
        represents the last NBBO reported by [CTA or UTP](/Articles/Data-And-Requests/The-SIPs)
        at the time of report generation. You can read more about EOD & OHLC data
        [here](/Articles/Data-And-Requests/OHLC-EOD). Theta Data plans to avail
        SIP EOD reports in the near future.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/stock/eod?root=AAPL&start_date=20240101&end_date=20240131](http://127.0.0.1:25510/v2/hist/stock/eod?root=AAPL&start_date=20240101&end_date=20240131)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      tags:
        - Stocks
        - 'Historical Data'
  /hist/stock/trade:
    get:
      summary: Trades
      tags:
        - Stocks
        - 'Historical Data'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [14400004,1,32,255,1,115,1,5,65,191.68,7,0,0,0,20240102]
                      - [14400004,2,32,255,1,115,1,20,65,191.68,7,0,0,0,20240102]
      operationId: get-v2-hist-stock-trade
      description: |
        ## Behavior

        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#stocks).

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/stock/trade?root=AAPL&start_date=20240102&end_date=20240102](http://127.0.0.1:25510/v2/hist/stock/trade?root=AAPL&start_date=20240102&end_date=20240102)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/venue'
    x-min-subscription: standard
  /hist/stock/quote:
    get:
      summary: Quotes
      tags:
        - Stocks
        - 'Historical Data'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day", "bid_size", "bid_exchange", "bid", "bid_condition", "ask_size", "ask_exchange", "ask", "ask_condition", "date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid_size:
                          type: integer
                          description: The last NBBO bid size.
                        bid_exchange:
                          type: integer
                          description: The last NBBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last NBBO bid price.
                        bid_condition:
                          type: integer
                          description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last NBBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask:
                          type: double
                          description: The last NBBO ask price.
                        ask_condition:
                          type: integer
                          description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [35100000,38,69,5.40,50,21,69,5.60,50,20231103]
                      - [36000000,24,60,5.35,50,31,60,5.50,50,20231103]
      operationId: get-v2-hist-stock-quote
      description: |
        ## Behavior

        Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the
        ``ivl`` 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#stocks).

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/stock/quote?root=AAPL&start_date=20240102&end_date=20240102&ivl=60000](http://127.0.0.1:25510/v2/hist/stock/quote?root=AAPL&start_date=20240102&end_date=20240102&ivl=60000)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/venue'
    x-min-subscription: value
  /hist/stock/trade_quote:
    get:
      summary: Trade Quote
      tags:
        - Stocks
        - 'Historical Data'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","ms_of_day2","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade (the time the trade was reported). Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the quote. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid_size:
                          type: integer
                          description: The last BBO bid size.
                        bid_exchange:
                          type: integer
                          description: The last BBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last BBO bid price.
                        bid_condition:
                          type: integer
                          description: The last BBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last BBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last BBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask:
                          type: double
                          description: The last BBO ask price.
                        ask_condition:
                          type: integer
                          description: The last BBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [14400004,1,32,255,1,115,1,5,65,191.68,7,0,0,0,14400004,2,65,190.05,0,1,65,191.68,0,20240102]
                      - [14400004,2,32,255,1,115,1,20,65,191.68,7,0,0,0,14400004,2,65,190.05,0,1,65,191.68,0,20240102]
      operationId: get-get-v2-hist-stock-trade_quote
      description: |
        ## Behavior

        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#stocks).

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/stock/trade_quote?root=AAPL&start_date=20240102&end_date=20240102](http://127.0.0.1:25510/v2/hist/stock/trade_quote?root=AAPL&start_date=20240102&end_date=20240102)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
        - $ref: '#/components/parameters/exclusive'
    x-min-subscription: standard
  /hist/stock/ohlc:
    x-min-subscription: value
    get:
      summary: OHLC
      tags:
        - Stocks
        - 'Historical Data'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","open","high","low","close","volume","count","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts traded.
                        count:
                          type: integer
                          description: The amount of trades.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [45000000,186.615000,186.670000,186.530000,186.540000,87758,1319,20240102]
                      - [45060000,186.540000,186.715000,186.530200,186.630000,92924,1125,20240102]
      operationId: get-v2-hist-stock-ohlc
      description: |
        Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD)
        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#stocks).

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/stock/ohlc?root=AAPL&start_date=20240102&end_date=20240102&ivl=60000](http://127.0.0.1:25510/v2/hist/stock/ohlc?root=AAPL&start_date=20240102&end_date=20240102&ivl=60000)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl_ohlc'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/venue'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
  /hist/stock/split:
    get:
      summary: Splits
      tags:
        - Stocks
        - 'Historical Data'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","split_date","before_shares","after_shares","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the split report. Milliseconds since 00:00:00.000 (midnight) ET.
                        split_date:
                          type: integer
                          description: The date the split went into effect.
                        before_shares:
                          type: integer
                          description: The amount of shares (multiplier) prior to the split
                        after_shares:
                          type: integer
                          description: The amount of shares (multiplier) after the split.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [240000,20200831,1,4,20240113]
                      - [240000,20200831,1,4,20240114]
      operationId: get-v2-hist-stock-split
      description: |
        ## Behavior

        A stock split represents a change in the total amount of shares of a company. Theta Data reports a
        daily last split message. A last split message includes the date of the last stock split along with
        the shares prior to and after the split.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/stock/split?root=AAPL&start_date=20240101&end_date=20240201](http://127.0.0.1:25510/v2/hist/stock/split?root=AAPL&start_date=20240101&end_date=20240201)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
    x-min-subscription: standard
  /hist/stock/dividend:
    get:
      summary: Dividends
      tags:
        - Stocks
        - 'Historical Data'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","ex_date","record_date","payment_date","ann_date","dividend_amount","undefined","less_amount","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the report. Milliseconds since 00:00:00.000 (midnight) ET.
                        ex_date:
                          type: integer
                          description: The ex-dvidend date date formated as YYYYMMDD.
                        record_date:
                          type: integer
                          description: The record date formated as YYYYMMDD.
                        payment_date:
                          type: integer
                          description: The payment date formated as YYYYMMD
                        ann_date:
                          type: integer
                          description: The announcement date formated as YYYYMMDD.
                        dividend_amount:
                          type: double
                          description: The dividend amount in USD.
                        undefined:
                          type: integer
                          description: placeholder / future use. This can be ignored.
                        less_amount:
                          type: double
                          description: Fees deducted from the ``dividend_amount``
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [3600000,20240209,20240212,20240215,20240201,0.24,0,0.00,20240209]
                      - [3600000,20240510,20240513,20240516,20240502,0.25,0,0.00,20240510]
      operationId: get-v2-hist-stock-dividend
      description: |
        ## Behavior

        A stock dividend message is generally reported on the ex-dividend date.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/stock/dividend?root=AAPL&start_date=20240101&end_date=20240601](http://127.0.0.1:25510/v2/hist/stock/dividend?root=AAPL&start_date=20240101&end_date=20240601)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
    x-min-subscription: standard


  /snapshot/option/quote:
    get:
      summary: Quotes
      tags:
        - Options
        - Snapshots
      operationId: get-snapshot-option-quote
      description: |
        ## Behavior 
        - 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.
        - [Want a snapshot for an entire chain?](/operations/get-bulk_snapshot-option-quote)

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/snapshot/option/quote?root=AAPL&exp=20260116&right=C&strike=275000](http://127.0.0.1:25510/v2/snapshot/option/quote?root=AAPL&exp=20260116&right=C&strike=275000)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day", "bid_size", "bid_exchange", "bid", "bid_condition", "ask_size", "ask_exchange", "ask", "ask_condition", "date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid_size:
                          type: integer
                          description: The last NBBO bid size.
                        bid_exchange:
                          type: integer
                          description: The last NBBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last NBBO bid price.
                        bid_condition:
                          type: integer
                          description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last NBBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask:
                          type: double
                          description: The last NBBO ask price.
                        ask_condition:
                          type: integer
                          description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [57599925,14,65,14.05,50,5,4,14.40,50,20250103]
    x-min-subscription: value
  /snapshot/option/ohlc:
    get:
      summary: OHLC
      tags:
        - Options
        - Snapshots
      operationId: get-snapshot-option-ohlc
      description: |
        ## Behavior 
        - 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.
        - [Want a snapshot for an entire chain?](/operations/get-bulk_snapshot-option-ohlc)

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/snapshot/option/ohlc?root=AAPL&exp=20260116&right=C&strike=275000](http://127.0.0.1:25510/v2/snapshot/option/ohlc?root=AAPL&exp=20260116&right=C&strike=275000)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","open","high","low","close","volume","count","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The opening time of the OHLC bar. Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts traded.
                        count:
                          type: integer
                          description: The amount of trades.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [57381579,14.25,14.25,13.90,14.15,2090,54,20250103]
    x-min-subscription: value
  /snapshot/option/trade:
    get:
      summary: Trade
      tags:
        - Options
        - Snapshots
      operationId: get-snapshot-option-trade
      description: |
        ## Behavior 

        - 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.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/snapshot/option/trade?root=AAPL&exp=20260116&right=C&strike=275000](http://127.0.0.1:25510/v2/snapshot/option/trade?root=AAPL&exp=20260116&right=C&strike=275000)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","size","condition","price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade (the time the trade was reported). Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        price:
                          type: double
                          description: The trade price.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [57381579,846283647,3,18,14.15,20250103]
    x-min-subscription: standard
  /snapshot/option/open_interest:
    get:
      summary: Open Interest
      tags:
        - Options
        - Snapshots
      operationId: get-snapshot-option-open_interest
      description: |
        ## Behavior 

        - 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 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.
        - [Want a snapshot for an entire chain?](/operations/get-bulk_snapshot-option-open_interest)

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/snapshot/option/open_interest?root=AAPL&exp=20260116&right=C&strike=275000](http://127.0.0.1:25510/v2/snapshot/option/open_interest?root=AAPL&exp=20260116&right=C&strike=275000)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","open_interest","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time OI was reported. Milliseconds since 00:00:00.000 (midnight) ET.
                        open_interest:
                          type: integer
                          description: The total amount of outstanding contracts.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [23400000,3773,20250103]
    x-min-subscription: value

  /bulk_snapshot/option/quote:
    get:
      summary: Bulk Quotes
      operationId: get-bulk_snapshot-option-quote
      description: |
        ## Behavior

        - Retrieve a real-time last quote for all option contracts that share the same expiration and root.
        - **Make ``exp`` 0 if you want to get the snapshot for every expiration chain for the underlying.**

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_snapshot/option/quote?root=AAPL&exp=20260116](http://127.0.0.1:25510/v2/bulk_snapshot/option/quote?root=AAPL&exp=20260116)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: Milliseconds since 00:00:00.000 (midnight) ET.
                            bid_size:
                              type: integer
                              description: Bid size.
                            bid_exchange:
                              type: integer
                              description: Bid exchange.
                            bid:
                              type: number
                              format: double
                              description: Bid price.
                            bid_condition:
                              type: integer
                              description: Bid condition.
                            ask_size:
                              type: integer
                              description: Ask size.
                            ask_exchange:
                              type: integer
                              description: Ask exchange.
                            ask:
                              type: number
                              format: double
                              description: Ask price.
                            ask_condition:
                              type: integer
                              description: Ask condition.
                            date:
                              type: integer
                              format: date
                              description: Date formatted as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [57599934,60,7,221.9000,50,50,1,225.6500,50,20250103]
                        contract:
                          root: AAPL
                          expiration: 20260116
                          strike: 20000
                          right: C
                      - ticks:
                          - [34204994,3,1,0.0200,50,10,1,0.0400,50,20250103]
                        contract:
                          root: AAPL
                          expiration: 20260116
                          strike: 20000
                          right: P
      tags:
        - Options
        - 'Bulk Snapshots'
    x-min-subscription: standard
  /bulk_snapshot/option/open_interest:
    get:
      summary: Bulk Open Interest
      operationId: get-bulk_snapshot-option-open_interest
      description: |
        ## Behavior

        - Retrieve the last [OPRA](/Articles/Data-And-Requests/The-SIPs) reported open interest message for all option contracts that share the same expiration and root.
        - Open interest is reported around 06:30 ET every morning by OPRA and reflects the open interest at the end of the previou trading day.
        - You might need to change the default expiration date to a different date if it is past the current date.
        - **Make ``exp`` 0 if you want to get the snapshot for every expiration chain for the underlying.**

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_snapshot/option/open_interest?root=AAPL&exp=20260116](http://127.0.0.1:25510/v2/bulk_snapshot/option/open_interest?root=AAPL&exp=20260116)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","open_interest","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The time OI was reported. Milliseconds since 00:00:00.000 (midnight) ET.
                            open_interest:
                              type: integer
                              description: The total amount of outstanding contracts.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [23400000,0,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 50000
                          right: C
                      - ticks:
                          - [23404000,4910,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 50000
                          right: P
      tags:
        - Options
        - 'Bulk Snapshots'
    x-min-subscription: standard
  /bulk_snapshot/option/ohlc:
    get:
      summary: Bulk OHLC
      operationId: get-bulk_snapshot-option-ohlc
      description: |
        ## Behavior

        - Retrieve a real-time last [SIP](/Articles/Data-And-Requests/The-SIPs) corrected session OHLC for all option contracts that share the same expiration and root.
        - **Make ``exp`` 0 if you want to get the snapshot for every expiration chain for the underlying.**


        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_snapshot/option/ohlc?root=AAPL&exp=20260116](http://127.0.0.1:25510/v2/bulk_snapshot/option/ohlc?root=AAPL&exp=20260116)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","open","high","low","close","volume","count","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The opening time of the OHLC bar. Milliseconds since 00:00:00.000 (midnight) ET.
                            open:
                              type: double
                              description: The opening trade price.
                            high:
                              type: double
                              description: The highest traded price.
                            low:
                              type: double
                              description: The lowest traded price.
                            close:
                              type: double
                              description: The closing traded price.
                            volume:
                              type: integer
                              description: The amount of contracts traded.
                            count:
                              type: integer
                              description: The amount of trades.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [34200000,14.3000,14.8000,13.5000,14.3000,50,18,20231103]
                          - [35100000,15.5000,15.6100,15.3800,15.5100,26,10,20231103]
                        contract:
                          root: AAPL
                          expiration: 20231103
                          strike: 160000
                          right: C
                      - ticks:
                          - [34200000,0.0100,0.1500,0.0100,0.0100,718,113,20231103]
                          - [35100000,0.0100,0.0100,0.0100,0.0100,232,30,20231103]
                        contract:
                          root: AAPL
                          expiration: 20231103
                          strike: 160000
                          right: P
      tags:
        - Options
        - 'Bulk Snapshots'
    x-min-subscription: standard
  /bulk_snapshot/option/greeks:
    get:
      summary: Bulk Greeks
      operationId: get-bulk_snapshot-option-greeks
      description: |
        ## Behavior

        - 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 ``exp`` 0 if you want to get the snapshot for every expiration chain for the underlying.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_snapshot/option/greeks?root=AAPL&exp=20260116](http://127.0.0.1:25510/v2/bulk_snapshot/option/greeks?root=AAPL&exp=20260116)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/under_price'
        - $ref: '#/components/parameters/rate'
        - $ref: '#/components/parameters/annual_div'
        - $ref: '#/components/parameters/rate_value'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid","ask","delta","theta","vega","rho","epsilon","lambda","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp of the trade greeks. Milliseconds since 00:00:00.000 (midnight) ET.
                            bid:
                              type: double
                              description: The bid.
                            ask:
                              type: double
                              description: The ask.
                            delta:
                              type: double
                              description: The delta.
                            theta:
                              type: double
                              description: The Theta.
                            vega:
                              type: double
                              description: The vega.
                            rho:
                              type: double
                              description: The rho.
                            epsilon:
                              type: double
                              description: The epsilon.
                            lambda:
                              type: double
                              description: The lambda.
                            implied_vol:
                              type: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                        - [57599934,221.9000,225.6500,0.9999,-0.0011,0.0754,20.2037,-251.3314,1.0874,0.7250,0.0000,71985879,243.3500,20250103]
                        contract:
                          root: AAPL
                          expiration: 20260116
                          strike: 20000
                          right: C
                      - ticks:
                          - [34204994,0.0200,0.0400,-0.0004,-0.0004,0.3847,-0.1402,0.1088,-3.4606,0.8562,0.0150,71985879,243.3500,20250103]
                        contract:
                          root: AAPL
                          expiration: 20260116
                          strike: 20000
                          right: P
      tags:
        - Options
        - 'Bulk Snapshots'
    x-min-subscription: standard
  /bulk_snapshot/option/greeks_second_order:
    get:
      summary: Bulk Greeks Second Order
      operationId: get-bulk_snapshot-option-greeks_second_order
      description: |
        ## Behavior

        - 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 ``exp`` 0 if you want to get the snapshot for every expiration chain for the underlying.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_snapshot/option/greeks_second_order?root=AAPL&exp=20260116](http://127.0.0.1:25510/v2/bulk_snapshot/option/greeks_second_order?root=AAPL&exp=20260116)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/rate'
        - $ref: '#/components/parameters/rate_value'
        - $ref: '#/components/parameters/under_price'
        - $ref: '#/components/parameters/annual_div'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid","ask","gamma","vanna","charm","vomma","veta","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                            bid:
                              type: number
                              format: double
                              description: The national best bid price.
                            ask:
                              type: number
                              format: double
                              description: The national best ask price.
                            gamma:
                              type: number
                              format: double
                              description: The gamma.
                            vanna:
                              type: number
                              format: double
                              description: The vanna.
                            charm:
                              type: number
                              format: double
                              description: The charm.
                            vomma:
                              type: number
                              format: double
                              description: The vomma.
                            veta:
                              type: number
                              format: double
                              description: The veta.
                            implied_vol:
                              type: number
                              format: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: number
                              format: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: number
                              format: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                        - [57599934,221.9000,225.6500,0.0000,-0.0012,0.0004,1.2035,0.4814,0.7250,0.0000,71985879,243.3500,20250103]
                        contract:
                          root: AAPL
                          expiration: 20260116
                          strike: 20000
                          right: C
                      - ticks:
                          - [34204994,0.0200,0.0400,0.0000,-0.0044,0.0018,3.6821,1.7959,0.8562,0.0150,71985879,243.3500,20250103]
                        contract:
                          root: AAPL
                          expiration: 20260116
                          strike: 20000
                          right: P
      tags:
        - Options
        - 'Bulk Snapshots'
    x-min-subscription: pro
  /bulk_snapshot/option/greeks_third_order:
    get:
      summary: Bulk Greeks Third Order
      operationId: get-bulk_snapshot-option-greeks_third_order
      description: |
        ## Behavior

        - 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 ``exp`` 0 if you want to get the snapshot for every expiration chain for the underlying.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_snapshot/option/greeks_third_order?root=AAPL&exp=20260116](http://127.0.0.1:25510/v2/bulk_snapshot/option/greeks_third_order?root=AAPL&exp=20260116)


        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/rate'
        - $ref: '#/components/parameters/under_price'
        - $ref: '#/components/parameters/annual_div'
        - $ref: '#/components/parameters/rate_value'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid","ask","speed","zomma","color","ultima","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                            bid:
                              type: number
                              format: double
                              description: The national best bid price.
                            ask:
                              type: number
                              format: double
                              description: The national best ask price.
                            speed:
                              type: number
                              format: double
                              description: The speed.
                            zomma:
                              type: number
                              format: double
                              description: The zomma.
                            color:
                              type: number
                              format: double
                              description: The color.
                            ultima:
                              type: number
                              format: double
                              description: The ultima.
                            implied_vol:
                              type: number
                              format: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: number
                              format: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: number
                              format: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                        - [57599934,221.9000,225.6500,0.0000,0.0000,0.3080,14.1321,0.7250,0.0000,71985879,243.3500,20250103]
                        contract:
                          root: AAPL
                          expiration: 20260116
                          strike: 20000
                          right: C
                      - ticks:
                          - [34204994,0.0200,0.0400,0.0000,0.0000,1.2627,21.9454,0.8562,0.0150,71985879,243.3500,20250103]
                        contract:
                          root: AAPL
                          expiration: 20260116
                          strike: 20000
                          right: P
      tags:
        - Options
        - 'Bulk Snapshots'
    x-min-subscription: pro
  /bulk_snapshot/option/all_greeks:
    get:
      summary: Bulk All Greeks
      operationId: get-bulk_snapshot-option-all_greeks
      description: |
        ## Behavior

        - 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 ``exp`` 0 if you want to get the snapshot for every expiration chain for the underlying.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_snapshot/option/all_greeks?root=AAPL&exp=20260116](http://127.0.0.1:25510/v2/bulk_snapshot/option/all_greeks?root=AAPL&exp=20260116)
        
        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/under_price'
        - $ref: '#/components/parameters/rate'
        - $ref: '#/components/parameters/annual_div'
        - $ref: '#/components/parameters/rate_value'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid","ask","delta","theta","vega","rho","epsilon","lambda","gamma","vanna","charm","vomma","veta","speed","zomma","color","ultima","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                            bid:
                              type: number
                              format: double
                              description: The national best bid price.
                            ask:
                              type: number
                              format: double
                              description: The national best ask price.
                            delta:
                              type: number
                              format: double
                              description: The delta.
                            theta:
                              type: number
                              format: double
                              description: The Theta.
                            vega:
                              type: number
                              format: double
                              description: The vega.
                            rho:
                              type: number
                              format: double
                              description: The rho.
                            epsilon:
                              type: number
                              format: double
                              description: The epsilon.
                            lambda:
                              type: number
                              format: double
                              description: The lambda.
                            gamma:
                              type: number
                              format: double
                              description: The gamma.
                            vanna:
                              type: number
                              format: double
                              description: The vanna.
                            charm:
                              type: number
                              format: double
                              description: The charm.
                            vomma:
                              type: number
                              format: double
                              description: The vomma.
                            veta:
                              type: number
                              format: double
                              description: The veta.
                            speed:
                              type: number
                              format: double
                              description: The speed.
                            zomma:
                              type: number
                              format: double
                              description: The zomma.
                            color:
                              type: number
                              format: double
                              description: The color.
                            ultima:
                              type: number
                              format: double
                              description: The ultima.
                            implied_vol:
                              type: number
                              format: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: number
                              format: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: number
                              format: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                        - [50709357,316.2000,319.5000,0.8890,-1.6478,254.9316,250.3638,-266.0386,16.9724,0.0007,-1.1576,2.1708,1905.5221,8.0136,0.0000,0.0000,-1.1273,-100.0000,0.1926,0.0000,50709000,6067.8600,20250210]
                        contract:
                          root: SPXW
                          expiration: 20250228
                          strike: 5770000
                          right: C
                      - ticks:
                          - [50709677,10.5000,10.7000,-0.0932,-1.0769,224.7201,-28.4387,27.9160,-53.4010,0.0006,-1.2025,2.0802,2140.1218,7.3513,0.0000,0.0000,-0.9044,-100.0000,0.1776,0.0000,50709000,6067.8600,20250210]
                        contract:
                          root: SPXW
                          expiration: 20250228
                          strike: 5770000
                          right: P
      tags:
        - Options
        - 'Bulk Snapshots'
    x-min-subscription: pro

  /at_time/option/trade:
    get:
      summary: Trade At Time
      operationId: get-at_time-option-trade
      description: |
        ## Behavior

        Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) at a specified millisecond of the day.
        Trade condition mappings can be found [here](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
        Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) for options, so they can be ignored.
        The ``ivl``parameter represents the milliseconds since 00:00:00.000 ET that the trade should be provided for.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.

        [http://127.0.0.1:25510/v2/at_time/option/trade?root=SPY&exp=20240119&strike=470000&right=C&start_date=20240116&end_date=20240116&ivl=44100000](http://127.0.0.1:25510/v2/at_time/option/trade?root=SPY&exp=20240119&strike=470000&right=C&start_date=20240116&end_date=20240116&ivl=44100000)
      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/ivl_at_time"
        - $ref: "#/components/parameters/rth"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade (the time the trade was reported). Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [43860664,602567584,255,255,255,255,125,1,43,5.84,0,1,0,0,20240116]
      tags:
        - Options
        - 'At Time'
    x-min-subscription: standard
  /at_time/option/quote:
    get:
      summary: Quote At Time
      operationId: get-at_time-option-quote
      description: |
        ## Behavior

        Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) at a specified millisecond of the day.
        The ``ivl``parameter represents the milliseconds since 00:00:00.000 ET that the quote should be provided for.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.

        [http://127.0.0.1:25510/v2/at_time/option/quote?root=SPY&exp=20240119&strike=470000&right=C&start_date=20240116&end_date=20240116&ivl=44100000](http://127.0.0.1:25510/v2/at_time/option/quote?root=SPY&exp=20240119&strike=470000&right=C&start_date=20240116&end_date=20240116&ivl=44100000)
      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/strike"
        - $ref: "#/components/parameters/right"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/ivl_at_time"
        - $ref: "#/components/parameters/rth"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: Milliseconds since 00:00:00.000 (midnight) ET.
                        bid_size:
                          type: integer
                          description: The last NBBO bid size.
                        bid_exchange:
                          type: integer
                          description: The last NBBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last NBBO bid price.
                        bid_condition:
                          type: integer
                          description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last NBBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask_condition:
                          type: integer
                          description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [44100000,302,1,5.71,50,300,1,5.79,50,20240116]
      tags:
        - Options
        - 'At Time'
    x-min-subscription: value

  /bulk_at_time/option/trade:
    get:
      summary: Bulk Trade At Time
      operationId: get-bulk_at_time-option-trade
      description: |
        ## Behavior

        Returns the data for all contracts that share the same provided root and expiration.
        Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) at
        a specified millisecond of the day. Trade condition
        mappings can be found [here](/Articles/Data-And-Requests/Values/Trade-Conditions.html). Extended trade conditions are
        not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) for options, so they can be ignored.
        The ``ivl``parameter represents the milliseconds since
        00:00:00.000 ET that the trade should be provided for.

        **Set ``exp`` to ``0`` if you want to retrieve data for every option that shares the same ``root``.**
        **Note: Any ``exp=0`` must be requested day by day**

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_at_time/option/trade?root=SPY&exp=20240119&start_date=20240116&end_date=20240116&ivl=44100000](http://127.0.0.1:25510/v2/bulk_at_time/option/trade?root=SPY&exp=20240119&start_date=20240116&end_date=20240116&ivl=44100000)
      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/ivl_at_time"
        - $ref: "#/components/parameters/rth"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details;["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: Milliseconds since 00:00:00.000 (midnight) ET.
                            sequence:
                              type: integer
                              description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                            ext_condition1:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition2:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition3:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition4:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            condition:
                              type: integer
                              description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                            size:
                              type: integer
                              description: The amount of contracts traded.
                            exchange:
                              type: integer
                              description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                            price:
                              type: double
                              description: The trade price.
                            condition_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            price_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            volume_type:
                              type: integer
                              description: Future use. These fields can be ignored.
                            records_back:
                              type: integer
                              description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                            date:
                              type: integer
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [36476240,325086878,255,255,255,255,18,1,69,294.6200,0,3,0,0,20240116]
                        contract:
                          root: SPY
                          expiration: 20240119
                          strike: 180000
                          right: C
                      - ticks:
                          - [34394294,235308063,255,255,255,255,130,1,43,0.0100,0,7,0,0,20240116]
                        contract:
                          root: SPY
                          expiration: 20240119
                          strike: 180000
                          right: P
      tags:
        - Options
        - 'Bulk At Time'
    x-min-subscription: standard
  /bulk_at_time/option/quote:
    get:
      summary: Bulk Quote At Time
      operationId: get-bulk_at_time-option-quote
      description: |
        ## Behavior

        Returns the data for all contracts that share the same provided root and expiration.
        Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) at 
        a specified millisecond of the day. The ``ivl``parameter represents the milliseconds since
        00:00:00.000 ET that the quote should be provided for.

        **Set ``exp`` to ``0`` if you want to retrieve data for every option that shares the same ``root``.**
        **Note: Any ``exp=0`` must be requested day by day**

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_at_time/option/quote?root=SPY&exp=20240119&start_date=20240116&end_date=20240116&ivl=44100000](http://127.0.0.1:25510/v2/bulk_at_time/option/quote?root=SPY&exp=20240119&start_date=20240116&end_date=20240116&ivl=44100000)
      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/ivl_at_time"
        - $ref: "#/components/parameters/rth"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: Milliseconds since 00:00:00.000 (midnight) ET.
                            bid_size:
                              type: integer
                              description: Bid size.
                            bid_exchange:
                              type: integer
                              description: Bid exchange.
                            bid:
                              type: number
                              format: double
                              description: Bid price.
                            bid_condition:
                              type: integer
                              description: Bid condition.
                            ask_size:
                              type: integer
                              description: Ask size.
                            ask_exchange:
                              type: integer
                              description: Ask exchange.
                            ask:
                              type: number
                              format: double
                              description: Ask price.
                            ask_condition:
                              type: integer
                              description: Ask condition.
                            date:
                              type: integer
                              description: Date formatted as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [44100000, 75, 5, 294.6100, 50, 75, 5, 295.0100, 50, 20240116]
                        contract:
                          root: SPY
                          expiration: 20240119
                          strike: 180000
                          right: C
                      - ticks:
                          - [44100000, 0, 7, 0.0000, 50, 12287, 42, 0.0100, 50, 20240116]
                        contract:
                          root: SPY
                          expiration: 20240119
                          strike: 180000
                          right: P
      tags:
        - Options
        - 'Bulk At Time'
    x-min-subscription: standard

  /hist/option/eod:
    get:
      summary: EOD Report
      operationId: hist-option-eod
      description: |
        ## Behavior 

        Since [OPRA](/Articles/Data-And-Requests/The-SIPs) does not provide a national EOD 
        report for options, Thetadata generates a national EOD report at 17:15 ET each day.
         ``ms_of_day`` represents the time of day the report was generated and 
         ``ms_of_day2`` represents the time 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).


        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/eod?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231102&end_date=20231102](http://127.0.0.1:25510/v2/hist/option/eod?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231102&end_date=20231102)
        > 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.
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","ms_of_day2","open","high","low","close","volume","count","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        ms_of_day2:
                          type: integer
                          description: The time of the closing trade . Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts 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/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last NBBO bid price.
                        bid_condition:
                          type: integer
                          description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last NBBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask:
                          type: double
                          description: The last NBBO ask price.
                        ask_condition:
                          type: integer
                          description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [62573163,57590486,6.72,8.55,6.55,8.51,4684,1013,11,43,7.85,50,8,60,8.75,50,20231102]
                      - [63174002,57590486,6.72,8.55,6.55,8.51,4684,1013,11,43,7.85,50,8,60,8.75,50,20231102]
      tags:
        - Options
        - 'Historical Data'
    x-min-subscription: free
  /hist/option/quote:
    get:
      summary: Quotes
      operationId: get-hist-option-quote
      description: |
        ## Behavior

        Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs). If the
        ``ivl`` parameter is specified, the quote for each interval represents the last quote
         at the interval's timestamp.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/quote?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103&ivl=900000](http://127.0.0.1:25510/v2/hist/option/quote?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103&ivl=900000)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day", "bid_size", "bid_exchange", "bid", "bid_condition", "ask_size", "ask_exchange", "ask", "ask_condition", "date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid_size:
                          type: integer
                          description: The last NBBO bid size.
                        bid_exchange:
                          type: integer
                          description: The last NBBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last NBBO bid price.
                        bid_condition:
                          type: integer
                          description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last NBBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask:
                          type: double
                          description: The last NBBO ask price.
                        ask_condition:
                          type: integer
                          description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [35100000,38,69,5.40,50,21,69,5.60,50,20231103]
                      - [36000000,24,60,5.35,50,31,60,5.50,50,20231103]
      tags:
        - Options
        - 'Historical Data'
    x-min-subscription: value
  /hist/option/ohlc:
    get:
      summary: OHLC
      operationId: get-hist-option-ohlc
      description: |
        ## Behavior

        Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD)
        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 + ivl``, where ivl is the
        specified interval size in milliseconds.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/ohlc?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103&ivl=900000](http://127.0.0.1:25510/v2/hist/option/ohlc?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103&ivl=900000)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl_ohlc'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","open","high","low","close","volume","count","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The opening time of the OHLC bar. Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts traded.
                        count:
                          type: integer
                          description: The amount of trades.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [45000000,6.40,6.40,6.05,6.35,47,14,20231103]
                      - [45900000,6.35,6.40,5.95,6.25,65,21,20231103]
      tags:
        - Options
        - 'Historical Data'
    x-min-subscription: value
  /hist/option/open_interest:
    get:
      summary: Open Interest
      operationId: get-hist-option-open_interest
      description: |
        ## Behavior

        Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The-SIPs) at approximately 
        06:30 ET. A new open interest message might not be sent by 
        [OPRA](/Articles/Data-And-Requests/The-SIPs) 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.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/open_interest?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231015&end_date=20231103](http://127.0.0.1:25510/v2/hist/option/open_interest?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231015&end_date=20231103)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","open_interest","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time OI was reported. Milliseconds since 00:00:00.000 (midnight) ET.
                        open_interest:
                          type: integer
                          description: The total amount of outstanding contracts.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [23406000,1575,20231016]
                      - [23405000,1494,20231017]
      tags:
        - Options
        - 'Historical Data'
    x-min-subscription: value
  /hist/option/trade:
    get:
      summary: Trades
      operationId: get-hist-option-trade
      description: |
        ## Behavior

        Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs). Trade condition
        mappings can be found [here](/Articles/Data-And-Requests/Values/Trade-Conditions.html). Extended trade conditions are
        not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) for options, so they can be ignored.


        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/trade?root=AAPL&exp=20231103&strike=150000&right=C&start_date=20231103&end_date=20231103](http://127.0.0.1:25510/v2/hist/option/trade?root=AAPL&exp=20231103&strike=150000&right=C&start_date=20231103&end_date=20231103)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade (the time the trade was reported). Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [43860664,602567584,255,255,255,255,125,1,43,5.84,0,1,0,0,20240116]
      tags:
        - Options
        - 'Historical Data'
    x-min-subscription: standard
  /hist/option/trade_quote:
    get:
      summary: Trade Quote
      operationId: get-hist-option-trade_quote
      description: |
        ## Behavior 

        Returns every [trade](/operations/get-hist-option-trade) 
        reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) paired with the last NBBO quote 
        reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) 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.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/trade_quote?root=AAPL&exp=20231103&strike=150000&right=C&start_date=20231103&end_date=20231103](http://127.0.0.1:25510/v2/hist/option/trade_quote?root=AAPL&exp=20231103&strike=150000&right=C&start_date=20231103&end_date=20231103)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/exclusive'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","ms_of_day2","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade (the time the trade was reported). Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the quote. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid_size:
                          type: integer
                          description: The last BBO bid size.
                        bid_exchange:
                          type: integer
                          description: The last BBO bid [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last BBO bid price.
                        bid_condition:
                          type: integer
                          description: The last BBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last BBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last BBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask:
                          type: double
                          description: The last BBO ask price.
                        ask_condition:
                          type: integer
                          description: The last BBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [34200150,-705522277,255,255,255,255,130,2,6,25.05,0,7,0,0,34200126,10,9,22.80,50,1,6,25.75,50,20231103]
                      - [34221163,-701980016,255,255,255,255,18,1,65,23.40,0,5,0,0,34221163,133,69,23.40,50,1,47,26.15,50,20231103]
      tags:
        - Options
        - 'Historical Data'
      x-internal: false
    x-min-subscription: standard
  /hist/option/implied_volatility:
    get:
      summary: Implied Volatility
      operationId: get-hist-option-implied_volatility
      description: |
        ## Behavior

        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
        ``ms_of_day`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/implied_volatility?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911](http://127.0.0.1:25510/v2/hist/option/implied_volatility?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","bid","bid_implied_vol","midpoint","implied_vol","ask","ask_implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid:
                          type: number
                          format: double
                          description: The national best bid price.
                        bid_implied_vol:
                          type: number
                          format: double
                          description: The implied volatiltiy calculated using the bid price.
                        midpoint:
                          type: number
                          format: double
                          description: The midpoint calculated by averaging the bid & ask prices.
                        implied_vol:
                          type: number
                          format: double
                          description: The implied volatiltiy calculated using the mid price.
                        ask:
                          type: number
                          format: double
                          description: The national best offer price.
                        ask_implied_vol:
                          type: number
                          format: double
                          description: The implied volatiltiy calculated using the ask price.
                        iv_error:
                          type: number
                          format: double
                          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.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                        underlying_price:
                          type: number
                          format: double
                          description: The midpoint of the underlying at the time of the option quote.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [35100000,8.7000,0.3808,8.7200,0.3867,8.7500,0.3945,0.0000,35100000,178.2100,20230911]
                      - [36000000,8.5000,0.3769,8.5200,0.3823,8.5500,0.3906,0.0000,36000000,178.0000,20230911]
      tags:
        - Options
        - 'Historical Greeks'
    x-min-subscription: standard
  /hist/option/greeks:
    get:
      summary: Greeks
      operationId: get-hist-option-greeks
      description: |
        ## Behavior

        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/get-hist-option-quote) 
        endpoint. The underlying price represents whatever the last underlying price was at the
        ``ms_of_day`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/greeks?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=90000](http://127.0.0.1:25510/v2/hist/option/greeks?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=90000)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","bid","ask","delta","theta","vega","rho","epsilon","lambda","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid:
                          type: number
                          format: double
                          description: The national best bid price.
                        ask:
                          type: number
                          format: double
                          description: The national best ask price.
                        delta:
                          type: number
                          format: double
                          description: The delta.
                        theta:
                          type: number
                          format: double
                          description: The Theta.
                        vega:
                          type: number
                          format: double
                          description: The vega.
                        rho:
                          type: number
                          format: double
                          description: The rho.
                        epsilon:
                          type: number
                          format: double
                          description: The epsilon.
                        lambda:
                          type: number
                          format: double
                          description: The lambda.
                        implied_vol:
                          type: number
                          format: double
                          description: The implied volatiltiy calculated using the trade price.
                        iv_error:
                          type: number
                          format: double
                          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.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                        underlying_price:
                          type: number
                          format: double
                          description: The midpoint of the underlying at the time of the option trade.
                        date:
                          type: integer
                          description: The date formated as YYYYMMDD.
                    example:
                      - [34290000,10.3000,10.4000,0.9135,-0.1739,2.9676,1.6881,-1.8015,15.8829,0.4086,0.0000,34289992,179.9400,20230911]
                      - [34380000,10.3500,10.5000,0.9231,-0.1566,2.7177,1.7074,-1.8216,15.9525,0.3945,0.0000,34379988,180.0600,20230911]
      tags:
        - Options
        - 'Historical Greeks'
    x-min-subscription: standard
  /hist/option/greeks_second_order:
    get:
      summary: Greeks Second Order
      operationId: get-hist-option-greeks_second_order
      description: |
        ## Behavior

        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/get-hist-option-quote) 
        endpoint. The underlying price represents whatever the last underlying price was at the
        ``ms_of_day`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/greeks_second_order?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=900000](http://127.0.0.1:25510/v2/hist/option/greeks_second_order?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=900000)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","bid","ask","gamma","vanna","charm","vomma","veta","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid:
                          type: number
                          format: double
                          description: The national best bid price.
                        ask:
                          type: number
                          format: double
                          description: The national best ask price.
                        gamma:
                          type: number
                          format: double
                          description: The gamma.
                        vanna:
                          type: number
                          format: double
                          description: The vanna.
                        charm:
                          type: number
                          format: double
                          description: The charm.
                        vomma:
                          type: number
                          format: double
                          description: The vomma.
                        veta:
                          type: number
                          format: double
                          description: The veta.
                        implied_vol:
                          type: number
                          format: double
                          description: The implied volatiltiy calculated using the trade price.
                        iv_error:
                          type: number
                          format: double
                          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.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                        underlying_price:
                          type: number
                          format: double
                          description: The midpoint of the underlying at the time of the option trade.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [35100000,8.7000,8.7500,0.0269,-0.5823,10.0200,13.0320,-0.0149,0.3867,0.0001,35100000,178.2100,20230911]
                      - [36000000,8.5000,8.5500,0.0277,-0.5923,10.0699,13.0622,-0.0157,0.3823,0.0000,36000000,178.0000,20230911]
      tags:
        - Options
        - 'Historical Greeks'
    x-min-subscription: pro
  /hist/option/greeks_third_order:
    get:
      summary: Greeks Third Order
      operationId: get-hist-option-greeks_third_order
      description: |
        ## Behavior

        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/get-hist-option-quote) 
        endpoint. The underlying price represents whatever the last underlying price was at the
        ``ms_of_day`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/greeks_third_order?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=900000](http://127.0.0.1:25510/v2/hist/option/greeks_third_order?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=900000)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","bid","ask","speed","zomma","color","ultima","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid:
                          type: number
                          format: double
                          description: The national best bid price.
                        ask:
                          type: number
                          format: double
                          description: The national best ask price.
                        speed:
                          type: number
                          format: double
                          description: The speed.
                        zomma:
                          type: number
                          format: double
                          description: The zomma.
                        color:
                          type: number
                          format: double
                          description: The color.
                        ultima:
                          type: number
                          format: double
                          description: The ultima.
                        implied_vol:
                          type: number
                          format: double
                          description: The implied volatiltiy calculated using the trade price.
                        iv_error:
                          type: number
                          format: double
                          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.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                        underlying_price:
                          type: number
                          format: double
                          description: The midpoint of the underlying at the time of the option trade.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [36000000,8.5000,8.5500,0.0000,0.0000,-0.0076,-56.3025,0.3823,0.0000,36000000,178.0000,20230911]
                      - [36900000,8.2000,8.2500,0.0000,0.0000,-0.0077,-59.0901,0.3774,0.0000,36900000,177.6800,20230911]
      tags:
        - Options
        - 'Historical Greeks'
    x-min-subscription: pro
  /hist/option/all_greeks:
    get:
      summary: All Greeks
      operationId: get-hist-option-all_greeks
      description: |
        ## Behavior

        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/get-hist-option-quote) 
        endpoint. The underlying price represents whatever the last underlying price was at the
        ``ms_of_day`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/all_greeks?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=900000](http://127.0.0.1:25510/v2/hist/option/all_greeks?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=900000)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","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","ms_of_day2","underlying_price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                        bid:
                          type: number
                          format: double
                          description: The national best bid price.
                        ask:
                          type: number
                          format: double
                          description: The national best ask price.
                        delta:
                          type: number
                          format: double
                          description: The delta.
                        theta:
                          type: number
                          format: double
                          description: The Theta.
                        vega:
                          type: number
                          format: double
                          description: The vega.
                        rho:
                          type: number
                          format: double
                          description: The rho.
                        epsilon:
                          type: number
                          format: double
                          description: The epsilon.
                        lambda:
                          type: number
                          format: double
                          description: The lambda.
                        gamma:
                          type: number
                          format: double
                          description: The gamma.
                        vanna:
                          type: number
                          format: double
                          description: The vanna.
                        charm:
                          type: number
                          format: double
                          description: The charm.
                        vomma:
                          type: number
                          format: double
                          description: The vomma.
                        veta:
                          type: number
                          format: double
                          description: The veta.
                        vera:
                          type: number
                          format: double
                          description: The vera.
                        speed:
                          type: number
                          format: double
                          description: The speed.
                        zomma:
                          type: number
                          format: double
                          description: The zomma.
                        color:
                          type: number
                          format: double
                          description: The color.
                        ultima:
                          type: number
                          format: double
                          description: The ultima.
                        d1:
                          type: number
                          format: double
                          description: The d1.
                        d2:
                          type: number
                          format: double
                          description: The d2.
                        dual_delta:
                          type: number
                          format: double
                          description: The dual delta.
                        dual_gamma:
                          type: number
                          format: double
                          description: The dual gamma.
                        implied_vol:
                          type: number
                          format: double
                          description: The implied volatiltiy calculated using the trade price.
                        iv_error:
                          type: number
                          format: double
                          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.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                        underlying_price:
                          type: number
                          format: double
                          description: The midpoint of the underlying at the time of the option trade.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [35100000,8.7000,8.7500,0.8848,-0.1968,3.6244,1.6325,-1.7281,18.0818,0.0269,-0.5823,10.0200,13.0320,-0.0149,0.0000,0.0000,0.0000,-0.0075,-54.2783,1.1996,1.1591,-0.8762,0.0000,0.3867,0.0001,35100000,178.2100,20230911]
                      - [36000000,8.5000,8.5500,0.8816,-0.1979,3.6904,1.6265,-1.7198,18.4217,0.0277,-0.5923,10.0699,13.0622,-0.0157,0.0000,0.0000,0.0000,-0.0076,-56.3025,1.1834,1.1434,-0.8730,0.0000,0.3823,0.0000,36000000,178.0000,20230911]
      tags:
        - Options
        - 'Historical Greeks'
    x-min-subscription: pro
  /hist/option/all_trade_greeks:
    get:
      summary: All Trade Greeks
      operationId: get-hist-option-all_trade_greeks
      description: |
        ## Behavior

        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/get-hist-option-quote) 
        endpoint. The underlying price represents whatever the last underlying price was at the
        ``ms_of_day`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/all_trade_greeks?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=900000](http://127.0.0.1:25510/v2/hist/option/all_trade_greeks?root=AAPL&exp=20230915&strike=170000&right=C&start_date=20230911&end_date=20230911&ivl=900000)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","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","ms_of_day2","underlying_price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade greeks. Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        delta:
                          type: number
                          format: double
                          description: The delta.
                        theta:
                          type: number
                          format: double
                          description: The Theta.
                        vega:
                          type: number
                          format: double
                          description: The vega.
                        rho:
                          type: number
                          format: double
                          description: The rho.
                        epsilon:
                          type: number
                          format: double
                          description: The epsilon.
                        lambda:
                          type: number
                          format: double
                          description: The lambda.
                        gamma:
                          type: number
                          format: double
                          description: The gamma.
                        vanna:
                          type: number
                          format: double
                          description: The vanna.
                        charm:
                          type: number
                          format: double
                          description: The charm.
                        vomma:
                          type: number
                          format: double
                          description: The vomma.
                        veta:
                          type: number
                          format: double
                          description: The veta.
                        vera:
                          type: number
                          format: double
                          description: The vera.
                        speed:
                          type: number
                          format: double
                          description: The speed.
                        zomma:
                          type: number
                          format: double
                          description: The zomma.
                        color:
                          type: number
                          format: double
                          description: The color.
                        ultima:
                          type: number
                          format: double
                          description: The ultima.
                        d1:
                          type: number
                          format: double
                          description: The d1.
                        d2:
                          type: number
                          format: double
                          description: The d2.
                        dual_delta:
                          type: number
                          format: double
                          description: The dual delta.
                        dual_gamma:
                          type: number
                          format: double
                          description: The dual gamma.
                        implied_vol:
                          type: number
                          format: double
                          description: The implied volatiltiy calculated using the trade price.
                        iv_error:
                          type: number
                          format: double
                          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.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                        underlying_price:
                          type: number
                          format: double
                          description: The midpoint of the underlying at the time of the option trade.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [34200178,2314473,255,255,255,255,130,1,6,10.4500,0,7,0,0,0.9194,-0.1642,2.8179,1.6998,-1.8143,15.8416,0.0197,-0.5049,9.0809,13.3365,-0.0096,0.0000,0.0000,0.0000,-0.0060,-36.3540,1.4011,1.3590,-0.9124,0.0000,0.4023,0.0000,34200177,180.0700,20230911]
                      - [34203290,3009866,255,255,255,255,134,3,42,10.5500,0,3,0,0,0.9237,-0.1573,2.7052,1.7084,-1.8240,15.7755,0.0190,-0.4998,8.9046,13.4875,-0.0096,0.0000,0.0000,0.0000,-0.0057,-34.3380,1.4304,1.3887,-0.9170,0.0000,0.3984,0.0000,34203274,180.1900,20230911]
      tags:
        - Options
        - 'Historical Greeks'
    x-min-subscription: pro
  /hist/option/trade_greeks:
    x-min-subscription: pro
    get:
      summary: Trade Greeks
      operationId: get-hist-option-trade_greeks
      description: |
        ## Behavior

        Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs).
        The underlying price represents whatever the last underlying price was at the
        ``ms_of_day`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks). ``perf_boost`` can be specified to ``true``
        to improve the speed of this request by using 1 second intervals for the underlying quotes
        instead of tick level quotes.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/trade_greeks?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103](http://127.0.0.1:25510/v2/hist/option/trade_greeks?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/perf_boost'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","delta","theta","vega","rho","epsilon","lambda","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade greeks. Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        delta:
                          type: double
                          description: The delta.
                        theta:
                          type: double
                          description: The Theta.
                        vega:
                          type: double
                          description: The vega.
                        rho:
                          type: double
                          description: The rho.
                        epsilon:
                          type: double
                          description: The epsilon.
                        lambda:
                          type: double
                          description: The lambda.
                        implied_vol:
                          type: double
                          description: The implied volatiltiy calculated using the trade price.
                        iv_error:
                          type: double
                          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.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                        underlying_price:
                          type: double
                          description: The midpoint of the underlying at the time of the option trade.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [34200165,-705520992,255,255,255,255,130,2,6,4.4800,0,7,0,0,0.8719,-2.6805,0.7393,0.0605,-0.0624,33.9135,1.0789,0.0000,34200164,174.2300,20231103]
                      - [34200166,-705520988,255,255,255,255,130,1,6,4.5800,0,3,0,0,0.8458,-3.3902,0.8385,0.0586,-0.0605,32.1801,1.2054,0.0000,34200164,174.2300,20231103]
      tags:
        - Options
        - 'Historical Greeks'
  /hist/option/trade_greeks_second_order:
    get:
      summary: Trade Greeks Second Order
      operationId: get-hist-option-trade_greeks_second_order
      description: |
        ## Behavior

        Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs).
        The underlying price represents whatever the last underlying price was at the
        ``ms_of_day`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks). ``perf_boost`` can be specified to ``true``
        to improve the speed of this request by using 1 second intervals for the underlying quotes
        instead of tick level quotes.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/trade_greeks_second_order?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103](http://127.0.0.1:25510/v2/hist/option/trade_greeks_second_order?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/perf_boost'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","gamma","vanna","charm","vomma","veta","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade greeks. Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        gamma:
                          type: double
                          description: The gamma.
                        vanna:
                          type: double
                          description: The vanna.
                        charm:
                          type: double
                          description: The charm.
                        vomma:
                          type: double
                          description: The vomma.
                        veta:
                          type: double
                          description: The veta.
                        implied_vol:
                          type: double
                          description: The implied volatiltiy calculated using the trade price.
                        iv_error:
                          type: double
                          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.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                        underlying_price:
                          type: double
                          description: The midpoint of the underlying at the time of the option trade.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [34200165,-705520992,255,255,255,255,130,2,6,4.4800,0,7,0,0,0.0549,-0.2161,283.1678,0.8668,-0.0004,1.0789,0.0000,34200164,174.2300,20231103]
                      - [34200166,-705520988,255,255,255,255,130,1,6,4.5800,0,3,0,0,0.0557,-0.1958,286.7181,0.7047,-0.0004,1.2054,0.0000,34200164,174.2300,20231103]
      tags:
        - Options
        - 'Historical Greeks'
    x-min-subscription: pro
  /hist/option/trade_greeks_third_order:
    get:
      summary: Trade Greeks Third Order
      operationId: get-hist-option-trade_greeks_third_order
      description: |
        ## Behavior

        Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs).
        The underlying price represents whatever the last underlying price was at the
        ``ms_of_day`` field. You can read more about how Thetadata calculates greeks 
        [here](/Articles/Data-And-Requests/Option-Greeks). ``perf_boost`` can be specified to ``true``
        to improve the speed of this request by using 1 second intervals for the underlying quotes
        instead of tick level quotes.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/option/trade_greeks_third_order?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103](http://127.0.0.1:25510/v2/hist/option/trade_greeks_third_order?root=AAPL&exp=20231103&strike=170000&right=C&start_date=20231103&end_date=20231103)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/strike'
        - $ref: '#/components/parameters/right'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/perf_boost'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","speed","zomma","color","ultima","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The exchange timestamp of the trade greeks. Milliseconds since 00:00:00.000 (midnight) ET.
                        sequence:
                          type: integer
                          description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                        ext_condition1:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition2:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition3:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        ext_condition4:
                          type: integer
                          description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                        condition:
                          type: integer
                          description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                        size:
                          type: integer
                          description: The amount of contracts traded.
                        exchange:
                          type: integer
                          description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                        price:
                          type: double
                          description: The trade price.
                        condition_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        price_flags:
                          type: integer
                          description: Future use. These fields can be ignored.
                        volume_type:
                          type: integer
                          description: Future use. These fields can be ignored.
                        records_back:
                          type: integer
                          description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                        speed:
                          type: double
                          description: The speed.
                        zomma:
                          type: double
                          description: The zomma.
                        color:
                          type: double
                          description: The color.
                        ultima:
                          type: double
                          description: The ultima.
                        implied_vol:
                          type: double
                          description: The implied volatiltiy calculated using the trade price.
                        iv_error:
                          type: double
                          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.
                        ms_of_day2:
                          type: integer
                          description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                        underlying_price:
                          type: double
                          description: The midpoint of the underlying at the time of the option trade.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [34200165,-705520992,255,255,255,255,130,2,6,4.4800,0,7,0,0,0.0000,0.0000,-0.0001,-1.3943,1.0789,0.0000,34200164,174.2300,20231103]
                      - [34200166,-705520988,255,255,255,255,130,1,6,4.5800,0,3,0,0,0.0000,0.0000,-0.0002,-1.1619,1.2054,0.0000,34200164,174.2300,20231103]
      tags:
        - Options
        - 'Historical Greeks'
    x-min-subscription: pro

  /bulk_hist/option/eod:
    get:
      summary: Bulk EOD
      operationId: get-bulk_hist-option-eod
      description: |
        ## Behavior 

        Returns the data for all contracts that share the same provided root and expiration.
        Since [OPRA](/Articles/Data-And-Requests/The-SIPs) does not provide a national EOD 
        report for options, Thetadata generates a national EOD report at 17:15 ET each day.
         ``ms_of_day`` represents the time of day the report was generated and 
         ``ms_of_day2`` represents the time 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).
           **Set ``exp`` to ``0`` if you want
         to retrieve data for every option that shares the same ``root``. (note: Any ``exp=0`` must be requested day by day)**

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/eod?root=AAPL&exp=20231103&start_date=20231102&end_date=20231102](http://127.0.0.1:25510/v2/bulk_hist/option/eod?root=AAPL&exp=20231103&start_date=20231102&end_date=20231102)
        > 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.
      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/annual_div"
        - $ref: "#/components/parameters/rate"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","ms_of_day2","open","high","low","close","volume","count","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                            ms_of_day2:
                              type: integer
                              description: The time of the closing trade . Milliseconds since 00:00:00.000 (midnight) ET.
                            open:
                              type: double
                              description: The opening trade price.
                            high:
                              type: double
                              description: The highest traded price.
                            low:
                              type: double
                              description: The lowest traded price.
                            close:
                              type: double
                              description: The closing traded price.
                            volume:
                              type: integer
                              description: The amount of contracts 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/Data-And-Requests/Values/Exchanges.html).
                            bid:
                              type: double
                              description: The last NBBO bid price.
                            bid_condition:
                              type: integer
                              description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                            ask_size:
                              type: integer
                              description: The last NBBO ask size.
                            ask_exchange:
                              type: integer
                              description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                            ask:
                              type: double
                              description: The last NBBO ask price.
                            ask_condition:
                              type: integer
                              description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                            date:
                              type: integer
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [62573163,55073367,126.3500,127.6000,126.2000,127.6000,14,10,6,47,126.6000,50,1,7,129.6500,50,20231102]
                          - [63174002,55073367,126.3500,127.6000,126.2000,127.6000,14,10,6,47,126.6000,50,1,7,129.6500,50,20231102]
                        contract:
                          root: AAPL
                          expiration: 20240119
                          strike: 50000
                          right: C
                      - ticks:
                          - [62573163,0,0.0000,0.0000,0.0000,0.0000,0,0,0,22,0.0000,50,1,7,0.0100,50,20231102]
                          - [63174002,0,0.0000,0.0000,0.0000,0.0000,0,0,0,22,0.0000,50,1,7,0.0100,50,20231102]
                        contract:
                          root: AAPL
                          expiration: 20240119
                          strike: 50000
                          right: P
      tags:
        - Options
        - 'Bulk Historical Data'
    x-min-subscription: value
  /bulk_hist/option/quote:
    get:
      summary: Bulk Quote
      operationId: get-bulk_hist-option-quote
      description: |
        ## Behavior

        Returns the data for all contracts that share the same provided root and expiration.
         Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs). If the
        ``ivl`` parameter is specified, the quote for each interval represents the last quote
         at the interval's timestamp. We do not recommend omitting the ``ivl`` parameter
         as tick-level quote responses are very large, which can produce undefined behavior. To request tick-level data, make 
        single contract requests. Any ``ivl`` under ``60000`` is not officially supported. 
        We also do not recommend using a date range over 1 day. **Set ``exp`` to ``0`` if you want
         to retrieve data for every option that shares the same ``root``. This is only supported for 1 minute intervals (``ivl=60000``) (note: Any ``exp=0`` must be requested day by day)**

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/quote?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110&ivl=900000](http://127.0.0.1:25510/v2/bulk_hist/option/quote?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110&ivl=900000)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: Milliseconds since 00:00:00.000 (midnight) ET.
                            bid_size:
                              type: integer
                              description: Bid size.
                            bid_exchange:
                              type: integer
                              description: Bid exchange.
                            bid:
                              type: number
                              format: double
                              description: Bid price.
                            bid_condition:
                              type: integer
                              description: Bid condition.
                            ask_size:
                              type: integer
                              description: Ask size.
                            ask_exchange:
                              type: integer
                              description: Ask exchange.
                            ask:
                              type: number
                              format: double
                              description: Ask price.
                            ask_condition:
                              type: integer
                              description: Ask condition.
                            date:
                              type: integer
                              format: date
                              description: Date formatted as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [35100000,13,47,134.6000,50,11,47,134.9000,50,20231110]
                          - [36000000,1,47,133.9500,50,50,1,135.1000,50,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 50000
                          right: C
                      - ticks:
                          - [35100000,0,7,0.0000,50,608,42,0.0100,50,20231110]
                          - [36000000,0,42,0.0000,50,161,1,0.0100,50,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 50000
                          right: P
      tags:
        - Options
        - 'Bulk Historical Data'
      security: []
    x-min-subscription: value
  /bulk_hist/option/ohlc:
    get:
      summary: Bulk OHLC
      operationId: get-bulk_hist-option-ohlc
      description: |
        ## Behavior

        Returns the data for all contracts that share the same provided root and expiration. Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD) 
        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 + ivl``, where ivl is the
        specified interval size in milliseconds.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/ohlc?root=AAPL&exp=20231103&start_date=20231103&end_date=20231103&ivl=900000](http://127.0.0.1:25510/v2/bulk_hist/option/ohlc?root=AAPL&exp=20231103&start_date=20231103&end_date=20231103&ivl=900000)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl_ohlc'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","open","high","low","close","volume","count","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The opening time of the OHLC bar. Milliseconds since 00:00:00.000 (midnight) ET.
                            open:
                              type: double
                              description: The opening trade price.
                            high:
                              type: double
                              description: The highest traded price.
                            low:
                              type: double
                              description: The lowest traded price.
                            close:
                              type: double
                              description: The closing traded price.
                            volume:
                              type: integer
                              description: The amount of contracts traded.
                            count:
                              type: integer
                              description: The amount of trades.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [34200000,14.3000,14.8000,13.5000,14.3000,50,18,20231103]
                          - [35100000,15.5000,15.6100,15.3800,15.5100,26,10,20231103]
                        contract:
                          root: AAPL
                          expiration: 20231103
                          strike: 160000
                          right: C
                      - ticks:
                          - [34200000,0.0100,0.1500,0.0100,0.0100,718,113,20231103]
                          - [35100000,0.0100,0.0100,0.0100,0.0100,232,30,20231103]
                        contract:
                          root: AAPL
                          expiration: 20231103
                          strike: 160000
                          right: P
      tags:
        - Options
        - 'Bulk Historical Data'
      security: []
    x-min-subscription: value
  /bulk_hist/option/open_interest:
    get:
      summary: Bulk Open Interest
      operationId: hist-option-open_interest
      description: |
        ## Behavior

        Returns the data for all contracts that share the same provided root and expiration.
        Open Interest is reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) at approximately 
        06:30 ET. A new open interest message might not be sent by 
        [OPRA](/Articles/Data-And-Requests/The-SIPs) 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.  **Set ``exp`` to ``0`` if you want
         to retrieve data for every option that shares the same ``root``. (note: Any ``exp=0`` must be requested day by day)**

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/open_interest?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110](http://127.0.0.1:25510/v2/bulk_hist/option/open_interest?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","open_interest","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The time OI was reported. Milliseconds since 00:00:00.000 (midnight) ET.
                            open_interest:
                              type: integer
                              description: The total amount of outstanding contracts.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [23400000,0,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 50000
                          right: C
                      - ticks:
                          - [23404000,4910,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 50000
                          right: P
      tags:
        - Options
        - 'Bulk Historical Data'
    x-min-subscription: standard
  /bulk_hist/option/trade:
    get:
      summary: Bulk Trade
      operationId: get-bulk_hist-option-trade
      description: |
        ## Behavior 

        Returns the data for all contracts that share the same provided root and expiration.
        Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs). Trade condition
        mappings can be found [here](/Articles/Data-And-Requests/Values/Trade-Conditions.html). Extended trade conditions are
        not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) for options, so they can be ignored.
        **Set ``exp`` to ``0`` if you want
         to retrieve data for every option that shares the same ``root``. (note: Any ``exp=0`` must be requested day by day)**

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/trade?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110](http://127.0.0.1:25510/v2/bulk_hist/option/trade?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The time of the Trade report. Milliseconds since 00:00:00.000 (midnight) ET.
                            sequence:
                              type: integer
                              description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                            ext_condition1:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition2:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition3:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition4:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            condition:
                              type: integer
                              description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                            size:
                              type: integer
                              description: The amount of contracts traded.
                            exchange:
                              type: integer
                              description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                            price:
                              type: double
                              description: The trade price.
                            condition_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            price_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            volume_type:
                              type: integer
                              description: Future use. These fields can be ignored.
                            records_back:
                              type: integer
                              description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [56167951,299720858,255,255,255,255,18,1,42,86.1500,0,7,0,0,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 100000
                          right: C
                      - ticks:
                          - [41064023,-745524183,255,255,255,255,125,1,43,79.9000,0,7,0,0,20231110]
                          - [43614362,-561477748,255,255,255,255,125,1,9,79.9700,0,3,0,0,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 105000
                          right: C
      tags:
        - Options
        - 'Bulk Historical Data'
    x-min-subscription: standard
  /bulk_hist/option/trade_quote:
    get:
      summary: Bulk Trade Quote
      operationId: get-bulk_hist-option-trade_quote
      description: |
        ## Behavior 

        Returns the data for all contracts that share the same provided root and expiration. 
        Returns every [trade](/operations/get-hist-option-trade) 
        reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) paired with the last NBBO quote 
        reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) 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.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/trade_quote?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110](http://127.0.0.1:25510/v2/bulk_hist/option/trade_quote?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/exp'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/exclusive'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","ms_of_day2","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp of the trade (the time the trade was reported). Milliseconds since 00:00:00.000 (midnight) ET.
                            sequence:
                              type: integer
                              description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                            ext_condition1:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition2:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition3:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition4:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            condition:
                              type: integer
                              description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                            size:
                              type: integer
                              description: The amount of contracts traded.
                            exchange:
                              type: integer
                              description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                            price:
                              type: double
                              description: The trade price.
                            condition_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            price_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            volume_type:
                              type: integer
                              description: Future use. These fields can be ignored.
                            records_back:
                              type: integer
                              description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the quote. Milliseconds since 00:00:00.000 (midnight) ET.
                            bid_size:
                              type: integer
                              description: The size of the bid.
                            bid_exchange:
                              type: integer
                              description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) of the bid.
                            bid:
                              type: double
                              description: The bid price.
                            bid_condition:
                              type: integer
                              description: The [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html) of the bid.
                            ask_size:
                              type: integer
                              description: The size of the ask.
                            ask_exchange:
                              type: integer
                              description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) of the ask.
                            ask:
                              type: double
                              description: The ask price.
                            ask_condition:
                              type: integer
                              description: The [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html) of the ask.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [56167951,299720858,255,255,255,255,18,1,42,86.1500,0,7,0,0,56167951,12,47,86.0000,50,1,47,86.2000,50,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 100000
                          right: C
                      - ticks:
                          - [41064023,-745524183,255,255,255,255,125,1,43,79.9000,0,7,0,0,41051889,14,47,79.7500,50,3,31,80.0000,50,20231110]
                          - [43614362,-561477748,255,255,255,255,125,1,9,79.9700,0,3,0,0,43614362,13,7,79.8500,50,13,7,80.1000,50,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 105000
                          right: C
      tags:
        - Options
        - 'Bulk Historical Data'
    x-min-subscription: standard
  /bulk_hist/option/eod_greeks:
    get:
      summary: Bulk EOD Greeks
      operationId: get-hist-option-eod_greeks
      description: |
        ## Behavior

        - Returns the data for all contracts that share the same provided root 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.
        - ``ms_of_day`` represents the time of the last option trade and ``ms_of_day2`` represents the time of the last stock trade. 
        - **Set ``exp`` to ``0`` if you want to retrieve data for every option that shares the same ``root``. (note: Any ``exp=0`` must be requested day by day)**

        - ***Sample data contains partial output of the request as the full response to the request is too large to display on this webpage.***


        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/eod_greeks?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110](http://127.0.0.1:25510/v2/bulk_hist/option/eod_greeks?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110)


        > 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.
      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/annual_div"
        - $ref: "#/components/parameters/rate"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","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","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The millisecond of the day the tick was recorded.
                            open:
                              type: double
                              description: The open price of the contract.
                            high:
                              type: double
                              description: The highest price of the contract.
                            low:
                              type: double
                              description: The lowest price of the contract.
                            close:
                              type: double
                              description: The closing price of the contract.
                            volume:
                              type: integer
                              description: The volume of the contract.
                            count:
                              type: integer
                              description: The number of trades for the contract.
                            bid_size:
                              type: integer
                              description: The size of the bid.
                            bid_exchange:
                              type: integer
                              description: The exchange of the bid.
                            bid:
                              type: double
                              description: The price of the bid.
                            bid_condition:
                              type: integer
                              description: The condition of the bid.
                            ask_size:
                              type: integer
                              description: The size of the ask.
                            ask_exchange:
                              type: integer
                              description: The exchange of the ask.
                            ask:
                              type: double
                              description: The price of the ask.
                            ask_condition:
                              type: integer
                              description: The condition of the ask.
                            delta:
                              type: double
                              description: The delta of the contract.
                            theta:
                              type: double
                              description: The theta of the contract.
                            vega:
                              type: double
                              description: The vega of the contract.
                            rho:
                              type: double
                              description: The rho of the contract.
                            epsilon:
                              type: double
                              description: The epsilon of the contract.
                            lambda:
                              type: double
                              description: The lambda of the contract.
                            gamma:
                              type: double
                              description: The gamma of the contract.
                            vanna:
                              type: double
                              description: The vanna of the contract.
                            charm:
                              type: double
                              description: The charm of the contract.
                            vomma:
                              type: double
                              description: The vomma of the contract.
                            veta:
                              type: double
                              description: The veta of the contract.
                            vera:
                              type: double
                              description: The vera of the contract.
                            speed:
                              type: double
                              description: The speed of the contract.
                            zomma:
                              type: double
                              description: The zomma of the contract.
                            color:
                              type: double
                              description: The color of the contract.
                            ultima:
                              type: double
                              description: The ultima of the contract.
                            d1:
                              type: double
                              description: The d1 of the contract.
                            d2:
                              type: double
                              description: The d2 of the contract.
                            implied_vol:
                              type: double
                              description: The implied vol of the contract.
                            iv_error:
                              type: double
                              description: The iv_error of the contract.
                            ms_of_day2:
                              type: integer
                              description: The ms_of_day2 of the contract.
                            underlying_price:
                              type: double
                              description: The underlying_price of the contract.
                            date:
                              type: integer
                              description: The date formated as YYYYMMDD.
                              format: date
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [43614362,79.9000,79.9700,79.9000,79.9700,2,2,50,7,80.8500,50,50,60,82.0000,50,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0192,43614362,186.4000,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 105000
                          right: C
                      - ticks:
                          - [56967501,0.0100,0.0100,0.0100,0.0100,73,8,100,7,0.0100,50,98,7,0.0200,50,-0.0014,-0.0075,0.1215,-0.0053,0.0051,-28.0651,0.0002,-0.0153,0.3489,1.1833,0.0080,0.0000,0.0000,0.0000,-0.0008,7.4596,2.9796,2.8584,0.8750,-0.0417,56967501,186.4000,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 131000
                          right: P
      tags:
        - Options
        - 'Bulk Historical Greeks'
    x-min-subscription: standard
  /bulk_hist/option/greeks:
    get:
      summary: Bulk Greeks
      operationId: get-bulk_hist-option-greeks
      description: |
        ## Behavior

        - Returns the data for all contracts that share the same provided root 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/get-hist-option-quote) endpoint. 
        - The underlying price represents whatever the last underlying price was at the ``ms_of_day`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/greeks?root=AAPL&exp=20230915&start_date=20230911&end_date=20230911&ivl=90000](http://127.0.0.1:25510/v2/bulk_hist/option/greeks?root=AAPL&exp=20230915&start_date=20230911&end_date=20230911&ivl=90000)

      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/annual_div"
        - $ref: "#/components/parameters/rate"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/ivl"
        - $ref: "#/components/parameters/rth"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid","ask","delta","theta","vega","rho","epsilon","lambda","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                            bid:
                              type: number
                              format: double
                              description: The national best bid price.
                            ask:
                              type: number
                              format: double
                              description: The national best ask price.
                            delta:
                              type: number
                              format: double
                              description: The delta.
                            theta:
                              type: number
                              format: double
                              description: The Theta.
                            vega:
                              type: number
                              format: double
                              description: The vega.
                            rho:
                              type: number
                              format: double
                              description: The rho.
                            epsilon:
                              type: number
                              format: double
                              description: The epsilon.
                            lambda:
                              type: number
                              format: double
                              description: The lambda.
                            implied_vol:
                              type: number
                              format: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: number
                              format: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: number
                              format: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                          - [34290000,114.9500,115.0500,0.9988,-0.0393,0.0708,0.7094,-1.9697,1.5629,3.3828,0.0000,34289992,179.9400,20230911]
                          - [34380000,115.0500,115.2000,0.9988,-0.0392,0.0705,0.7094,-1.9710,1.5623,3.3828,0.0000,34379988,180.0600,20230911]
                        contract:
                          root: AAPL
                          expiration: 20230915
                          strike: 65000
                          right: C
                      - ticks:
                          - [34290000,109.9500,110.0500,0.9989,-0.0361,0.0671,0.7643,-1.9698,1.6340,3.1015,0.0000,34289992,179.9400,20230911]
                          - [34380000,110.0500,110.1500,1.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,34379988,180.0600,20230911]
                        contract:
                          root: AAPL
                          expiration: 20230915
                          strike: 70000
                          right: C
      tags:
        - Options
        - 'Bulk Historical Greeks'
    x-min-subscription: standard
  /bulk_hist/option/greeks_second_order:
    get:
      summary: Bulk Greeks Second Order
      operationId: get-bulk_hist-option-greeks_second_order
      description: |
        ## Behavior

        - Returns the data for all contracts that share the same provided root 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/get-hist-option-quote) endpoint. 
        - The underlying price represents whatever the last underlying price was at the ``ms_of_day`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/greeks_second_order?root=AAPL&exp=20230915&start_date=20230911&end_date=20230911&ivl=90000](http://127.0.0.1:25510/v2/bulk_hist/option/greeks_second_order?root=AAPL&exp=20230915&start_date=20230911&end_date=20230911&ivl=90000)

      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/annual_div"
        - $ref: "#/components/parameters/rate"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/ivl"
        - $ref: "#/components/parameters/rth"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid","ask","gamma","vanna","charm","vomma","veta","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                            bid:
                              type: number
                              format: double
                              description: The national best bid price.
                            ask:
                              type: number
                              format: double
                              description: The national best ask price.
                            gamma:
                              type: number
                              format: double
                              description: The gamma.
                            vanna:
                              type: number
                              format: double
                              description: The vanna.
                            charm:
                              type: number
                              format: double
                              description: The charm.
                            vomma:
                              type: number
                              format: double
                              description: The vomma.
                            veta:
                              type: number
                              format: double
                              description: The veta.
                            implied_vol:
                              type: number
                              format: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: number
                              format: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: number
                              format: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                        - [34290000,114.9500,115.0500,0.0000,-0.0030,0.4629,0.1727,0.0032,3.3828,0.0000,34289992,179.9400,20230911]
                        - [34380000,115.0500,115.2000,0.0000,-0.0029,0.4606,0.1721,0.0032,3.3828,0.0000,34379988,180.0600,20230911]
                        contract:
                          root: AAPL
                          expiration: 20230915
                          strike: 65000
                          right: C
                      - ticks:
                          - [34290000,109.9500,110.0500,0.0000,-0.0031,0.4459,0.1825,0.0031,3.1015,0.0000,34289992,179.9400,20230911]
                          - [34380000,110.0500,110.1500,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,34379988,180.0600,20230911]
                        contract:
                          root: AAPL
                          expiration: 20230915
                          strike: 70000
                          right: C
      tags:
        - Options
        - 'Bulk Historical Greeks'
    x-min-subscription: pro
  /bulk_hist/option/greeks_third_order:
    get:
      summary: Bulk Greeks Third Order
      operationId: get-bulk_hist-option-greeks_third_order
      description: |
        ## Behavior

        - Returns the data for all contracts that share the same provided root 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/get-hist-option-quote) endpoint. 
        - The underlying price represents whatever the last underlying price was at the ``ms_of_day`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks).


        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/greeks_third_order?root=AAPL&exp=20230915&start_date=20230911&end_date=20230911&ivl=90000](http://127.0.0.1:25510/v2/bulk_hist/option/greeks_third_order?root=AAPL&exp=20230915&start_date=20230911&end_date=20230911&ivl=90000)

      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/annual_div"
        - $ref: "#/components/parameters/rate"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/ivl"
        - $ref: "#/components/parameters/rth"
        - $ref: "#/components/parameters/start_time"
        - $ref: "#/components/parameters/end_time"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","bid","ask","speed","zomma","color","ultima","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                            bid:
                              type: number
                              format: double
                              description: The national best bid price.
                            ask:
                              type: number
                              format: double
                              description: The national best ask price.
                            speed:
                              type: number
                              format: double
                              description: The speed.
                            zomma:
                              type: number
                              format: double
                              description: The zomma.
                            color:
                              type: number
                              format: double
                              description: The color.
                            ultima:
                              type: number
                              format: double
                              description: The ultima.
                            implied_vol:
                              type: number
                              format: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: number
                              format: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: number
                              format: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                        - [34290000,114.9500,115.0500,0.0000,0.0001,-0.0011,0.2671,3.3828,0.0000,34289992,179.9400,20230911]
                        - [34380000,115.0500,115.2000,0.0000,0.0001,-0.0011,0.2667,3.3828,0.0000,34379988,180.0600,20230911]
                        contract:
                          root: AAPL
                          expiration: 20230915
                          strike: 65000
                          right: C
                      - ticks:
                          - [34290000,109.9500,110.0500,0.0000,0.0001,-0.0010,0.3194,3.1015,0.0000,34289992,179.9400,20230911]
                          - [34380000,110.0500,110.1500,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,34379988,180.0600,20230911]
                        contract:
                          root: AAPL
                          expiration: 20230915
                          strike: 70000
                          right: C
      tags:
        - Options
        - 'Bulk Historical Greeks'
    x-min-subscription: pro
  /bulk_hist/option/all_greeks:
    get:
      summary: Bulk All Greeks
      operationId: get-bulk_hist-option-all_greeks
      description: |
        ## Behavior

        - Returns the data for all contracts that share the same provided root and expiration. 
        - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs).
        - The underlying price represents whatever the last underlying price was at the ``ms_of_day`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/all_greeks?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110&ivl=900000](http://127.0.0.1:25510/v2/bulk_hist/option/all_greeks?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110&ivl=900000)

      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/annual_div"
        - $ref: "#/components/parameters/rate"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/ivl"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","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","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp or interval time of the option quote. Milliseconds since 00:00:00.000 (midnight) ET.
                            bid:
                              type: number
                              format: double
                              description: The national best bid price.
                            ask:
                              type: number
                              format: double
                              description: The national best ask price.
                            delta:
                              type: number
                              format: double
                              description: The delta.
                            theta:
                              type: number
                              format: double
                              description: The Theta.
                            vega:
                              type: number
                              format: double
                              description: The vega.
                            rho:
                              type: number
                              format: double
                              description: The rho.
                            epsilon:
                              type: number
                              format: double
                              description: The epsilon.
                            lambda:
                              type: number
                              format: double
                              description: The lambda.
                            gamma:
                              type: number
                              format: double
                              description: The gamma.
                            vanna:
                              type: number
                              format: double
                              description: The vanna.
                            charm:
                              type: number
                              format: double
                              description: The charm.
                            vomma:
                              type: number
                              format: double
                              description: The vomma.
                            veta:
                              type: number
                              format: double
                              description: The veta.
                            vera:
                              type: number
                              format: double
                              description: The vera.
                            speed:
                              type: number
                              format: double
                              description: The speed.
                            zomma:
                              type: number
                              format: double
                              description: The zomma.
                            color:
                              type: number
                              format: double
                              description: The color.
                            ultima:
                              type: number
                              format: double
                              description: The ultima.
                            d1:
                              type: number
                              format: double
                              description: The d1.
                            d2:
                              type: number
                              format: double
                              description: The d2.
                            dual_delta:
                              type: number
                              format: double
                              description: The dual delta.
                            dual_gamma:
                              type: number
                              format: double
                              description: The dual gamma.
                            implied_vol:
                              type: number
                              format: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: number
                              format: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: number
                              format: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                        - [35100000,134.6000,134.9000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0003,35100000,184.7400,20231110]
                        - [36000000,133.9500,135.1000,0.9933,-0.1531,0.4728,0.9290,-3.5088,1.3601,0.0001,-0.0080,0.9062,0.5085,0.0236,0.0000,0.0000,0.0009,-0.0179,0.1852,2.4774,1.8783,-0.9688,0.0008,4.3265,0.0000,36000000,184.1800,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 50000
                          right: C
                      - ticks:
                          - [34200000,0.0000,0.0000,-0.0002,-0.0006,0.0167,-0.0006,0.0006,-57.5498,0.0001,-0.0046,0.0595,0.4199,0.0013,0.0000,0.0000,0.0000,-0.0001,8.0394,3.5808,3.5115,0.0002,0.0000,0.5000,100.0000,34200000,183.8900,20231110]
                          - [35100000,0.0100,0.0200,-0.0020,-0.0073,0.1624,-0.0072,0.0070,-37.8591,0.0003,-0.0277,0.4578,2.0452,0.0086,0.0000,0.0000,0.0000,-0.0008,16.1244,2.8776,2.7893,0.0026,0.0000,0.6374,-0.0225,35100000,184.7400,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 144000
                          right: P
      tags:
        - Options
        - 'Bulk Historical Greeks'
    x-min-subscription: pro
  /bulk_hist/option/all_trade_greeks:
    get:
      summary: Bulk All Trade Greeks
      operationId: get-bulk_hist-option-all_trade_greeks
      description: |
        ## Behavior

        - Returns the data for all contracts that share the same provided root and expiration. 
        - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs).
        - The underlying price represents whatever the last underlying price was at the ``ms_of_day`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks).

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/all_trade_greeks?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110&ivl=900000](http://127.0.0.1:25510/v2/bulk_hist/option/all_trade_greeks?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110&ivl=900000)

      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/annual_div"
        - $ref: "#/components/parameters/rate"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/ivl"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","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","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp of the trade greeks. Milliseconds since 00:00:00.000 (midnight) ET.
                            sequence:
                              type: integer
                              description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                            ext_condition1:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition2:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition3:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition4:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            condition:
                              type: integer
                              description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                            size:
                              type: integer
                              description: The amount of contracts traded.
                            exchange:
                              type: integer
                              description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                            price:
                              type: double
                              description: The trade price.
                            condition_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            price_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            volume_type:
                              type: integer
                              description: Future use. These fields can be ignored.
                            records_back:
                              type: integer
                              description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                            delta:
                              type: number
                              format: double
                              description: The delta.
                            theta:
                              type: number
                              format: double
                              description: The Theta.
                            vega:
                              type: number
                              format: double
                              description: The vega.
                            rho:
                              type: number
                              format: double
                              description: The rho.
                            epsilon:
                              type: number
                              format: double
                              description: The epsilon.
                            lambda:
                              type: number
                              format: double
                              description: The lambda.
                            gamma:
                              type: number
                              format: double
                              description: The gamma.
                            vanna:
                              type: number
                              format: double
                              description: The vanna.
                            charm:
                              type: number
                              format: double
                              description: The charm.
                            vomma:
                              type: number
                              format: double
                              description: The vomma.
                            veta:
                              type: number
                              format: double
                              description: The veta.
                            vera:
                              type: number
                              format: double
                              description: The vera.
                            speed:
                              type: number
                              format: double
                              description: The speed.
                            zomma:
                              type: number
                              format: double
                              description: The zomma.
                            color:
                              type: number
                              format: double
                              description: The color.
                            ultima:
                              type: number
                              format: double
                              description: The ultima.
                            d1:
                              type: number
                              format: double
                              description: The d1.
                            d2:
                              type: number
                              format: double
                              description: The d2.
                            dual_delta:
                              type: number
                              format: double
                              description: The dual delta.
                            dual_gamma:
                              type: number
                              format: double
                              description: The dual gamma.
                            implied_vol:
                              type: number
                              format: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: number
                              format: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: number
                              format: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                        - [57341102,387753922,255,255,255,255,18,5,7,0.0100,0,7,0,0,-0.0014,-0.0079,0.1195,-0.0052,0.0050,-26.3510,0.0001,-0.0142,0.3430,1.0946,0.0080,0.0000,0.0000,0.0000,-0.0008,6.4936,2.9852,2.8562,0.0021,0.0000,0.9312,0.0020,57341093,186.3600,20231110]
                        - [57341103,387753927,255,255,255,255,18,5,60,0.0100,0,1,0,0,-0.0014,-0.0079,0.1195,-0.0052,0.0050,-26.3510,0.0001,-0.0142,0.3430,1.0946,0.0080,0.0000,0.0000,0.0000,-0.0008,6.4936,2.9852,2.8562,0.0021,0.0000,0.9312,0.0020,57341103,186.3600,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 128000
                          right: P
                      - ticks:
                          - [35917535,-1191835614,255,255,255,255,95,4,11,0.0100,0,7,0,0,-0.0016,-0.0082,0.1329,-0.0059,0.0056,-27.8173,0.0002,-0.0168,0.3815,1.2643,0.0085,0.0000,0.0000,0.0000,-0.0009,7.6819,2.9453,2.8242,0.0023,0.0000,0.8750,0.0680,35917504,184.2100,20231110]
                          - [56519914,324561624,255,255,255,255,18,1,7,0.0100,0,1,0,0,-0.0014,-0.0079,0.1257,-0.0055,0.0053,-27.3723,0.0002,-0.0155,0.3596,1.1874,0.0083,0.0000,0.0000,0.0000,-0.0009,7.2255,2.9677,2.8439,0.0022,0.0000,0.8937,0.0196,56519911,186.0800,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 130000
                          right: C
      tags:
        - Options
        - 'Bulk Historical Greeks'
    x-min-subscription: pro
  /bulk_hist/option/trade_greeks:
    get:
      summary: Bulk Trade Greeks
      operationId: get-bulk_hist-option-trade_greeks
      description: |
        ## Behavior 

        - Returns the data for all contracts that share the same provided root and expiration.
        - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs).
        - The underlying price represents whatever the last underlying price was at the ``ms_of_day`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks).
        - ``perf_boost`` can be specified to ``true`` to improve the speed of this request by using 1 second intervals for the underlying quotes instead of tick level quotes.

        ## Sample URL & Code

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/bulk_hist/option/trade_greeks?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110](http://127.0.0.1:25510/v2/bulk_hist/option/trade_greeks?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110)

      parameters:
        - $ref: "#/components/parameters/root"
        - $ref: "#/components/parameters/exp"
        - $ref: "#/components/parameters/start_date"
        - $ref: "#/components/parameters/end_date"
        - $ref: "#/components/parameters/annual_div"
        - $ref: "#/components/parameters/rate"
        - $ref: "#/components/parameters/rate_value"
        - $ref: "#/components/parameters/perf_boost"
        - $ref: "#/components/parameters/use_csv"
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contract objects, each containing tick data and contract details; ["ms_of_day","sequence","ext_condition1","ext_condition2","ext_condition3","ext_condition4","condition","size","exchange","price","condition_flags","price_flags","volume_type","records_back","delta","theta","vega","rho","epsilon","lambda","implied_vol","iv_error","ms_of_day2","underlying_price","date"]
                    items:
                      type: object
                      properties:
                        ticks:
                          type: array
                          description: Array of tick data for the contract.
                          properties:
                            ms_of_day:
                              type: integer
                              description: The exchange timestamp of the trade greeks. Milliseconds since 00:00:00.000 (midnight) ET.
                            sequence:
                              type: integer
                              description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences).
                            ext_condition1:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition2:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition3:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            ext_condition4:
                              type: integer
                              description: Additional trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html)(s). These can be ignored for options.
                            condition:
                              type: integer
                              description: The trade [condition](/Articles/Data-And-Requests/Values/Trade-Conditions.html).
                            size:
                              type: integer
                              description: The amount of contracts traded.
                            exchange:
                              type: integer
                              description: The [exchange](/Articles/Data-And-Requests/Values/Exchanges.html) the trade was executed.
                            price:
                              type: double
                              description: The trade price.
                            condition_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            price_flags:
                              type: integer
                              description: Future use. These fields can be ignored.
                            volume_type:
                              type: integer
                              description: Future use. These fields can be ignored.
                            records_back:
                              type: integer
                              description: Non-zero for trade cancellations and insertions. The value represents the amount of trades prior to the current trade to delete or insert.
                            delta:
                              type: double
                              description: The delta.
                            theta:
                              type: double
                              description: The Theta.
                            vega:
                              type: double
                              description: The vega.
                            rho:
                              type: double
                              description: The rho.
                            epsilon:
                              type: double
                              description: The epsilon.
                            lambda:
                              type: double
                              description: The lambda.
                            implied_vol:
                              type: double
                              description: The implied volatiltiy calculated using the trade price.
                            iv_error:
                              type: double
                              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.
                            ms_of_day2:
                              type: integer
                              description: The exchange timestamp of the underlying quote used. Milliseconds since 00:00:00.000 (midnight) ET.
                            underlying_price:
                              type: double
                              description: The midpoint of the underlying at the time of the option trade.
                            date:
                              type: integer
                              format: date
                              description: The date formated as YYYYMMDD.
                        contract:
                          type: object
                          description: Details of the contract associated with the ticks.
                          properties:
                            root:
                              type: string
                              description: The root symbol of the contract.
                            expiration:
                              type: integer
                              description: Expiration date of the contract in YYYYMMDD format.
                            strike:
                              type: integer
                              description: Strike price of the contract in minor units (e.g., 180000 means $180.00).
                            right:
                              type: string
                              description: Indicates whether the contract is a call or put option.
                              enum: [C, P]
                              example: C
                    example:
                      - ticks:
                        - [56167951,299720858,255,255,255,255,18,1,42,86.1500,0,7,0,0,1.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0004,56167951,186.0900,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 100000
                          right: C
                      - ticks:
                          - [41064023,-745524183,255,255,255,255,125,1,43,79.9000,0,7,0,0,0.9997,-0.0172,0.0230,2.0107,-3.5430,2.3122,1.2000,0.0000,41064019,184.7900,20231110]
                          - [43614362,-561477748,255,255,255,255,125,1,9,79.9700,0,3,0,0,1.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0004,43614340,184.9000,20231110]
                        contract:
                          root: AAPL
                          expiration: 20231117
                          strike: 105000
                          right: C
      tags:
        - Options
        - 'Bulk Historical Greeks'
    x-min-subscription: pro

  /snapshot/index/price:
    get:
      summary: Price Snapshot
      tags:
        - Indices
        - Snapshots
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the price report.Milliseconds since 00:00:00.000 (midnight) ET.
                        price:
                          type: number
                          format: double
                          description: The reported price of the index.
                        date:
                          type: integer
                          format: date
                          description: The date the price report was generated formatted as YYYYMMDD. 
                    example:
                      - [35100000,4735.27,20240102]
      operationId: get-v2-hist-index-snapshot-price
      description: |
        ## Behavior

        - Retrieves a real-time last index price.
        - [Exchanges](/Articles/Data-And-Requests/The-SIPs) typically generate a price report every second for popular indices like SPX.


        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/snapshot/index/price?root=SPX](http://127.0.0.1:25510/v2/snapshot/index/price?root=SPX)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
    x-min-subscription: standard
  /snapshot/index/ohlc:
    get:
      summary: OHLC Snapshot
      tags:
        - Indices
        - Snapshots
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","open","high","low","close","volume","count","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The opening time of the OHLC bar. Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts traded.
                        count:
                          type: integer
                          description: The amount of trades.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [57745000,5891.07,5949.34,5888.66,5942.47,0,0,20250103]
      operationId: get-v2-hist-index-snapshot-ohlc
      description: |
        ## Behavior

        - Retrieves the real-time current day OHLC.
        - [Exchanges](/Articles/Data-And-Requests/The-SIPs) typically generate a price report every second for popular indices like SPX.


        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/snapshot/index/ohlc?root=SPX](http://127.0.0.1:25510/v2/snapshot/index/ohlc?root=SPX)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
    x-min-subscription: standard

  /hist/index/eod:
    get:
      summary: EOD Report
      tags:
        - Indices
        - Historical
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","ms_of_day2","open","high","low","close","volume","count","bid_size","bid_exchange","bid","bid_condition","ask_size","ask_exchange","ask","ask_condition","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the EOD report. Milliseconds since 00:00:00.000 (midnight) ET.
                        ms_of_day2:
                          type: integer
                          description: The time of the closing trade . Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts 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/Data-And-Requests/Values/Exchanges.html).
                        bid:
                          type: double
                          description: The last NBBO bid price.
                        bid_condition:
                          type: integer
                          description: The last NBBO bid [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        ask_size:
                          type: integer
                          description: The last NBBO ask size.
                        ask_exchange:
                          type: integer
                          description: The last NBBO ask [exchange](/Articles/Data-And-Requests/Values/Exchanges.html).
                        ask:
                          type: double
                          description: The last NBBO ask price.
                        ask_condition:
                          type: integer
                          description: The last NBBO ask [condition](/Articles/Data-And-Requests/Values/Quote-Conditions.html).
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [62507968,57748000,4201.27,4245.64,4197.74,4237.86,0,0,0,0,0.00,0,0,0,0.00,0,20231101]
                      - [63082563,57748000,4201.27,4245.64,4197.74,4237.86,0,0,0,0,0.00,0,0,0,0.00,0,20231101]
      operationId: get-v2-hist-index-eod
      description: |
        ## Behavior
        - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs) do not provide a national EOD report, Theta Data generates a national EOD report at 17:15 each day.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/index/eod?root=SPX&start_date=20231101&end_date=20231115](http://127.0.0.1:25510/v2/hist/index/eod?root=SPX&start_date=20231101&end_date=20231115)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
    x-min-subscription: free
  /hist/index/ohlc:
    x-min-subscription: standard
    get:
      summary: OHLC
      tags:
        - Indices
        - Historical
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","open","high","low","close","volume","count","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the report. Milliseconds since 00:00:00.000 (midnight) ET.
                        open:
                          type: double
                          description: The opening trade price.
                        high:
                          type: double
                          description: The highest traded price.
                        low:
                          type: double
                          description: The lowest traded price.
                        close:
                          type: double
                          description: The closing traded price.
                        volume:
                          type: integer
                          description: The amount of contracts traded.
                        count:
                          type: integer
                          description: The amount of trades.
                        date:
                          type: integer
                          format: date
                          description: The date formated as YYYYMMDD.
                    example:
                      - [34200000,4745.20,4745.20,4738.63,4742.78,0,0,20240102]
                      - [34260000,4742.96,4743.28,4741.36,4743.28,0,0,20240102]
      operationId: get-v2-hist-index-ohlc
      description: |
        ## Behavior
        - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD) 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. 
        - [Exchanges](/Articles/Data-And-Requests/The-SIPs) typically generate a price report every second for popular indices like SPX.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/index/ohlc?root=SPX&start_date=20240102&end_date=20240102&ivl=60000](http://127.0.0.1:25510/v2/hist/index/ohlc?root=SPX&start_date=20240102&end_date=20240102&ivl=60000)
      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl_ohlc'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
  /hist/index/price:
    get:
      summary: Price
      tags:
        - Indices
        - Historical
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  header:
                    $ref: "#/components/schemas/header"
                  response:
                    type: array
                    description: A list of contracts, where each item is an array of values matching the `header.format`; ["ms_of_day","price","date"]
                    items:
                      type: array
                      properties:
                        ms_of_day:
                          type: integer
                          description: The time of the price report.Milliseconds since 00:00:00.000 (midnight) ET.
                        price:
                          type: number
                          format: double
                          description: The reported price of the index.
                        date:
                          type: integer
                          format: date
                          description: The date the price report was generated formatted as YYYYMMDD. 
                    example:
                      - [34200000,0.0,20240102]
                      - [35100000,4735.27,20240102]
      operationId: get-v2-hist-index-price
      description: |
        ## Behavior

        - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs) typically generate a price report every second for popular indices like SPX.
        - The highest granularity data available is returned if the ``ivl`` parameter isn't specified.
        - When the ``ivl`` 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.


        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/hist/index/price?root=SPX&start_date=20240102&end_date=20240102&ivl=900000](http://127.0.0.1:25510/v2/hist/index/price?root=SPX&start_date=20240102&end_date=20240102&ivl=900000)

      parameters:
        - $ref: '#/components/parameters/root'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/ivl'
        - $ref: '#/components/parameters/rth'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/use_csv'
        - $ref: "#/components/parameters/pretty_time"
      requestBody:
        content: {}
    x-min-subscription: value

  /file/getting-started:
    get:
      summary: Flat Files
      tags:
        - Flat File (beta)
        - Getting Started
      responses:
        '200':
          description: OK
      operationId: get-v2-flat-file-getting-started
      description: |
        ## Behavior

        - Flat files are only available to pro users. The 7 most recent calendar days of data are available.
        - Data for the previous day should be available around 12:30am - 1am EST.
        - We have tentative plans to ease this limitation in the future.
        - If you are interested in procuring more than the 7 days available, contact sales@thetata.com.
        - A flat file will return the path to the file once it is complete.
        - We strongly recommend using a fast disk for where the terminal is running.


        | Name                 | Sample URL                                                                 | Expected Response Time | Expected Size of CSV |
        |----------------------|-----------------------------------------------------------------------------|-------------------------|------------------------|
        | [Option Trade Quote](/operations/get-v2-flat-file-option-trade-quote.html)   | http://127.0.0.1:25510/v2/file/option/trade_quote?start_date=20250512       | 3 min                  | 1.2 GB                  |
        | [Option Open Interest](/operations/get-v2-flat-file-option-open-interest.html) | http://127.0.0.1:25510/v2/file/option/open_interest?start_date=20250512     | 1 min                  | 50 MB                   |
        | [Option EOD](/operations/get-v2-flat-file-option-eod.html)           | http://127.0.0.1:25510/v2/file/option/eod?start_date=20250512               | 1 min                  | 150 MB                  |
        | [Stock Trade Quote](/operations/get-v2-flat-file-stock-trade-quote.html)    | http://127.0.0.1:25510/v2/file/stock/trade_quote?start_date=20250512        | 30 min                 | 14 GB                   |
        | [Stock EOD](/operations/get-v2-flat-file-stock-eod.html)            | http://127.0.0.1:25510/v2/file/stock/eod?start_date=20250512                | 1 sec                  | 1.5 MB                  |
        
        ### Current Roadmap:
        1. Ability to change your download directory
        2. Quote 1 minute intervals
        3. Halts, Dividends, and splits
        4. Increase amount of history accessible
 

      requestBody:
        content: {}
    x-min-subscription: pro
  /file/option/trade_quote:
    get:
      summary: Trade Quote
      tags:
        - Flat File (beta)
        - Options
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: "C:\\Users\\userName\\ThetaData\\ThetaTerminal\\downloads\\OPTION-TRADE_QUOTE-20250512.csv"
      operationId: get-v2-flat-file-option-trade-quote
      description: |
        ## Behavior

        Returns the data for all contracts that share the same provided root and expiration. 
        Returns every [trade](/operations/get-hist-option-trade) reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) paired with the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) at the time of trade.
        A quote is matched with a trade if its timestamp ``<`` the trade timestamp.

        - Expected response time: ~3 minutes
        - Expected File Size: ~1.2 GB


        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/file/option/trade_quote?start_date=20250512](http://127.0.0.1:25510/v2/file/option/trade_quote?start_date=20250512)

      parameters:
        - $ref: '#/components/parameters/start_date'
      requestBody:
        content: {}
    x-min-subscription: pro
  /file/option/open_interest:
    get:
      summary: Open Interest
      tags:
        - Flat File (beta)
        - Options
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: "C:\\Users\\userName\\ThetaData\\ThetaTerminal\\downloads\\OPTION-OPEN_INTEREST-20250512.csv"
      operationId: get-v2-flat-file-option-open-interest
      description: |
        ## Behavior

        Returns the data for all contracts that share the same provided root and expiration.
        Open Interest is reported by [OPRA](/Articles/Data-And-Requests/The-SIPs) at approximately 06:30 ET. A new open interest message might not be sent by [OPRA](/Articles/Data-And-Requests/The-SIPs) 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.

        - Expected response time: ~1 minute
        - Expected File Size: ~50 MB


        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/file/option/open_interest?start_date=20250512](http://127.0.0.1:25510/v2/file/option/open_interest?start_date=20250512)

      parameters:
        - $ref: '#/components/parameters/start_date'
      requestBody:
        content: {}
    x-min-subscription: pro
  /file/option/eod:
    get:
      summary: EOD
      tags:
        - Flat File (beta)
        - Options
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: "C:\\Users\\userName\\ThetaData\\ThetaTerminal\\downloads\\OPTION-EOD-20250512.csv"
      operationId: get-v2-flat-file-option-eod
      description: |
        ## Behavior

        Returns the data for all contracts that share the same provided root and expiration.
        Since [OPRA](/Articles/Data-And-Requests/The-SIPs) does not provide a national EOD report for options, Thetadata generates a national EOD report at 17:15 ET each day.
        ``ms_of_day`` represents the time of day the report was generated and ``ms_of_day2`` represents the time 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).

        - Expected response time: ~1 minute
        - Expected File Size: ~150 MB


        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/file/option/eod?start_date=20250512](http://127.0.0.1:25510/v2/file/option/eod?start_date=20250512)

      parameters:
        - $ref: '#/components/parameters/start_date'
      requestBody:
        content: {}
    x-min-subscription: pro
  /file/stock/trade_quote:
    get:
      summary: Trade Quote
      tags:
        - Flat File (beta)
        - Stocks
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: "C:\\Users\\userName\\ThetaData\\ThetaTerminal\\downloads\\STOCK-TRADE_QUOTE-20250512.csv"
      operationId: get-v2-flat-file-stock-trade-quote
      description: |
        ## Behavior

        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.
        

        - Expected response time: ~30 minutes
        - Expected File Size: ~14 GB


        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/file/stock/trade_quote?start_date=20250512](http://127.0.0.1:25510/v2/file/stock/trade_quote?start_date=20250512)

      parameters:
        - $ref: '#/components/parameters/start_date'
      requestBody:
        content: {}
    x-min-subscription: pro
  /file/stock/eod:
    get:
      summary: EOD
      tags:
        - Flat File (beta)
        - Stocks
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: "C:\\Users\\userName\\ThetaData\\ThetaTerminal\\downloads\\STOCK-EOD-20250512.csv"
      operationId: get-v2-flat-file-stock-eod
      description: |
        ## Behavior

        Since [the equity SIPs](/Articles/Data-And-Requests/The-SIPs) only generate a partial EOD report, Theta Data generates a national EOD report at 17:15 ET each day.
        ``ms_of_day`` represents the time of day the report was generated and ``ms_of_day2`` represents the time of the last trade.
        The quote in the response represents the last NBBO reported by [CTA or UTP](/Articles/Data-And-Requests/The-SIPs) at the time of report generation.
        You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD). 

        - Expected response time: ~1 second
        - Expected File Size: ~1.5 MB


        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.


        [http://127.0.0.1:25510/v2/file/stock/eod?start_date=20250512](http://127.0.0.1:25510/v2/file/stock/eod?start_date=20250512)

      parameters:
        - $ref: '#/components/parameters/start_date'
      requestBody:
        content: {}
    x-min-subscription: pro

  /system/mdds/status:
    get:
      summary: Connection Status (MDDS)
      tags:
        - 'System Commands'
      parameters: []
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                description: The connectivity status.
                enum:
                  - CONNECTED
                  - UNVERIFIED
                  - DISCONNECTED
                  - ERROR
      operationId: get-v2-system-mdds-status
      description: |
        ## Behavior

        - Returns the connectivity to Theta Data [MDDS](/Articles/Getting-Started/Introduction#market-data-distribution-server-mdds).

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.

        [http://127.0.0.1:25510/v2/system/mdds/status](http://127.0.0.1:25510/v2/system/mdds/status)

        Response      | Definition 
        --------------|--------------
         CONNECTED    | The terminal is connected.
         UNVERIFIED   | The terminal was able to connect but the credentials could not be authenticated.
         DISCONNECTED | The terminal is not connected to MDDS.
         ERROR        | Some undefined error occurred while making this request. Check terminal log.
    x-min-subscription: free
  /system/terminal/shutdown:
    get:
      summary: Shutdown
      tags:
        - 'System Commands'
      parameters: []
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
      operationId: get-v2-system-shutdown
      description: |
        ## Behavior

        - Kills the Theta Terminal process immediately upon calling. Returns a placeholder string for future use.

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.

        [http://127.0.0.1:25510/v2/system/terminal/shutdown](http://127.0.0.1:25510/v2/system/terminal/shutdown)
    x-min-subscription: free
  /system/fpss/status:
    get:
      summary: Connection Status (FPSS)
      tags:
        - 'System Commands'
      parameters: []
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                description: The connectivity status.
                enum:
                  - CONNECTED
                  - UNVERIFIED
                  - DISCONNECTED
                  - ERROR
      operationId: get-v2-system-fpss-status
      description: |
        ## Behavior

        - Returns the connectivity to Theta Data [FPSS](/Articles/Getting-Started/Introduction#market-data-distribution-server-mdds).

        ## Sample URL

        Paste the URL below into your browser while the Theta Terminal is running.

        [http://127.0.0.1:25510/v2/system/fpss/status](http://127.0.0.1:25510/v2/system/fpss/status)

        Response      | Definition 
        --------------|--------------
         CONNECTED    | The terminal is connected.
         UNVERIFIED   | The terminal was able to connect but the credentials could not be authenticated.
         DISCONNECTED | The terminal is not connected to FPSS.
         ERROR        | Some undefined error occurred while making this request. Check terminal log.

    x-min-subscription: free

components:
  schemas:
    header:
      type: object
      description: "The response to the request made. If there is a caught error, the error_type field won't be null."
      properties:
        id:
          type: integer
          format: int64
          description: The request id. This is incremented each time a request is made.
          readOnly: true
        latency_ms:
          type: integer
          description: The time in milliseconds it took for the server to respond to the request. This does not account for the time it takes the Theta Terminal to locally send the data over HTTP via this API.
        error_type:
          type: string
          description: 'The error type. If this field is null, no error occurred.'
        error_msg:
          type: string
          description: Additional information about the error if available.
        format:
          type: array
          items:
              type: string
          description: The order of fields in each inner array of the response.

  parameters:
    sec:
      name: sec
      in: path
      description: The security type.
      required: true
      schema:
        type: string
        enum:
          - option
          - stock
          - index
    req:
      name: req
      in: path
      description: The request type.
      required: true
      schema:
        type: string
        enum:
          - trade
          - quote
    root:
      name: root
      in: query
      required: true
      schema:
        type: string
        example: SPX
        minLength: 1
      description: 'The symbol of the security. Option underlyings for indices might have [special tickers](/Articles/Data-And-Requests/The-SIPs#index-option-symbology). '
    start_date:
      name: start_date
      in: query
      required: true
      schema:
        type: integer
        pattern: YYYYMMDD
        example: 20230915
        minLength: 8
        maxLength: 8
        format: date
      description: The start date (inclusive) of the request formatted as YYYYMMDD.
    end_date:
      name: end_date
      in: query
      required: true
      schema:
        type: integer
        pattern: YYYYMMDD
        minLength: 8
        maxLength: 8
        format: date
        example: 20230915
      description: The end date (inclusive) of the request formatted as YYYYMMDD.
    start_time:
      name: start_time
      in: query
      required: false
      schema:
        type: string
        example: '300000000'
        minLength: 0
      description: 'If specified, the response will include all ticks on or after this number of milliseconds since midnight ET.'
    end_time:
      name: end_time
      in: query
      required: false
      schema:
        type: string
      description: 'If specified, the response will include all ticks on or before this number of milliseconds since midnight ET.'
    use_csv:
      name: use_csv
      in: query
      required: false
      schema:
        type: boolean
        default: false
        example: false
      description: 'Output is in comma-separated values if `true`, legacy JSON if `false`.'
    ivl:
      name: ivl
      in: query
      required: false
      schema:
        type: integer
        minimum: 0
        maximum: 3600000
        example: 900000
        default: 0
      description: The interval size in milliseconds. 1 minute intervals is ``60000``. Omitting this value or setting it to ``0``will provide tick-level data instead of aggregated / intervalized data.
    ivl_ohlc:
      name: ivl
      in: query
      required: true
      schema:
        type: integer
        minimum: 100
        maximum: 3600000
        example: 900000
      description: The interval size in milliseconds. 1 minute intervals is ``60000``.
    ivl_at_time:
      name: ivl
      in: query
      required: false
      schema:
        type: integer
        minimum: 0
        maximum: 3600000
        example: 900000
        default: 0
      description: "The number of milliseconds since 00:00:00.000 ET. Example: 09:30:00 ET = ``34200000`` & 16:00:00 ET = ``57600000``."
    rth:
      name: rth
      in: query
      required: false
      schema:
        type: boolean
        default: true
        example: true
      description: 'If this value is set to ``false`` and the request is for aggregated / intervalized data, the response will contain intervals from 00:00:000 ET to 23:59:999 ET. If the ``ivl`` is ``0`` or is unspecified, then rth will be forced to ``false``. This means that all data for the day, even if it was outside regular trading hours would be returned.  The default behavior is to only return data during regular trading hours (09:30:00.000 ET to 16:00.000 ET).'
    venue:
      name: venue
      in: query
      required: false
      schema:
        type: string
        enum:
          - nqb
          - utp_cta
        default: nqb
      description: Used to specify the venue of the real time or historic request. ``nqb`` = Nasdaq Basic; ``utp_cta`` = merged UTP & CTA.
    exclusive:
      name: exclusive
      in: query
      required: false
      schema:
        type: boolean
        default: false
        example: true
      description: ' If you prefer to match quotes with timestamps that are < the trade timestamp, specify this  parameter to true. This parameter only works with the trade_quote endpoint.'
    exp:
      name: exp
      in: query
      schema:
        type: integer
        format: date
        example: 20231103
        minLength: 8
        maxLength: 8
        pattern: YYYYMMDD
      description: The expiration date of the option contract formatted as YYYYMMDD.
      required: true
    right:
      name: right
      in: query
      schema:
        type: string
        enum:
          - C
          - P
        example: C
        default: C
      description: The right of the option. 'C' for call; 'P' for put.
      required: true
    op_right:
      name: right
      in: query
      schema:
        type: string
        enum:
          - C
          - P
        example: C
        default: C
      description: The right of the option. 'C' for call; 'P' for put.
      required: false
    strike:
      name: strike
      in: query
      required: true
      schema:
        type: integer
        minLength: 1
        maxLength: 10
        example: 170000
      description: The strike price in 1/10th of a cent. A $170.00 strike price would be 170000.
    op_strike:
      name: strike
      in: query
      required: false
      schema:
        type: integer
        minLength: 1
        maxLength: 10
        example: 170000
      description: The strike price in 1/10th of a cent. A $170.00 strike price would be 170000.
    perf_boost:
      name: perf_boost
      in: query
      schema:
        type: boolean
        default: false
        example: true
      description: 'If true: 1 second intervals for the underlying equity will be used to calcualte the stock price at the time of each option trade instead of using  tick-level equity NBBO. This significantly improves performance as there are much less rows of data that have to be processed per request. This flag only works with the trade greeks endpoints.'
    annual_div:
      name: annual_div
      in: query
      required: false
      schema:
        type: number
        example: 4.24
        minimum: 0
      description: The annualized expected dividend amount to be used in Greeks calculations.
    under_price:
      name: under_price
      in: query
      schema:
        type: number
        format: double
        example: 190.42
        minimum: 0
      description: The underlying price to be used in the Greeks calculation for a snapshot.
      allowEmptyValue: false
    rate_value:
      name: rate_value
      in: query
      required: false
      schema:
        type: number
        format: double
        minimum: 0
      description: The annualized interest rate value to be used in a Greeks calculation. A 3.42% interest rate would be represented as .0342. This will override the ``rate`` parameter if it is specified.
    pretty_time:
      name: pretty_time
      in: query
      required: false
      schema:
        type: boolean
        default: false
        example: true
      description: 'If this value is set to ``true``, ms_of_day and date will take the format of 09:30:00.000 and 2020-01-01; if set to ``false``, ms_of_day will return the timestamp in milliseconds since midnight EST.'
    rate:
      name: rate
      in: query
      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
        example: SOFR
      description: The interest rate type to be used in a Greeks calculation. Omitting this parameter will default to SOFR or 0 if no rate exists for the date in question.
