Alpaca Crypto API

Endpoints for cryptocurrencies.

Operations 8

GET /v1beta3/crypto/{loc}/bars Historical bars #
GET /v1beta3/crypto/{loc}/latest/bars Latest bars #
GET /v1beta3/crypto/{loc}/latest/orderbooks Latest orderbook #
GET /v1beta3/crypto/{loc}/latest/quotes Latest quotes #
GET /v1beta3/crypto/{loc}/latest/trades Latest trades #
GET /v1beta3/crypto/{loc}/quotes Historical quotes #
GET /v1beta3/crypto/{loc}/snapshots Snapshots #
GET /v1beta3/crypto/{loc}/trades Historical 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-crypto-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-crypto-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 Crypto API
  version: '1.1'
servers:
- description: Production
  url: https://data.alpaca.markets
- description: Sandbox
  url: https://data.sandbox.alpaca.markets
tags:
- description: Endpoints for cryptocurrencies.
  name: Crypto
paths:
  /v1beta3/crypto/{loc}/bars:
    get:
      description: The crypto bars API provides historical aggregates for a list of crypto symbols between the specified dates.
      operationId: CryptoBars
      parameters:
      - $ref: '#/components/parameters/crypto_historical_loc'
      - $ref: '#/components/parameters/crypto_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:
                      BTC/USD:
                      - c: 29003
                        h: 29003
                        l: 28999
                        n: 4
                        o: 28999
                        t: '2022-05-27T10:18:00Z'
                        v: 0.01
                        vw: 29001
                    next_page_token: MTY0MDk0ODkyMzAwMDAwMDAwMHwyNDg0MzE3MQ==
              schema:
                $ref: '#/components/schemas/crypto_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:
      - Crypto
  /v1beta3/crypto/{loc}/latest/bars:
    get:
      description: The latest multi-bars endpoint returns the latest minute-aggregated historical bar data for each of the crypto symbols provided.
      operationId: CryptoLatestBars
      parameters:
      - $ref: '#/components/parameters/crypto_latest_loc'
      - $ref: '#/components/parameters/crypto_symbols'
      responses:
        '200':
          content:
            application/json:
              examples:
                bars:
                  value:
                    bars:
                      BTC/USD:
                        c: 29003
                        h: 29003
                        l: 28999
                        n: 4
                        o: 28999
                        t: '2022-05-27T10:18:00Z'
                        v: 0.01
                        vw: 29001
              schema:
                $ref: '#/components/schemas/crypto_latest_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: Latest bars
      tags:
      - Crypto
  /v1beta3/crypto/{loc}/latest/orderbooks:
    get:
      description: The latest orderbook endpoint returns the latest bid and ask orderbook for the crypto symbols provided.
      operationId: CryptoLatestOrderbooks
      parameters:
      - $ref: '#/components/parameters/crypto_latest_loc'
      - $ref: '#/components/parameters/crypto_symbols'
      responses:
        '200':
          content:
            application/json:
              examples:
                orderbooks:
                  value:
                    orderbooks:
                      BTC/USD:
                        a:
                        - p: 20902
                          s: 0.0097
                        - p: 21444
                          s: 0
                        b:
                        - p: 20846
                          s: 0.1902
                        - p: 20350
                          s: 0
                        t: '2022-06-24T08:00:14.137774336Z'
              schema:
                $ref: '#/components/schemas/crypto_latest_orderbooks_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 orderbook
      tags:
      - Crypto
  /v1beta3/crypto/{loc}/latest/quotes:
    get:
      description: The latest quotes endpoint returns the latest bid and ask prices for the crypto symbols provided.
      operationId: CryptoLatestQuotes
      parameters:
      - $ref: '#/components/parameters/crypto_latest_loc'
      - $ref: '#/components/parameters/crypto_symbols'
      responses:
        '200':
          content:
            application/json:
              examples:
                quotes:
                  value:
                    quotes:
                      BTC/USD:
                        ap: 29059
                        as: 3.252
                        bp: 29058
                        bs: 0.3544
                        t: '2022-05-26T11:47:18.44347136Z'
                      ETH/USD:
                        ap: 1817.7
                        as: 6.137
                        bp: 1817
                        bs: 4.76
                        t: '2022-05-26T11:47:18.499478272Z'
              schema:
                $ref: '#/components/schemas/crypto_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:
      - Crypto
  /v1beta3/crypto/{loc}/latest/trades:
    get:
      description: The latest trades endpoint returns the latest trade data for the crypto symbols provided.
      operationId: CryptoLatestTrades
      parameters:
      - $ref: '#/components/parameters/crypto_latest_loc'
      - $ref: '#/components/parameters/crypto_symbols'
      responses:
        '200':
          content:
            application/json:
              examples:
                trades:
                  value:
                    trades:
                      BTC/USD:
                        i: 31455289
                        p: 29791
                        s: 0.0016
                        t: '2022-05-18T12:01:00.537052Z'
                        tks: S
                      ETH/USD:
                        i: 31455287
                        p: 2027.6
                        s: 0.06
                        t: '2022-05-18T12:01:00.363547Z'
                        tks: S
              schema:
                $ref: '#/components/schemas/crypto_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:
      - Crypto
  /v1beta3/crypto/{loc}/quotes:
    get:
      description: 'The crypto quotes API provides historical quote data for a list of crypto symbols between the specified dates.

        The oldest date to retrieve historical quotes of us-1 location is 14th October, 2025 12AM UTC.'
      operationId: CryptoQuotes
      parameters:
      - $ref: '#/components/parameters/crypto_historical_loc'
      - $ref: '#/components/parameters/crypto_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:
                quotes:
                  value:
                    next_page_token: MTY1MzU2NzYzODQ5OTQ3ODI3Mnwx
                    quotes:
                      BTC/USD:
                      - ap: 29059
                        as: 3.252
                        bp: 29058
                        bs: 0.3544
                        t: '2022-05-26T11:47:18.44347136Z'
                      ETH/USD:
                      - ap: 1817.7
                        as: 6.137
                        bp: 1817
                        bs: 4.76
                        t: '2022-05-26T11:47:18.499478272Z'
              schema:
                $ref: '#/components/schemas/crypto_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: Historical quotes
      tags:
      - Crypto
  /v1beta3/crypto/{loc}/snapshots:
    get:
      description: The snapshots endpoint returns the latest trade, latest quote, latest minute bar, latest daily bar, and previous daily bar data for crypto symbols.
      operationId: CryptoSnapshots
      parameters:
      - $ref: '#/components/parameters/crypto_latest_loc'
      - $ref: '#/components/parameters/crypto_symbols'
      responses:
        '200':
          content:
            application/json:
              examples:
                snapshots:
                  value:
                    snapshots:
                      BTC/USD:
                        dailyBar:
                          c: 31744
                          h: 31807
                          l: 31416
                          n: 438
                          o: 31660
                          t: '2022-05-31T05:00:00Z'
                          v: 67.3518
                          vw: 31582.7034526175
                        latestQuote:
                          ap: 31742
                          as: 0.395
                          bp: 31741
                          bs: 0.395
                          t: '2022-05-31T11:55:58.507608832Z'
                        latestTrade:
                          i: 32396097
                          p: 31744
                          s: 0.0543
                          t: '2022-05-31T11:53:45.027481Z'
                          tks: B
                        minuteBar:
                          c: 31744
                          h: 31744
                          l: 31744
                          n: 2
                          o: 31744
                          t: '2022-05-31T11:53:00Z'
                          v: 0.0886
                          vw: 31744
                        prevDailyBar:
                          c: 31649
                          h: 32251
                          l: 30251
                          n: 8221
                          o: 30310
                          t: '2022-05-30T05:00:00Z'
                          v: 1856.4065
                          vw: 30877.2751897281
              schema:
                $ref: '#/components/schemas/crypto_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:
      - Crypto
  /v1beta3/crypto/{loc}/trades:
    get:
      description: The crypto trades API provides historical trade data for a list of crypto symbols between the specified dates.
      operationId: CryptoTrades
      parameters:
      - $ref: '#/components/parameters/crypto_historical_loc'
      - $ref: '#/components/parameters/crypto_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: MTY1MzA1MDgwMDAwMDAwMDAwMHwzMTQ1NTI4OQ==
                    trades:
                      BTC/USD:
                      - i: 31455289
                        p: 29791
                        s: 0.0016
                        t: '2022-05-18T12:01:00.537052Z'
                        tks: S
                      ETH/USD:
                      - i: 31455287
                        p: 2027.6
                        s: 0.06
                        t: '2022-05-18T12:01:00.363547Z'
                        tks: S
                      - i: 31455288
                        p: 2027.6
                        s: 0.136
                        t: '2022-05-18T12:01:00.363547Z'
                        tks: S
              schema:
                $ref: '#/components/schemas/crypto_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:
      - Crypto
components:
  schemas:
    crypto_trade:
      description: A crypto trade.
      examples:
      - i: 31455277
        p: 29798
        s: 0.1209
        t: '2022-05-18T12:00:05.225055Z'
        tks: S
      properties:
        i:
          description: Trade ID.
          format: int64
          type: integer
        p:
          description: Trade price.
          format: double
          type: number
        s:
          description: Trade size.
          format: double
          type: number
        t:
          $ref: '#/components/schemas/timestamp'
        tks:
          description: 'Taker side: B for buyer, S for seller

            '
          type: string
      required:
      - t
      - p
      - s
      - i
      - tks
      type: object
    crypto_latest_bars_resp:
      properties:
        bars:
          additionalProperties:
            $ref: '#/components/schemas/crypto_bar'
          type: object
      required:
      - bars
      type: object
    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
    crypto_orderbook_entry:
      description: A single entry in a crypto orderbook.
      examples:
      - p: 20846
        s: 0.1902
      properties:
        p:
          description: Price.
          format: double
          type: number
        s:
          description: Size.
          format: double
          type: number
      required:
      - p
      - s
      type: object
    crypto_bars_resp:
      properties:
        bars:
          additionalProperties:
            items:
              $ref: '#/components/schemas/crypto_bar'
            type: array
          type: object
        next_page_token:
          $ref: '#/components/schemas/next_page_token'
      required:
      - bars
      - next_page_token
      type: object
    crypto_historical_loc:
      description: Crypto location from where the historical market data is retrieved.
      enum:
      - us
      - us-1
      - us-2
      - eu-1
      - bs-1
      type: string
    crypto_latest_loc:
      description: Crypto location from where the latest market data is retrieved.
      enum:
      - us
      - us-1
      - us-2
      - eu-1
      - bs-1
      type: string
    crypto_trades_resp:
      properties:
        next_page_token:
          $ref: '#/components/schemas/next_page_token'
        trades:
          additionalProperties:
            items:
              $ref: '#/components/schemas/crypto_trade'
            type: array
          type: object
      required:
      - trades
      - next_page_token
      type: object
    crypto_bar:
      description: OHLC aggregate of all the trades in a given interval.
      examples:
      - c: 29003
        h: 29003
        l: 28999
        n: 4
        o: 28999
        t: '2022-05-27T10:18:00Z'
        v: 0.01
        vw: 29001
      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: double
          type: number
        vw:
          description: Volume weighted average price.
          format: double
          type: number
      required:
      - t
      - o
      - h
      - l
      - c
      - v
      - n
      - vw
      type: object
    crypto_latest_trades_resp:
      properties:
        trades:
          additionalProperties:
            $ref: '#/components/schemas/crypto_trade'
          type: object
      required:
      - trades
      type: object
    crypto_quotes_resp:
      properties:
        next_page_token:
          $ref: '#/components/schemas/next_page_token'
        quotes:
          additionalProperties:
            items:
              $ref: '#/components/schemas/crypto_quote'
            type: array
          type: object
      required:
      - quotes
      - next_page_token
      type: object
    crypto_snapshot:
      description: 'A snapshot provides the latest trade, latest quote, latest minute bar, latest daily bar and previous daily bar.

        '
      properties:
        dailyBar:
          $ref: '#/components/schemas/crypto_bar'
        latestQuote:
          $ref: '#/components/schemas/crypto_quote'
        latestTrade:
          $ref: '#/components/schemas/crypto_trade'
        minuteBar:
          $ref: '#/components/schemas/crypto_bar'
        prevDailyBar:
          $ref: '#/components/schemas/crypto_bar'
      type: object
    crypto_snapshots_resp:
      properties:
        snapshots:
          additionalProperties:
            $ref: '#/components/schemas/crypto_snapshot'
          type: object
      required:
      - snapshots
      type: object
    crypto_latest_orderbooks_resp:
      properties:
        orderbooks:
          additionalProperties:
            $ref: '#/components/schemas/crypto_orderbook'
          type: object
      required:
      - orderbooks
      type: object
    crypto_latest_quotes_resp:
      properties:
        quotes:
          additionalProperties:
            $ref: '#/components/schemas/crypto_quote'
          type: object
      required:
      - quotes
      type: object
    crypto_quote:
      description: The best bid and ask information for a given security.
      examples:
      - ap: 29059
        as: 3.252
        bp: 29058
        bs: 0.3544
        t: '2022-05-26T11:47:18.44347136Z'
      properties:
        ap:
          description: Ask price.
          format: double
          type: number
        as:
          description: Ask size in the base asset (left side of the pair), with no lot multiplier.
          format: double
          type: number
        bp:
          description: Bid price.
          format: double
          type: number
        bs:
          description: Bid size in the base asset (left side of the pair), with no lot multiplier.
          format: double
          type: number
        t:
          $ref: '#/components/schemas/timestamp'
      required:
      - t
      - bp
      - bs
      - ap
      - as
      type: object
    crypto_orderbook:
      description: Snapshot of the orderbook.
      examples:
      - a:
        - p: 20902
          s: 0.0097
        - p: 21444
          s: 0
        b:
        - p: 20846
          s: 0.1902
        - p: 20350
          s: 0
        t: '2022-06-24T08:00:14.137774336Z'
      properties:
        a:
          items:
            $ref: '#/components/schemas/crypto_orderbook_entry'
          type: array
        b:
          items:
            $ref: '#/components/schemas/crypto_orderbook_entry'
          type: array
        t:
          $ref: '#/components/schemas/timestamp'
      required:
      - t
      - b
      - a
      type: object
    next_page_token:
      description: Pagination token for the next page.
      type:
      - string
      - 'null'
  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
    crypto_latest_loc:
      description: 'Crypto location from where the latest market data is retrieved.

        - `us`: Alpaca US

        - `us-1`: Kraken US

        - `eu-1`: Kraken EU

        '
      in: path
      name: loc
      required: true
      schema:
        $ref: '#/components/schemas/crypto_latest_loc'
    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'
    crypto_historical_loc:
      description: 'Crypto location from where the historical market data is retrieved.

        - `us`: Alpaca US

        - `us-1`: Kraken US

        - `eu-1`: Kraken EU

        '
      in: path
      name: loc
      required: true
      schema:
        $ref: '#/components/schemas/crypto_historical_loc'
    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
    crypto_symbols:
      description: A comma-separated list of crypto symbols.
      example: BTC/USD,LTC/USD
      in: query
      name: symbols
      required: true
      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
  responses:
    '403':
      description: 'The requested resource is forbidden.

        '
    '401':
      description: 'Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key.

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