Blockchain.com Unauthenticated API

Retrieve current prices and markets

OpenAPI Specification

blockchain.com-unauthenticated-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Blockchain.com Exchange REST Unauthenticated API
  description: '## Introduction

    Welcome to Blockchain.com''s Exchange API and developer documentation. \

    These documents detail and give examples of various functionality offered by the API such as receiving real time market data, requesting balance information and performing trades.

    ## To Get Started

    Create or log into your existing Blockchain.com Exchange account \

    Select API from the drop down menu \

    Fill out form and click “Create New API Key Now” \

    Once generated you can view your keys under API Settings. \

    Please be aware that the API key can only be used once it was verified via email.


    The API key must be set via the \

    `X-API-Token`\

    header.


    The base URL to be used for all calls is \

    `https://api.blockchain.com/v3/exchange`


    Autogenerated clients for this API can be found [here](https://github.com/blockchain/lib-exchange-client).

    '
  version: 1.0.0
servers:
- url: https://api.blockchain.com/v3/exchange
security:
- ApiKeyAuth: []
tags:
- name: unauthenticated
  description: Retrieve current prices and markets
paths:
  /l2/{symbol}:
    get:
      summary: L2 Order Book
      description: Level 2 Order Book data is available through the l2 channel. Each entry in bids and asks arrays is a price level, along with its price (px), quantity (qty) and number of orders (num) attributes.
      operationId: getL2OrderBook
      tags:
      - unauthenticated
      security:
      - ApiKeyAuth: []
      - {}
      parameters:
      - $ref: '#/components/parameters/symbolParam'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderBook'
  /l3/{symbol}:
    get:
      summary: L3 Order Book
      description: Level 3 Order Book data is available through the l3 channel. Each entry in bids and asks arrays is an order, along with its id (id), price (px) and quantity (qty) attributes. In contrast to the L2 order book, the L3 order book contains all individual orders without aggregation.
      operationId: getL3OrderBook
      tags:
      - unauthenticated
      security:
      - ApiKeyAuth: []
      - {}
      parameters:
      - $ref: '#/components/parameters/symbolParam'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderBook'
  /tickers:
    get:
      summary: Price
      description: ''
      operationId: getTickers
      tags:
      - unauthenticated
      security:
      - ApiKeyAuth: []
      - {}
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PriceEvent'
  /tickers/{symbol}:
    get:
      summary: Price
      description: ''
      operationId: getTickerBySymbol
      tags:
      - unauthenticated
      security:
      - ApiKeyAuth: []
      - {}
      parameters:
      - $ref: '#/components/parameters/symbolParam'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceEvent'
  /symbols:
    get:
      summary: Symbols
      description: 'When the symbol is not halted the auction data in the message may be blank.

        When a symbol is in a halt state the auction data will populate as the book builds. When an opening time has been chosen, the auction-time field will show the opening time. Subsequent updates will be sent only if the symbol status changes in any way.'
      operationId: getSymbols
      tags:
      - unauthenticated
      security:
      - ApiKeyAuth: []
      - {}
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/SymbolStatus'
  /symbols/{symbol}:
    get:
      summary: Symbols
      description: 'When the symbol is not halted the auction data in the message may be blank.

        When a symbol is in a halt state the auction data will populate as the book builds. When an opening time has been chosen, the auction-time field will show the opening time. Subsequent updates will be sent only if the symbol status changes in any way.'
      operationId: getSymbolByName
      tags:
      - unauthenticated
      security:
      - ApiKeyAuth: []
      - {}
      parameters:
      - $ref: '#/components/parameters/symbolParam'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolStatus'
components:
  schemas:
    PriceEvent:
      type: object
      properties:
        symbol:
          $ref: '#/components/schemas/symbol'
        price_24h:
          type: number
          format: double
          example: '4998.0'
        volume_24h:
          type: number
          format: double
          example: '0.3015'
        last_trade_price:
          type: number
          format: double
          example: '5000.0'
    SymbolStatus:
      type: object
      properties:
        base_currency:
          $ref: '#/components/schemas/symbol'
        base_currency_scale:
          type: integer
          description: The number of decimals the currency can be split in
          example: 8
        counter_currency:
          $ref: '#/components/schemas/symbol'
        counter_currency_scale:
          type: integer
          description: The number of decimals the currency can be split in
          example: 2
        min_price_increment:
          type: integer
          format: int64
          description: The price of the instrument must be a multiple of min_price_increment * (10^-min_price_increment_scale)
          example: 10
        min_price_increment_scale:
          type: integer
          example: 0
        min_order_size:
          type: integer
          format: int64
          description: The minimum quantity for an order for this instrument must be min_order_size*(10^-min_order_size_scale)
          example: 10
        min_order_size_scale:
          type: integer
          example: 2
        max_order_size:
          type: integer
          format: int64
          description: The maximum quantity for an order for this instrument is max_order_size*(10^-max_order_size_scale). If this equal to zero, there is no limit
          example: 0
        max_order_size_scale:
          type: integer
          example: 8
        lot_size:
          type: integer
          format: int64
          example: 5
        lot_size_scale:
          type: integer
          example: 2
        status:
          type: string
          enum:
          - open
          - close
          - suspend
          - halt
          - halt-freeze
          description: Symbol status; open, close, suspend, halt, halt-freeze.
        id:
          type: integer
          format: int64
          example: 1
        auction_price:
          type: number
          format: double
          description: If the symbol is halted and will open on an auction, this will be the opening price.
          example: 0.0
        auction_size:
          type: number
          format: double
          description: Opening size
          example: 0.0
        auction_time:
          type: string
          description: Opening time in HHMM format
          example: '1530'
        imbalance:
          type: number
          format: double
          description: Auction imbalance. If > 0 then there will be buy orders left over at the auction price. If < 0 then there will be sell orders left over at the auction price.
          example: 0.0
    OrderBookEntry:
      type: object
      properties:
        px:
          type: number
          format: double
          example: '8723.45'
        qty:
          type: number
          format: double
          example: '1.45'
        num:
          type: integer
          format: int64
          description: Either the quantity of orders on this price level for L2, or the individual order id for L3
          example: '1'
    symbol:
      type: string
      pattern: ^[A-Z]{3,5}-[A-Z]{3,5}$
      description: Blockchain symbol identifier
      example: BTC-USD
    OrderBook:
      type: object
      properties:
        symbol:
          $ref: '#/components/schemas/symbol'
        bids:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookEntry'
        asks:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookEntry'
  parameters:
    symbolParam:
      name: symbol
      in: path
      description: Symbol
      required: true
      schema:
        $ref: '#/components/schemas/symbol'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Token