unisat-dev-docs

Blockchain API

Blockchain API is a RESTful API for accessing Bitcoin blockchain data. It provides endpoints to retrieve information about blocks, transactions, addresses, and more. The API supports both mainnet and testnet environments.

👉 View Swagger UI


đź“‘ Table of Contents

Route Summary
GET /v1/indexer/blockchain/info Get Blockchain Info
GET /v1/indexer/fees/recommended Get Recommended Fees
GET /v1/indexer/height/{height}/block Get block info by height
GET /v1/indexer/block/id/{blockid} Get block info by blockid
GET /v1/indexer/block/{height}/txs Get txs by block height.
GET /v1/indexer/tx/{txid} Get tx info by txid
GET /v1/indexer/tx/{txid}/ins Get the inputs of a tx
GET /v1/indexer/tx/{txid}/outs Get the outputs of a tx
GET /v1/indexer/rawtx/{txid} Get the raw tx by txid
GET /v1/indexer/utxo/{txid}/{index} Get the UTXO by txid and index
POST /v1/indexer/local_pushtx Push rawtx to bitcoin node.
POST /v1/indexer/local_pushtxs Push rawtxs to bitcoin node.
GET /v1/indexer/address/{address}/balance Get the balance by address
GET /v1/indexer/address/{address}/history Get transaction history by address
GET /v1/indexer/address/{address}/utxo-data Get UTXO list by address
GET /v1/indexer/address/{address}/available-balance Get available balance by address
GET /v1/indexer/address/{address}/available-utxo-data Get available UTXO list by address

Blocks

Get Blockchain Info

Method: GET
Path: /v1/indexer/blockchain/info
Swagger Link: View in Swagger UI

Description

Get the current blockchain information, including chain type, block count, and best block hash.

Response (200)


Method: GET
Path: /v1/indexer/fees/recommended
Swagger Link: View in Swagger UI

Description

Get the recommended fees for different confirmation times. (like mempool.space)

Response (200)


Get block info by height

Method: GET
Path: /v1/indexer/height/{height}/block
Swagger Link: View in Swagger UI

Description

Get block info by height.

Parameters

Response (200)


Get block info by blockid

Method: GET
Path: /v1/indexer/block/id/{blockid}
Swagger Link: View in Swagger UI

Description

Get block info by blockid.

Parameters

Response (200)


Get txs by block height.

Method: GET
Path: /v1/indexer/block/{height}/txs
Swagger Link: View in Swagger UI

Description

Get txs by block height.

Parameters

Response (200)


Transactions

Get tx info by txid

Method: GET
Path: /v1/indexer/tx/{txid}
Swagger Link: View in Swagger UI

Description

Get tx info by txid.

Parameters

Response (200)


Get the inputs of a tx

Method: GET
Path: /v1/indexer/tx/{txid}/ins
Swagger Link: View in Swagger UI

Description

Get the inputs of a tx.

Parameters

Response (200)


Get the outputs of a tx

Method: GET
Path: /v1/indexer/tx/{txid}/outs
Swagger Link: View in Swagger UI

Description

Get the outputs of a tx.

Parameters

Response (200)


Get the raw tx by txid

Method: GET
Path: /v1/indexer/rawtx/{txid}
Swagger Link: View in Swagger UI

Description

Get the raw tx by txid.

Parameters

Response (200)


Get the UTXO by txid and index

Method: GET
Path: /v1/indexer/utxo/{txid}/{index}
Swagger Link: View in Swagger UI

Description

Get the UTXO by txid and index.

Parameters

Response (200)

Notes

The return result of this UTXO interface will have three scenarios:

  1. When UTXO has not been spent, it will return the information of this UTXO, and isSpent will be set to false.

    image

  2. When UTXO has been spent, but the transaction that spent it has not yet been confirmed, it will return the information of this UTXO, and isSpent will be set to true.

    image

  3. When UTXO has been spent and the transacted spend has been confirmed, it will return null. image

This endpoint was updated on 2025-05-20

BRC20 inscriptions of type TRANSFER (those that have undergone transfers) and MINT inscriptions, which no longer hold value, will no longer be available for query after this update. Before Upgrade:

{
  "code": 0,
  "msg": "ok",
  "data": {
    "txid": "...",
    "vout": 0,
    "satoshi": 546,
    "scriptType": "5120",
    "scriptPk": "...",
    "codeType": 9,
    "address": "...",
    "height": 815539,
    "idx": 2516,
    "isOpInRBF": false,
    "isSpent": false,
    "inscriptionsCount": 2,
    "inscriptions": [
      {
        "inscriptionNumber": 38012882,
        "inscriptionId": "...",
        "offset": 0,
        "moved": false,
        "sequence": 0,
        "isCursed": false,
        "isVindicate": false,
        "isBRC20Ext": false,
        "isBRC20": true
      },
      {
        "inscriptionNumber": 38012883,
        "inscriptionId": "....",
        "offset": 0,
        "moved": false,
        "sequence": 0,
        "isCursed": false,
        "isVindicate": false,
        "isBRC20Ext": false,
        "isBRC20": false
      }
    ]
  }
}

After Upgrade:

{
  "code": 0,
  "msg": "ok",
  "data": {
    "txid": "...",
    "vout": 0,
    "satoshi": 546,
    "scriptType": "5120",
    "scriptPk": "...",
    "codeType": 9,
    "address": "...",
    "height": 815539,
    "idx": 2516,
    "isOpInRBF": false,
    "isSpent": false,
    "inscriptionsCount": 2,
    "inscriptions": [
    {
        "inscriptionNumber": 38012883,
        "inscriptionId": "....",
        "offset": 0,
        "moved": false,
        "sequence": 0,
        "isCursed": false,
        "isVindicate": false,
        "isBRC20Ext": false,
        "isBRC20": false
      }
     ]
  }
}

Migration Guidance:


Push rawtx to bitcoin node.

Method: POST
Path: /v1/indexer/local_pushtx
Swagger Link: View in Swagger UI

Description

Push rawtx to bitcoin node.

Response (200)


Push rawtxs to bitcoin node.

Method: POST
Path: /v1/indexer/local_pushtxs
Swagger Link: View in Swagger UI

Description

Push rawtxs to bitcoin node.

Response (200)


Addresses

Get the balance by address

Method: GET
Path: /v1/indexer/address/{address}/balance
Swagger Link: View in Swagger UI

Description

Get the balance by address.

Parameters

Response (200)


Get transaction history by address

Method: GET
Path: /v1/indexer/address/{address}/history
Swagger Link: View in Swagger UI

Description

Get transaction history by address.

Parameters

Response (200)


Get UTXO list by address

Method: GET
Path: /v1/indexer/address/{address}/utxo-data
Swagger Link: View in Swagger UI

Description

Retrieve the UTXOs of an address that do not contain inscriptions. Note that this excludes, but does not completely cover, assets from protocols such as Alkanes, Runes, and others. To obtain the UTXOs of an address that are available for spending as BTC, please use the available-utxo endpoint.

Parameters

Response (200)


Get available balance by address

Method: GET
Path: /v1/indexer/address/{address}/available-balance
Swagger Link: View in Swagger UI

Description

This interface will return the current address’s available balance that can be used for BTC spending. Balances of assets such as inscriptions, runes, and alkanes will not be included.

Parameters

Response (200)


Get available UTXO list by address

Method: GET
Path: /v1/indexer/address/{address}/available-utxo-data
Swagger Link: View in Swagger UI

Description

This interface will return the current address’s available UTXO list that can be used for BTC spending. UTXOs of assets such as inscriptions, runes, and alkanes will not be included. The UTXO management tool (https://unisat.io/utxo) can unlock these UTXOs, making them available again. Additionally, UTXOs with less than 600 satoshis will not be returned to avoid potential unspendable outputs from unrecognized asset protocols or burns.

Parameters

Response (200)