Alpaca Option API

Endpoints for option data.

Operations 8

GET /v1beta1/options/bars Historical bars #
GET /v1beta1/options/meta/conditions/{ticktype} Condition codes #
GET /v1beta1/options/meta/exchanges Exchange codes #
GET /v1beta1/options/quotes/latest Latest quotes #
GET /v1beta1/options/snapshots Snapshots #
GET /v1beta1/options/snapshots/{underlying_symbol} Option chain #
GET /v1beta1/options/trades Historical trades #
GET /v1beta1/options/trades/latest Latest trades #

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-account-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-order-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-position-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-option-contract-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-assets-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-create-order-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-trade-account-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-account-extended-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-account-creation-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-trade-update-event-v2-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-ipoevent-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-corporate-action-event-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-movers-resp-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-fixed-income-latest-quotes-resp-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-most-actives-resp-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-fixed-income-latest-prices-resp-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-stock-auctions-resp-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-token-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-token-response-schema.json
📊
JSONSchema
https://artifacts.apis.io/alpaca/json-schema/alpaca-corporate-actions-resp-schema.json

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/alpaca:alpaca-option-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

alpaca-option-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: support@alpaca.markets
    name: Alpaca Support
    url: https://alpaca.markets/support
  description: Access real-time and historical market data for US equities, options, crypto, and foreign exchange data through the Alpaca REST and WebSocket APIs. There are APIs for Stock Pricing, Option Pricing, Crypto Pricing, Forex, Logos, Fixed income, Corporate Actions, Screener, and News.
  license:
    name: Creative Commons Attribution Share Alike 4.0 International
    url: https://spdx.org/licenses/CC-BY-SA-4.0.html
  termsOfService: https://s3.amazonaws.com/files.alpaca.markets/disclosures/library/TermsAndConditions.pdf
  title: Market Data Option API
  version: '1.1'
servers:
- description: Production
  url: https://data.alpaca.markets
- description: Sandbox
  url: https://data.sandbox.alpaca.markets
tags:
- description: Endpoints for option data.
  name: Option
paths:
  /v1beta1/options/bars:
    get:
      description: 'The historical option bars API provides aggregates for a list of option symbols between the specified dates.


        The returned results are sorted by symbol first, then by bar timestamp.

        This means that you are likely to see only one symbol in your first response if there are enough bars for that symbol to hit the limit you requested.


        In these situations, if you keep requesting again with the `next_page_token` from the previous response, you will eventually reach the other symbols if any bars were found for them.'
      operationId: optionBars
      parameters:
      - $ref: '#/components/parameters/option_symbols'
      - $ref: '#/components/parameters/timeframe'
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/end'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/page_token'
      - $ref: '#/components/parameters/sort'
      responses:
        '200':
          content:
            application/json:
              examples:
                bars:
                  value:
                    bars:
                      AAPL240419P00140000:
                      - c: 0.34
                        h: 0.38
                        l: 0.34
                        n: 7
                        o: 0.38
                        t: '2024-01-18T05:00:00Z'
                        v: 12
                        vw: 0.3525
                    next_page_token: QUFQTHxNfDIwMjItMDEtMDNUMDk6MDA6MDAuMDAwMDAwMDAwWg==
              schema:
                $ref: '#/components/schemas/option_bars_resp'
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/ratelimit_limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/ratelimit_remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/ratelimit_reset'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
      - apiKey: []
        apiSecret: []
      - BasicAuth: []
      summary: Historical bars
      tags:
      - Option
  /v1beta1/options/meta/conditions/{ticktype}:
    get:
      description: Returns the mapping between the condition codes and names.
      operationId: OptionMetaConditions
      parameters:
      - description: The type of ticks.
        in: path
        name: ticktype
        required: true
        schema:
          enum:
          - trade
          - quote
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/option_conditions'
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/ratelimit_limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/ratelimit_remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/ratelimit_reset'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
      - apiKey: []
        apiSecret: []
      - BasicAuth: []
      summary: Condition codes
      tags:
      - Option
  /v1beta1/options/meta/exchanges:
    get:
      description: Returns the mapping between the option exchange codes and the corresponding exchange names.
      operationId: OptionMetaExchanges
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/option_exchanges'
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/ratelimit_limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/ratelimit_remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/ratelimit_reset'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
      - apiKey: []
        apiSecret: []
      - BasicAuth: []
      summary: Exchange codes
      tags:
      - Option
  /v1beta1/options/quotes/latest:
    get:
      description: The latest multi-quotes endpoint provides the latest bid and ask prices for each given contract symbol.
      operationId: OptionLatestQuotes
      parameters:
      - $ref: '#/components/parameters/option_symbols'
      - $ref: '#/components/parameters/option_feed'
      responses:
        '200':
          content:
            application/json:
              examples:
                quotes:
                  value:
                    quotes:
                      AAPL240419P00140000:
                        ap: 0.16
                        as: 669
                        ax: w
                        bp: 0.15
                        bs: 164
                        bx: W
                        c: A
                        t: '2024-02-28T15:30:28.046330624Z'
                      AAPL250321C00190000:
                        ap: 17
                        as: 622
                        ax: X
                        bp: 16.75
                        bs: 368
                        bx: X
                        c: ' '
                        t: '2024-02-28T15:47:13.663636224Z'
              schema:
                $ref: '#/components/schemas/option_latest_quotes_resp'
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/ratelimit_limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/ratelimit_remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/ratelimit_reset'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
      - apiKey: []
        apiSecret: []
      - BasicAuth: []
      summary: Latest quotes
      tags:
      - Option
  /v1beta1/options/snapshots:
    get:
      description: The snapshots endpoint provides the latest trade, latest quote and greeks for each given contract symbol.
      operationId: OptionSnapshots
      parameters:
      - $ref: '#/components/parameters/option_symbols'
      - $ref: '#/components/parameters/option_feed'
      - $ref: '#/components/parameters/option_updated_since'
      - $ref: '#/components/parameters/option_snapshot_limit'
      - $ref: '#/components/parameters/page_token'
      responses:
        '200':
          content:
            application/json:
              examples:
                snapshots:
                  value:
                    next_page_token: QUFQTDI0MDYyMTAwMDIyMHwx
                    snapshots:
                      AAPL240426C00162500:
                        greeks:
                          delta: 0.7521304109871954
                          gamma: 0.06241426404871288
                          rho: 0.009910739032549095
                          theta: -0.2847623059595503
                          vega: 0.047540520834498785
                        impliedVolatility: 0.3372405712050441
                        latestQuote:
                          ap: 4.3
                          as: 91
                          ax: B
                          bp: 4.15
                          bs: 16
                          bx: C
                          c: A
                          t: '2024-04-22T19:59:59.992734208Z'
                        latestTrade:
                          c: I
                          p: 4.1
                          s: 1
                          t: '2024-04-22T19:57:32.589554432Z'
                          x: A
              schema:
                $ref: '#/components/schemas/option_snapshots_resp'
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/ratelimit_limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/ratelimit_remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/ratelimit_reset'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
      - apiKey: []
        apiSecret: []
      - BasicAuth: []
      summary: Snapshots
      tags:
      - Option
  /v1beta1/options/snapshots/{underlying_symbol}:
    get:
      description: The option chain endpoint provides the latest trade, latest quote, and greeks for each contract symbol of the underlying symbol.
      operationId: OptionChain
      parameters:
      - $ref: '#/components/parameters/option_underlying_symbol'
      - $ref: '#/components/parameters/option_feed'
      - $ref: '#/components/parameters/option_snapshot_limit'
      - $ref: '#/components/parameters/option_updated_since'
      - $ref: '#/components/parameters/page_token'
      - description: Filter contracts by the type (call or put).
        in: query
        name: type
        schema:
          enum:
          - call
          - put
          type: string
      - description: Filter contracts with strike price greater than or equal to the specified value.
        in: query
        name: strike_price_gte
        schema:
          format: double
          type: number
      - description: Filter contracts with strike price less than or equal to the specified value.
        in: query
        name: strike_price_lte
        schema:
          format: double
          type: number
      - description: 'Filter contracts by the exact expiration date (format: YYYY-MM-DD).'
        in: query
        name: expiration_date
        schema:
          format: date
          type: string
      - description: Filter contracts with expiration date greater than or equal to the specified date.
        in: query
        name: expiration_date_gte
        schema:
          format: date
          type: string
      - description: Filter contracts with expiration date less than or equal to the specified date.
        in: query
        name: expiration_date_lte
        schema:
          format: date
          type: string
      - description: Filter contracts by the root symbol.
        example: AAPL1
        in: query
        name: root_symbol
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                snapshots:
                  value:
                    next_page_token: QUFQTDI0MDYyMTAwMDIyMHwx
                    snapshots:
                      AAPL240426C00162500:
                        greeks:
                          delta: 0.7521304109871954
                          gamma: 0.06241426404871288
                          rho: 0.009910739032549095
                          theta: -0.2847623059595503
                          vega: 0.047540520834498785
                        impliedVolatility: 0.3372405712050441
                        latestQuote:
                          ap: 4.3
                          as: 91
                          ax: B
                          bp: 4.15
                          bs: 16
                          bx: C
                          c: A
                          t: '2024-04-22T19:59:59.992734208Z'
                        latestTrade:
                          c: I
                          p: 4.1
                          s: 1
                          t: '2024-04-22T19:57:32.589554432Z'
                          x: A
              schema:
                $ref: '#/components/schemas/option_snapshots_resp'
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/ratelimit_limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/ratelimit_remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/ratelimit_reset'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
      - apiKey: []
        apiSecret: []
      - BasicAuth: []
      summary: Option chain
      tags:
      - Option
  /v1beta1/options/trades:
    get:
      description: 'The historical option trades API provides trade data for a list of contract symbols between the specified dates.


        The returned results are sorted by symbol first then by trade timestamp.

        This means that you are likely to see only one symbol in your first response if there are enough trades for that symbol to hit the limit you requested.


        In these situations, if you keep requesting again with the `next_page_token` from the previous response, you will eventually reach the other symbols if any trades were found for them.'
      operationId: OptionTrades
      parameters:
      - $ref: '#/components/parameters/option_symbols'
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/end'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/page_token'
      - $ref: '#/components/parameters/sort'
      responses:
        '200':
          content:
            application/json:
              examples:
                trades:
                  value:
                    next_page_token: QUFQTHwyMDIyLTAxLTAzVDA5OjAwOjAwLjI0NDgzOTY4MFp8UHwwOTIyMzM3MjAzNjg1NDc3NTgxMA==
                    trades:
                      AAPL240112C00182500:
                      - c: I
                        p: 0.37
                        s: 1
                        t: '2024-01-18T15:03:44.56339456Z'
                        x: B
                      - c: g
                        p: 0.34
                        s: 1
                        t: '2024-01-18T16:02:38.994758144Z'
                        x: C
              schema:
                $ref: '#/components/schemas/option_trades_resp'
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/ratelimit_limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/ratelimit_remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/ratelimit_reset'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
      - apiKey: []
        apiSecret: []
      - BasicAuth: []
      summary: Historical trades
      tags:
      - Option
  /v1beta1/options/trades/latest:
    get:
      description: The latest multi-trades endpoint provides the latest historical trade data for multiple given contract symbols.
      operationId: OptionLatestTrades
      parameters:
      - $ref: '#/components/parameters/option_symbols'
      - $ref: '#/components/parameters/option_feed'
      responses:
        '200':
          content:
            application/json:
              examples:
                trades:
                  value:
                    trades:
                      AAPL250321C00190000:
                        c: e
                        p: 17.15
                        s: 900
                        t: '2024-02-28T15:26:12.728701696Z'
                        x: B
              schema:
                $ref: '#/components/schemas/option_latest_trades_resp'
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/ratelimit_limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/ratelimit_remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/ratelimit_reset'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
      - apiKey: []
        apiSecret: []
      - BasicAuth: []
      summary: Latest trades
      tags:
      - Option
components:
  parameters:
    page_token:
      description: 'The pagination token from which to continue. The value to pass here is returned in specific requests when more data is available, usually because of a response result limit.

        '
      in: query
      name: page_token
      schema:
        type: string
    start:
      description: 'The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD.

        Default: the beginning of the current day, but at least 15 minutes ago if the user doesn''t have real-time access for the feed.

        '
      examples:
        RFC-3339 nanosecond:
          summary: RFC-3339 date-time with nanosecond accuracy
          value: '2024-01-03T01:02:03.123456789Z'
        RFC-3339 second:
          summary: RFC-3339 date-time with second accuracy
          value: '2024-01-03T00:00:00Z'
        RFC-3339 with timezone:
          summary: RFC-3339 date-time with time zone
          value: '2024-01-03T09:30:00-04:00'
        date:
          summary: Date
          value: '2024-01-03'
      in: query
      name: start
      required: false
      schema:
        format: date-time
        type: string
    option_symbols:
      description: A comma-separated list of contract symbols with a limit of 100.
      example: AAPL241220C00300000,AAPL240315C00225000
      in: query
      name: symbols
      required: true
      schema:
        type: string
    option_updated_since:
      description: 'Filter to snapshots that were updated since this timestamp, meaning that the timestamp of the trade or the quote is greater than or equal to this value.

        Format: RFC-3339 or YYYY-MM-DD. If missing, all values are returned.

        '
      in: query
      name: updated_since
      required: false
      schema:
        format: date-time
        type: string
    option_snapshot_limit:
      description: 'Number of maximum snapshots to return in a response.

        The limit applies to the total number of data points, not the number per symbol!

        Use `next_page_token` to fetch the next set of responses.

        '
      in: query
      name: limit
      schema:
        default: 100
        maximum: 1000
        minimum: 1
        type: integer
    option_feed:
      description: 'The source feed of the data. `opra` is the official OPRA feed, `indicative` is a free indicative feed where trades are delayed and quotes are modified. Default: `opra` if the user has a subscription, otherwise `indicative`.

        '
      in: query
      name: feed
      schema:
        $ref: '#/components/schemas/option_feed'
    limit:
      description: 'The maximum number of data points to return in the response page.

        The API may return less, even if there are more available data points in the requested interval.

        Always check the `next_page_token` for more pages.

        The limit applies to the total number of data points, not per symbol!

        '
      in: query
      name: limit
      required: false
      schema:
        default: 1000
        maximum: 10000
        minimum: 1
        type: integer
    timeframe:
      description: "The timeframe represented by each bar in aggregation.\nYou can use any of the following values:\n - `[1-59]Min` or `[1-59]T`, e.g. `5Min` or `5T` creates 5-minute aggregations\n - `[1-23]Hour` or `[1-23]H`, e.g. `12Hour` or `12H` creates 12-hour aggregations\n - `1Day` or `1D` creates 1-day aggregations\n - `1Week` or `1W` creates 1-week aggregations\n - `[1,2,3,4,6,12]Month` or `[1,2,3,4,6,12]M`, e.g. `3Month` or `3M` creates 3-month aggregations\n"
      example: 1Min
      in: query
      name: timeframe
      required: true
      schema:
        type: string
    sort:
      description: Sort data in ascending or descending order.
      in: query
      name: sort
      schema:
        allOf:
        - type: string
        - $ref: '#/components/schemas/sort'
    option_underlying_symbol:
      description: The financial instrument on which an option contract is based or derived.
      example: AAPL
      in: path
      name: underlying_symbol
      required: true
      schema:
        type: string
    end:
      description: 'The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD.

        Default: the current time if the user has a real-time access for the feed, otherwise 15 minutes before the current time.

        '
      examples:
        RFC-3339 nanosecond:
          summary: RFC-3339 date-time with nanosecond accuracy
          value: '2024-01-04T01:02:03.123456789Z'
        RFC-3339 second:
          summary: RFC-3339 date-time with second accuracy
          value: '2024-01-04T00:00:00Z'
        RFC-3339 with timezone:
          summary: RFC-3339 date-time with time zone
          value: '2024-01-04T09:30:00-04:00'
        date:
          summary: Date
          value: '2024-01-04'
      in: query
      name: end
      required: false
      schema:
        format: date-time
        type: string
  responses:
    '403':
      description: 'The requested resource is forbidden.

        '
    '400':
      description: 'One of the request parameters is invalid. See the returned message for details.

        '
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/ratelimit_limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/ratelimit_remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/ratelimit_reset'
    '401':
      description: 'Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key.

        '
    '500':
      description: 'Internal server error. We recommend retrying these later. If the issue persists, please contact us on [Slack](https://alpaca.markets/slack) or on the [Community Forum](https://forum.alpaca.markets/).

        '
    '429':
      description: 'Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you''re under the rate limit.

        '
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/ratelimit_limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/ratelimit_remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/ratelimit_reset'
  schemas:
    timestamp:
      description: Timestamp in RFC-3339 format with nanosecond precision.
      format: date-time
      type: string
    sort:
      default: asc
      description: Sort data in ascending or descending order.
      enum:
      - asc
      - desc
      type: string
    option_conditions:
      additionalProperties:
        type: string
      examples:
      - a: SLAN - Single Leg Auction Non ISO
        e: SLFT - Single Leg Floor Trade
        g: MLAT - Multi Leg Auction
      type: object
    option_latest_trades_resp:
      properties:
        trades:
          additionalProperties:
            $ref: '#/components/schemas/option_trade'
          type: object
      required:
      - trades
      type: object
    option_snapshot:
      description: A snapshot provides the latest trade and latest quote.
      properties:
        dailyBar:
          $ref: '#/components/schemas/option_bar'
        greeks:
          $ref: '#/components/schemas/option_greeks'
        impliedVolatility:
          description: Implied volatility calculated using the Black-Scholes model.
          format: double
          type: number
        latestQuote:
          $ref: '#/components/schemas/option_quote'
        latestTrade:
          $ref: '#/components/schemas/option_trade'
        minuteBar:
          $ref: '#/components/schemas/option_bar'
        prevDailyBar:
          $ref: '#/components/schemas/option_bar'
      type: object
    option_exchanges:
      additionalProperties:
        type: string
      examples:
      - A: NYSE American Options
        Q: Nasdaq Options
      type: object
    option_feed:
      default: opra
      enum:
      - opra
      - indicative
      type: string
    option_bar:
      description: OHLC aggregate of all the trades in a given interval.
      examples:
      - c: 0.23
        h: 0.28
        l: 0.23
        n: 26
        o: 0.28
        t: '2024-01-18T05:00:00Z'
        v: 224
        vw: 0.245045
      properties:
        c:
          description: Closing price.
          format: double
          type: number
        h:
          description: High price.
          format: double
          type: number
        l:
          description: Low price.
          format: double
          type: number
        n:
          description: Trade count in the bar.
          format: int64
          type: integer
        o:
          description: Opening price.
          format: double
          type: number
        t:
          $ref: '#/components/schemas/timestamp'
        v:
          description: Bar volume.
          format: int64
          type: integer
        vw:
          description: Volume weighted average price.
          format: double
          type: number
      required:
      - t
      - o
      - h
      - l
      - c
      - v
      - n
      - vw
      type: object
    option_greeks:
      description: The greeks for the contract calculated using the Black-Scholes model.
      properties:
        delta:
          format: double
          type: number
        gamma:
          format: double
          type: number
        rho:
          format: double
          type: number
        theta:
          format: double
          type: number
        vega:
          format: double
          type: number
      required:
      - delta
      - gamma
      - theta
      - vega
      - rho
      type: object
    option_snapshots_resp:
      properties:
        next_page_token:
          $ref: '#/components/schemas/next_page_token'
        snapshots:
          additionalProperties:
            $ref: '#/components/schemas/option_snapshot'
          type: object
      required:
      - snapshots
      - next_page_token
      type: object
    option_bars_resp:
      properties:
        bars:
          additionalProperties:
            items:
              $ref: '#/components/schemas/option_bar'
            type: array
          type: object
        currency:
          type: string
        next_page_token:
          $ref: '#/components/schemas/next_page_token'
      required:
      - bars
      - next_page_token
      type: object
    option_trades_resp:
      properties:
        currency:
          type: string
        next_page_token:
          $ref: '#/components/schemas/next_page_token'
        trades:
          additionalProperties:
            items:
              $ref: '#/components/schemas/option_trade'
            type: array
          type: object
      required:
      - trades
      - next_page_token
      type: object
    option_trade:
      description: An option trade.
      examples:
      - c: I
        p: 0.37
        s: 1
        t: '2024-01-18T15:03:44.56339456Z'
        x: B
      properties:
        c:
          description: Trade condition.
          type: string
        p:
          description: Trade price.
          format: double
          type: number
        s:
          description: Trade size.
          format: uint32
          type: integer
        t:
          $ref: '#/components/schemas/timestamp'
        x:
          type: string
      required:
      - t
      - x
      - p
      - s
      - c
      type: object
    option_latest_quotes_resp:
      properties:
        quotes:
          additionalProperties:
            $ref: '#/components/schemas/option_quote'
          type: object
      required:
      - quotes
      type: object
    option_quote:
      description: 'The best bid and ask information for a given option.

        '
      examples:
      - ap: 0.16
        as: 669
        ax: w
        bp: 0.15
        bs: 164
        bx: W
        c: A
        t: '2024-02-28T15:30:28.046330624Z'
      properties:
        ap:
          description: Ask price.
          format: double
          type: number
        as:
          description: Ask size.
          format: uint32
          type: integer
        ax:
          description: Ask exchange.
          type: string
        bp:
          description: Bid price.
          format: double
          type: number
        bs:
          description: Bid size.
          format: uint32
          type: integer
        bx:
          description: Bid exchange.
          type: string
        c:
          description: Quote condition.
          type: string
        t:
          $ref: '#/components/schemas/timestamp'
      required:
      - t
      - bx
      - bp
      - bs
      - ap
      - as
      - ax
      - c
      type: object
    next_page_token:
      description: Pagination token for the next page.
      type:
      - string
      - 'null'
  headers:
    ratelimit_remaining:
      description: Request limit per minute remaining.
      example: 90
      schema:
        type: integer
    ratelimit_reset:
      description: The UNIX epoch when the remaining quota changes.
      example: 1674044551
      schema:
        type: integer
    ratelimit_limit:
      description: Request limit per minute.
      example: 100
      schema:
        type: integer
  securitySchemes:
    BasicAuth:
      scheme: basic
      type: http
    apiKey:
      in: header
      name: APCA-API-KEY-ID
      type: apiKey
    apiSecret:
      in: header
      name: APCA-API-SECRET-KEY
      type: apiKey