Blockchair Raw Data API

Raw node-level data for blocks and transactions (and ledgers, accounts, and operations on non-UTXO chains) as returned by the underlying blockchain node, for clients that need the unprocessed payload.

OpenAPI Specification

blockchair-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Blockchair API
  description: >-
    The Blockchair API provides unified, multi-blockchain access to on-chain
    data across 40+ blockchains. It exposes per-chain dashboards (address,
    transaction, block), raw node data, network statistics, a SQL-like database
    query interface (blocks, transactions, outputs, addresses), and transaction
    broadcasting. Requests are authenticated with an optional `key` query
    parameter; up to 1440 requests per day are allowed without a key for
    personal or testing use.
  termsOfService: https://blockchair.com/api/docs
  contact:
    name: Blockchair Support
    url: https://github.com/Blockchair/Blockchair.Support
  version: '2.0.80'
servers:
  - url: https://api.blockchair.com
    description: Blockchair production API
tags:
  - name: Stats
    description: Network and chain statistics.
  - name: Address Dashboards
    description: Per-address balance and transaction dashboards.
  - name: Transaction Dashboards
    description: Parsed transaction dashboards.
  - name: Block Dashboards
    description: Parsed block dashboards.
  - name: Raw Data
    description: Raw node-level block and transaction data.
  - name: Outputs Database
    description: SQL-like database query interface.
  - name: Broadcast
    description: Signed transaction broadcasting.
security:
  - apiKey: []
paths:
  /{chain}/stats:
    get:
      operationId: getChainStats
      tags:
        - Stats
      summary: Get blockchain statistics
      description: Returns overall statistics for a single blockchain.
      parameters:
        - $ref: '#/components/parameters/chain'
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsResponse'
  /stats:
    get:
      operationId: getMultiChainStats
      tags:
        - Stats
      summary: Get multi-chain statistics
      description: Returns aggregated statistics across all supported blockchains.
      parameters:
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsResponse'
  /cross-chain/{token}/stats:
    get:
      operationId: getCrossChainTokenStats
      tags:
        - Stats
      summary: Get cross-chain token statistics
      description: >-
        Returns statistics for a cross-chain token (e.g. USDT, USDC) across the
        chains it is issued on.
      parameters:
        - name: token
          in: path
          required: true
          description: Cross-chain token symbol.
          schema:
            type: string
            example: usdt
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsResponse'
  /{chain}/dashboards/address/{address}:
    get:
      operationId: getAddressDashboard
      tags:
        - Address Dashboards
      summary: Get an address dashboard
      description: >-
        Returns balance, transaction list, and aggregated statistics for a
        single address on the selected chain.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: address
          in: path
          required: true
          description: The address to look up.
          schema:
            type: string
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardResponse'
  /{chain}/dashboards/addresses/{addresses}:
    get:
      operationId: getAddressesDashboard
      tags:
        - Address Dashboards
      summary: Get a multi-address dashboard
      description: >-
        Returns combined balance and transaction data for a comma-separated set
        of up to 100 addresses.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: addresses
          in: path
          required: true
          description: Comma-separated list of up to 100 addresses.
          schema:
            type: string
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardResponse'
  /{chain}/dashboards/xpub/{extendedKey}:
    get:
      operationId: getXpubDashboard
      tags:
        - Address Dashboards
      summary: Get an extended public key dashboard
      description: >-
        Returns balance and transaction data derived from an extended public
        key (xpub/ypub/zpub) on Bitcoin-like chains.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: extendedKey
          in: path
          required: true
          description: The extended public key.
          schema:
            type: string
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardResponse'
  /{chain}/dashboards/transaction/{hash}:
    get:
      operationId: getTransactionDashboard
      tags:
        - Transaction Dashboards
      summary: Get a transaction dashboard
      description: >-
        Returns a parsed view of a single transaction including inputs, outputs,
        fees, and confirmation data.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: hash
          in: path
          required: true
          description: The transaction hash.
          schema:
            type: string
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardResponse'
  /{chain}/dashboards/transactions/{hashes}:
    get:
      operationId: getTransactionsDashboard
      tags:
        - Transaction Dashboards
      summary: Get a multi-transaction dashboard
      description: Returns parsed views for a comma-separated set of transaction hashes.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: hashes
          in: path
          required: true
          description: Comma-separated list of transaction hashes.
          schema:
            type: string
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardResponse'
  /{chain}/dashboards/block/{id}:
    get:
      operationId: getBlockDashboard
      tags:
        - Block Dashboards
      summary: Get a block dashboard
      description: >-
        Returns a parsed view of a single block, identified by height or hash,
        including header fields and transaction references.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: id
          in: path
          required: true
          description: Block height or block hash.
          schema:
            type: string
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardResponse'
  /{chain}/dashboards/blocks/{ids}:
    get:
      operationId: getBlocksDashboard
      tags:
        - Block Dashboards
      summary: Get a multi-block dashboard
      description: Returns parsed views for a comma-separated set of block heights.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: ids
          in: path
          required: true
          description: Comma-separated list of block heights.
          schema:
            type: string
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardResponse'
  /{chain}/raw/block/{id}:
    get:
      operationId: getRawBlock
      tags:
        - Raw Data
      summary: Get raw block data
      description: Returns raw node-level data for a block by height or hash.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: id
          in: path
          required: true
          description: Block height or block hash.
          schema:
            type: string
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RawResponse'
  /{chain}/raw/transaction/{hash}:
    get:
      operationId: getRawTransaction
      tags:
        - Raw Data
      summary: Get raw transaction data
      description: Returns raw node-level data for a transaction by hash.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: hash
          in: path
          required: true
          description: The transaction hash.
          schema:
            type: string
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RawResponse'
  /{chain}/outputs:
    get:
      operationId: queryOutputs
      tags:
        - Outputs Database
      summary: Query the outputs database
      description: >-
        SQL-like query over the outputs table on Bitcoin-like chains, supporting
        filtering by column, sorting, aggregation, offset, and limit.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: q
          in: query
          required: false
          description: >-
            Filter expression, e.g. `recipient(1A1zP...),is_spent(false)`.
          schema:
            type: string
        - name: s
          in: query
          required: false
          description: Sort expression, e.g. `value(desc)`.
          schema:
            type: string
        - name: a
          in: query
          required: false
          description: Aggregation expression, e.g. `sum(value)`.
          schema:
            type: string
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseResponse'
  /{chain}/blocks:
    get:
      operationId: queryBlocks
      tags:
        - Outputs Database
      summary: Query the blocks database
      description: SQL-like query over the blocks table on Bitcoin-like chains.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: q
          in: query
          required: false
          schema:
            type: string
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseResponse'
  /{chain}/transactions:
    get:
      operationId: queryTransactions
      tags:
        - Outputs Database
      summary: Query the transactions database
      description: SQL-like query over the transactions table.
      parameters:
        - $ref: '#/components/parameters/chain'
        - name: q
          in: query
          required: false
          schema:
            type: string
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/key'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseResponse'
  /{chain}/push/transaction:
    post:
      operationId: broadcastTransaction
      tags:
        - Broadcast
      summary: Broadcast a signed transaction
      description: >-
        Relays a signed, raw transaction to the network of the selected chain.
      parameters:
        - $ref: '#/components/parameters/chain'
        - $ref: '#/components/parameters/key'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: string
                  description: The signed, raw transaction in hexadecimal form.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BroadcastResponse'
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: >-
        Optional API key passed as the `key` query parameter. Up to 1440
        requests per day are allowed without a key for personal/testing use.
  parameters:
    chain:
      name: chain
      in: path
      required: true
      description: Blockchain slug (e.g. bitcoin, ethereum, litecoin, dogecoin).
      schema:
        type: string
        example: bitcoin
    key:
      name: key
      in: query
      required: false
      description: API key.
      schema:
        type: string
    limit:
      name: limit
      in: query
      required: false
      description: Maximum number of rows to return.
      schema:
        type: integer
    offset:
      name: offset
      in: query
      required: false
      description: Number of rows to skip.
      schema:
        type: integer
  schemas:
    Context:
      type: object
      description: Metadata describing the request, cost, and server state.
      properties:
        code:
          type: integer
          example: 200
        source:
          type: string
        results:
          type: integer
        state:
          type: integer
          description: Current best block height of the chain.
        cache:
          type: object
        api:
          type: object
          properties:
            version:
              type: string
            last_major_update:
              type: string
            next_major_update:
              type: string
        request_cost:
          type: number
          description: Number of API request units this call consumed.
        time:
          type: number
    StatsResponse:
      type: object
      properties:
        data:
          type: object
          description: Blockchain statistics keyed by metric.
        context:
          $ref: '#/components/schemas/Context'
    DashboardResponse:
      type: object
      properties:
        data:
          type: object
          description: >-
            Dashboard payload keyed by the requested address, transaction hash,
            or block id.
        context:
          $ref: '#/components/schemas/Context'
    RawResponse:
      type: object
      properties:
        data:
          type: object
          description: Raw node-level payload keyed by the requested identifier.
        context:
          $ref: '#/components/schemas/Context'
    DatabaseResponse:
      type: object
      properties:
        data:
          type: array
          description: Array of result rows from the database query.
          items:
            type: object
        context:
          $ref: '#/components/schemas/Context'
    BroadcastResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            transaction_hash:
              type: string
              description: The hash of the broadcast transaction.
        context:
          $ref: '#/components/schemas/Context'