Bitcoin REST API

Below is the reference guide for the Bitcoin REST API service. This API is Bitcoin-only; no altcoins are supported, nor will they be in the future. All responses are formatted in JSON.

The API is designed for high availability, targeting a minimum uptime of 99.99%. We scale horizontally by continuously adding new servers, enabling us to handle a large volume of requests efficiently.

Each endpoint returns an HTTP 200 status code for successful requests. If an error occurs, the API will return the most appropriate HTTP status code for the specific issue. Additionally, when an error is encountered, an "error" key will be included in the response, with its value describing the problem. To properly handle responses, always monitor both the status code and the presence of the "error" key.

The API is stateless, meaning each request is processed independently. We prioritize user privacy: no personal data is collected or shared with any third parties.

This is a paid service. A free trial is available, allowing up to 100 requests per day for 7 days. You can request an API key using the button below or purchase one of our subscription packages with higher request limits.

If you exceed your package's request limit, the API will respond with an HTTP 429 status code and an appropriate error message. Additionally, all packages are subject to a rate limit of 20 requests per 10 seconds.

The request limit operates on a 24-hour sliding window. Each response includes the X-Requests-Last-24h header, which you can use to monitor the total number of requests made with a given API key over the past 24 hours.

Request an API Key


GET Address Balance

Endpoint
/v1/address/:address/balance

Description
Returns the balance of a given Bitcoin address, including the unconfirmed balance from transactions in the mempool.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/address/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa/balance

Response example

{
  "confirmed_balance": 5027516293,
  "unconfirmed_balance": 3415
}


GET Address Transactions

Endpoint
/v1/address/:address/transactions

Description
Returns the latest transactions (up to 1,000) associated with a given Bitcoin address. If the address has over 500,000 transactions, an empty array is returned as a protection mechanism for our systems. Fewer than 30 addresses currently have this many transactions.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/address/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa/transactions

Response example (Confirmed transactions)

[
  {
    "height": 869151,
    "tx_hash": "96235a55f63c8c51f2f34cd914d700943186e7458141bf0e87e8f3a9cfe7410e"
  },
  {
    "height": 869150,
    "tx_hash": "979e69b721b83ce688ee98c3142451073c52714632bd722597b0b32ba6a2afca"
  }
]

Response example (Unconfirmed transactions)

[
  {
    "fee": 194,
    "height": 0,
    "tx_hash": "efa987c8a64e528bd3091802f45434f3c7df81f66ee48e9a046da890d64654d6"
  },
  {
    "fee": 113,
    "height": 0,
    "tx_hash": "d426fbc40d6d5b9d551fdb7846e721756b5f5350cc59d1e26202a104041b548a"
  }
]


GET Address Transactions Mempool

Endpoint
/v1/address/:address/transactions/mempool

Description
Returns a list of unconfirmed transactions linked to a Bitcoin address.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/address/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa/transactions/mempool

Response example

[
  {
    "fee": 194,
    "height": 0,
    "tx_hash": "efa987c8a64e528bd3091802f45434f3c7df81f66ee48e9a046da890d64654d6"
  },
  {
    "fee": 113,
    "height": 0,
    "tx_hash": "d426fbc40d6d5b9d551fdb7846e721756b5f5350cc59d1e26202a104041b548a"
  }
]


GET Address UTXO

Endpoint
/v1/address/:address/utxo

Description
Returns a list of unspent transaction outputs (UTXOs) associated with an address. This function accounts for the mempool. Transactions in the mempool that pay to the address are included at the beginning of the list in an undefined order. Outputs spent in the mempool are excluded. Each output is represented as a dictionary with the following keys:

height - The integer height of the block in which the transaction was confirmed, or 0 if the transaction is in the mempool.
tx_hash - The output’s transaction hash as a hexadecimal string.
tx_pos - The zero-based index of the output in the transaction’s list of outputs.
value - The output’s value in satoshis.

This API endpoint only works for addresses with up to 1,000 transactions; otherwise, it returns an error. This limitation protects our systems from processing excessively large UTXO lists.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/address/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa/utxo

Response example

[
  {
    "height": 869969,
    "tx_hash": "3e975af4a865d5337fe141fa6fd9c514bdd9e5df79eef5d12552142f88f1050e",
    "tx_pos": 7,
    "value": 10600
  },
  {
    "height": 854769,
    "tx_hash": "2a6b0b7d6d10b9b96eb3a4f84423eaf593575fa2fa792942fa16b007cf8a5878",
    "tx_pos": 0,
    "value": 14686
  }
]


GET Address Script

Endpoint
/v1/address/:address/script

Description
The primary goal of this endpoint is to provide the scriptPubKey and scriptHash of a given Bitcoin address. The scriptHash is in Electrum Server format and is used by some systems, though it can be challenging to generate. Other address-related information is also shown.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/address/bc1qa9mcrhyaldw9ty85y0emwrslnmx88yq0khqwr4/script

Response example

{
  "isvalid": true,
  "address": "bc1qa9mcrhyaldw9ty85y0emwrslnmx88yq0khqwr4",
  "scriptPubKey": "0014e97781dc9dfb5c5590f423f3b70e1f9ecc73900f",
  "isscript": false,
  "iswitness": true,
  "witness_version": 0,
  "witness_program": "e97781dc9dfb5c5590f423f3b70e1f9ecc73900f",
  "scriptHash": "6233fafb07afef77b5bc4c4e31120e2ed8f78516f4acdcf906605a856a2be9e9"
}


GET Address Validation

Endpoint
/v1/address/:address/validate

Description
Returns whether a Bitcoin address is valid. Available fields include: isvalid (boolean), address (string), scriptPubKey (string), isscript (boolean), iswitness (boolean), witness_version (numeric, optional), and witness_program (string, optional). For invalid Bech32 and Bech32m addresses, it identifies the exact locations of the errors. Unlike other endpoints, this endpoint returns an HTTP 200 status code even for invalid addresses. The result is identical to Bitcoin Core's method validateaddress().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/address/bc1qa9mcrhyaldw9ty85y0emwrslnmx88yq0khqwr4/validate

Response example (Valid address)

{
  "isvalid": true,
  "address": "bc1qa9mcrhyaldw9ty85y0emwrslnmx88yq0khqwr4",
  "scriptPubKey": "0014e97781dc9dfb5c5590f423f3b70e1f9ecc73900f",
  "isscript": false,
  "iswitness": true,
  "witness_version": 0,
  "witness_program": "e97781dc9dfb5c5590f423f3b70e1f9ecc73900f"
}

Response example (Invalid address)

{
  "isvalid": false,
  "error_locations": [
    20
  ],
  "error": "Invalid Bech32 checksum"
}


GET Transaction Info

Endpoint
/v1/tx/:txid/info

Description
This API endpoint returns details about a specific Bitcoin transaction. It searches for the transaction in both the blockchain (confirmed transactions) and the mempool (unconfirmed transactions). Note that some fields, such as blockhash, may be unavailable for unconfirmed transactions.

The previous output (prevout) for each input is also included. This eliminates the need to make separate requests for data on all input transactions.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/info

Response example

{
  "txid": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16",
  "hash": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16",
  "version": 1,
  "size": 275,
  "vsize": 275,
  "weight": 1100,
  "locktime": 0,
  "vin": [
    {
      "txid": "0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9",
      "vout": 0,
      "scriptSig": {
        "asm": "(string)",
        "hex": "(string)"
      },
      "prevout": {
        "generated": true,
        "height": 9,
        "value": 50,
        "scriptPubKey": {
          "asm": "(string)",
          "desc": "(string)",
          "hex": "(string)",
          "type": "pubkey"
        }
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 10,
      "n": 0,
      "scriptPubKey": {
        "asm": "(string)",
        "desc": "(string)",
        "hex": "(string)",
        "type": "pubkey"
      }
    }
  ],
  "fee": 0,
  "hex": "(string)",
  "blockhash": "00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee",
  "confirmations": 874091,
  "time": 1231731025,
  "blocktime": 1231731025
}


GET Transaction Mempool

Endpoint
/v1/tx/:txid/mempool

Description
Returns mempool data for a given transaction, including the transaction broadcast time, various formats of the transaction fee rate, and direct transaction ancestors and descendants. This API endpoint is specifically designed for unconfirmed transactions and returns an error if the specified transaction is already confirmed.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/mempool

Response example

{
  "vsize": 129,
  "weight": 513,
  "time": 1733167418,
  "height": 874086,
  "descendantcount": 24,
  "descendantsize": 3096,
  "ancestorcount": 2,
  "ancestorsize": 258,
  "wtxid": "142af162249dbbf1863cf63a47fc9500107c64e6fbc4866ea5ea3721f64a49f8",
  "fees": {
    "base": 0.00000129,
    "modified": 0.00000129,
    "ancestor": 0.00000258,
    "descendant": 0.00003096
  },
  "depends": [
    "da0bfc7005d6e53ee9b5ccc5cf933a844e9c928697fbdb30aef797fcda6fcd79"
  ],
  "spentby": [
    "1d3e5405c1214d90bb4f2cde939d0afc82a0cc6ddcf0013f3a62f70a77d8b958"
  ],
  "bip125-replaceable": true,
  "unbroadcast": false
}


GET Transaction Hex

Endpoint
/v1/tx/:txid/hex

Description
Retrieve the raw hexadecimal representation of a specific Bitcoin transaction using its transaction ID (txid).

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/hex

Response example

{
  "txhex": "0100000001c997a5e56e104102fa209c6a852dd90660a20b2d9c352423edce25857fcd3704000000004847304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901ffffffff0200ca9a3b00000000434104ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84cac00286bee0000000043410411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3ac00000000"
}


GET Transaction Status

Endpoint
/v1/tx/:txid/status

Description
Returns the confirmation status of a transaction. Available fields: confirmed (boolean), blockhash (optional), confirmations (optional) and blocktime (optional).

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/status

Response example (Confirmed transaction)

{
  "confirmed": true,
  "blockhash": "00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee",
  "confirmations": 874098,
  "blocktime": 1231731025
}

Response example (Unconfirmed transaction)

{
  "confirmed": false
}


GET Transaction Merkle Proof

Endpoint
/v1/tx/:txid/merkle-proof

Description
Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/merkle-proof

Response example

{
  "block_height": 170,
  "merkle": [
    "b1fea52486ce0c62bb442b530a3f0132b826c74e473d1f2c220bfa78111c5082"
  ],
  "pos": 1
}


GET Transaction Merkleblock Proof

Endpoint
/v1/tx/:txid/merkleblock-proof

Description
Returns a hex-encoded merkle inclusion proof verifying that the specified transaction ID ("txid") is included in a block. The proof is provided in the merkleblock format used by Bitcoin Core (bitcoind).

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/merkleblock-proof

Response example

{
  "tx-merkleblock-proof": "0100000055bd840a78798ad0da853f68974f3d183e2bd1db6a842c1feecf222a00000000ff104ccb05421ab93e63f8c3ce5c2c2e9dbb37de2764b3a3175c8166562cac7d51b96a49ffff001d283e9e70020000000282501c1178fa0b222c1f3d474ec726b832013f0a532b44bb620cce8624a5feb1169e1e83e930853391bc6f35f605c6754cfead57cf8387639d3b4096c54f18f40105"
}


GET Transaction Ancestors

Endpoint
/v1/tx/:txid/ancestors

Description
If the txid is in the mempool, this endpoint returns all its in-mempool ancestors. This API endpoint works exclusively with in-mempool (unconfirmed) transactions; otherwise, it returns an error.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/ancestors

Response example

[
  "1d3e5405c1214d90bb4f2cde939d0afc82a0cc6ddcf0013f3a62f70a77d8b958",
  "a7fc701b9fff1bdb3697c35ef46bbacd9dcfa781111eca02bf0b260f10d10f65",
  "da0bfc7005d6e53ee9b5ccc5cf933a844e9c928697fbdb30aef797fcda6fcd79"
]


GET Transaction Descendants

Endpoint
/v1/tx/:txid/descendants

Description
If the txid is in the mempool, this endpoint returns all its in-mempool descendants. This API endpoint works exclusively with in-mempool (unconfirmed) transactions; otherwise, it returns an error.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/descendants

Response example

[
  "6fe5bf6856d4e388fa1933b651bd68c28e7950875ef43b2b3698a4a8e7270c00",
  "37f7cc8539b8def48fe35ff5d8662f96a8ab82bc7b616871eb870e8f11865103",
  "8b6c667595c8a700da779a24ed3965b87672945e2d983b641e31021e1daa9919"
]


GET Transaction Outspend

Endpoint
/v1/tx/:txid/outspend/:vout

Description
Returns the spending status of a transaction output. The information is derived from the UTXO set. Note that some unspendable outputs, such as those using OP_RETURN, will be marked as spent because they are not stored in the UTXO set.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/outspend/0

Response example (Spent output)

{
  "spent": true
}

Response example (Unspent output)

{
  "spent": false,
  "bestblock": "000000000000000000016a9cafc4f602280024bccf685761f6723f43f04dd31e",
  "confirmations": 1,
  "value": 0.00097404,
  "scriptPubKey": {
    "asm": "0 e66571ba0d8889619b14172eb79b4576cfc8f2da",
    "desc": "addr(bc1quejhrwsd3zykrxc5zuht0x69wm8u3uk650w02c)#h6p7487g",
    "hex": "0014e66571ba0d8889619b14172eb79b4576cfc8f2da",
    "address": "bc1quejhrwsd3zykrxc5zuht0x69wm8u3uk650w02c",
    "type": "witness_v0_keyhash"
  },
  "coinbase": false
}


GET Transaction Outspends

Endpoint
/v1/tx/:txid/outspends

Description
Returns the spending status of all transaction outputs. The information is derived from the UTXO set. Note that some unspendable outputs, such as those using OP_RETURN, will be marked as spent because they are not stored in the UTXO set.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/tx/49dd07f5484dd4b0115422b7c424a8ae7e26a439c6172464891a420184edfab4/outspends

Response example

{
  "txid": "49dd07f5484dd4b0115422b7c424a8ae7e26a439c6172464891a420184edfab4",
  "hash": "49dd07f5484dd4b0115422b7c424a8ae7e26a439c6172464891a420184edfab4",
  "version": 1,
  "size": 225,
  "vsize": 225,
  "weight": 900,
  "locktime": 399989,
  "vin": [],
  "vout": [
    {
      "spent": true,
      "value": 4.99137336,
      "n": 0,
      "scriptPubKey": {}
    }
  ],
  "hex": "(string)",
  "blockhash": "000000000000000004ec466ce4732fe6f1ed1cddc2ed4b328fff5224276e3f6f",
  "confirmations": 474379,
  "time": 1456417484,
  "blocktime": 1456417484
}


POST Transaction Broadcast

Endpoint
/v1/tx/broadcast

Description
Use this endpoint to broadcast a raw Bitcoin transaction to the network. The transaction data must be provided in hexadecimal format within a JSON object, using the rawtx key in the request body. On successful submission, the API will return the txid of the transaction.

Request example

curl -X POST https://api.bitref.com/v1/tx/broadcast \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"rawtx":"02000000000101d9faf815431be58093c5e3afe4832df7702997bd421bb24c730c76473b773c900000000000ffffffff01d485070000000000160014548d702d46641afa83e0f2c06ef42f494fd9e14902483045022100807ff9c1caa54eda1455f0b2e4cdff7e57229a3e0ea2ac8aa1e47ac18d3782c0022064f177f4cf002cf879a1ad3723690e3696842b281a2aff47e80f584ea43a461c012102f11ccfadba44822d852e8ac0f3125f53ec9829e4d0430ab342c23ef9ea2dc4ec00000000"}'

Response example

{
  "txid": "e0aabaed23798f068cc9b5a696fa06c6e34fea8e2e867ed4e98522e9f370b0df"
}


GET Block Info

Endpoint
/v1/block/:hash/info

Description
Returns details about a Bitcoin block identified by its block hash, including a list of Bitcoin transaction hashes (transaction IDs) contained within the block.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/block/000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506/info

Response example

{
  "hash": "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
  "confirmations": 774394,
  "height": 100000,
  "version": 1,
  "versionHex": "00000001",
  "merkleroot": "f3e94742aca4b5ef85488dc37c06c3282295ffec960994b2c0d5ac2a25a95766",
  "time": 1293623863,
  "mediantime": 1293622620,
  "nonce": 274148111,
  "bits": "1b04864c",
  "difficulty": 14484.1623612254,
  "chainwork": "0000000000000000000000000000000000000000000000000644cb7f5234089e",
  "nTx": 4,
  "previousblockhash": "000000000002d01c1fccc21636b607dfd930d31d01c3a62104612a1719011250",
  "nextblockhash": "00000000000080b66c911bd5ba14a74260057311eaeb1982802f7010f1a9f090",
  "strippedsize": 957,
  "size": 957,
  "weight": 3828,
  "tx": [
    "8c14f0db3df150123e6f3dbbf30f8b955a8249b62ac1d1ff16284aefa3d06d87",
    "fff2525b8931402dd09222c50775608f75787bd2b87e56995a7bdd30f79702c4",
    "6359f0868171b1d194cbee1af2f16ea598ae8fad666d9b012c8ed2b79a236ec4",
    "e9a66845e05d5abc0ad04ec80f774a7e585c6e8db975962d069a522137b80c1d"
  ]
}


GET Block Header

Endpoint
/v1/block/:hash/header

Description
Returns header information about a Bitcoin block, identified by its block hash, without including the list of transactions.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/block/000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506/header

Response example

{
  "hash": "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
  "confirmations": 774406,
  "height": 100000,
  "version": 1,
  "versionHex": "00000001",
  "merkleroot": "f3e94742aca4b5ef85488dc37c06c3282295ffec960994b2c0d5ac2a25a95766",
  "time": 1293623863,
  "mediantime": 1293622620,
  "nonce": 274148111,
  "bits": "1b04864c",
  "difficulty": 14484.1623612254,
  "chainwork": "0000000000000000000000000000000000000000000000000644cb7f5234089e",
  "nTx": 4,
  "previousblockhash": "000000000002d01c1fccc21636b607dfd930d31d01c3a62104612a1719011250",
  "nextblockhash": "00000000000080b66c911bd5ba14a74260057311eaeb1982802f7010f1a9f090"
}


GET Block Stats

Endpoint
/v1/block/:hash/stats

Description
Returns statistical data about a Bitcoin block, identified by its block hash. The response includes various metrics such as transaction count, total input and output values, fee totals, average fee rate, block size, weight, and other block-specific statistics. This information is useful for analyzing block and network performance. The result is identical to Bitcoin Core's method getblockstats().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/block/0000000000000000000088c1a481e1ceff53d7dee42d0a973654faa5be4f6435/stats

Response example

{
  "avgfee": 2058,
  "avgfeerate": 6,
  "avgtxsize": 458,
  "blockhash": "0000000000000000000088c1a481e1ceff53d7dee42d0a973654faa5be4f6435",
  "feerate_percentiles": [
    4,
    6,
    7,
    7,
    10
  ],
  "height": 873000,
  "ins": 5452,
  "maxfee": 306294,
  "maxfeerate": 60,
  "maxtxsize": 69247,
  "medianfee": 1109,
  "mediantime": 1733195050,
  "mediantxsize": 332,
  "minfee": 0,
  "minfeerate": 0,
  "mintxsize": 150,
  "outs": 10070,
  "subsidy": 312500000,
  "swtotal_size": 1239463,
  "swtotal_weight": 2808592,
  "swtxs": 3302,
  "time": 1733196948,
  "total_out": 37370437762,
  "total_size": 1536250,
  "total_weight": 3995740,
  "totalfee": 6902453,
  "txs": 3354,
  "utxo_increase": 4618,
  "utxo_size_inc": 374454,
  "utxo_increase_actual": 4582,
  "utxo_size_inc_actual": 371330
}


GET Block Timestamp

Endpoint
/v1/block/:hash/timestamp

Description
A straightforward API endpoint that retrieves the timestamp of a Bitcoin block, indicating when it was mined.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/block/0000000000000000000088c1a481e1ceff53d7dee42d0a973654faa5be4f6435/timestamp

Response example

{
  "time": 1733196948
}


GET Block Deployments

Endpoint
/v1/block/:hash/deployments

Description
Returns an object containing various state info regarding deployments of consensus changes. The result is identical to Bitcoin Core's method getdeploymentinfo().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/block/0000000000000000000088c1a481e1ceff53d7dee42d0a973654faa5be4f6435/deployments

Response example

{
  "hash": "0000000000000000000088c1a481e1ceff53d7dee42d0a973654faa5be4f6435",
  "height": 873000,
  "deployments": {
    "bip34": {
      "type": "buried",
      "active": true,
      "height": 227931
    },
    "bip66": {
      "type": "buried",
      "active": true,
      "height": 363725
    },
    "bip65": {
      "type": "buried",
      "active": true,
      "height": 388381
    },
    "csv": {
      "type": "buried",
      "active": true,
      "height": 419328
    },
    "segwit": {
      "type": "buried",
      "active": true,
      "height": 481824
    },
    "taproot": {
      "type": "bip9",
      "height": 709632,
      "active": true,
      "bip9": {
        "start_time": 1619222400,
        "timeout": 1628640000,
        "min_activation_height": 709632,
        "status": "active",
        "since": 709632,
        "status_next": "active"
      }
    }
  }
}


GET Block Height

Endpoint
/v1/block/height/:height

Description
Returns hash of block in best-block-chain at height provided. The result is identical to Bitcoin Core's method getblockhash().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/block/height/800000

Response example

{
  "blockhash": "00000000000000000002a7c4c1e48d76c5a37902165a270156b7a8d72728a054"
}


GET Block Latest Hash

Endpoint
/v1/block/latest/hash

Description
Returns the hash of the best (tip) block in the most-work fully-validated chain. The result is identical to Bitcoin Core's method getbestblockhash().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/block/latest/hash

Response example

{
  "blockhash": "00000000000000000001225aed141d25ee1e6ca817f5a8837ffd2de0f28e249c"
}


GET Block Latest Height

Endpoint
/v1/block/latest/height

Description
Returns the height of the most-work fully-validated chain. The result is identical to Bitcoin Core's method getblockcount().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/block/latest/height

Response example

{
  "blockheight": 874430
}


GET Block Next

Endpoint This endpoint is updated once per minute
/v1/block/next

Description
Provides the data required to construct a block for mining a new Bitcoin block. This data closely approximates the block currently being mined by miners, as well as the next Bitcoin block. The output is identical to the result of Bitcoin Core's getblocktemplate() method. SegWit rule is activated.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/block/next

Response example

[
  {
    "txid": "568b835d9b099f96e3a937dce349a9a0d98d6712c939e808231d6df32356b954",
    "vsize": 129,
    "type": "data",
    "fee": 25800,
    "feerate": 200,
    "cpfp": false
  },
  {...}
]


GET Blocks

Endpoint
/v1/blocks[/:startHeight]

Description
Returns details of the last 10 blocks. If :startHeight is specified, it retrieves the 10 blocks ending at (and including) :startHeight. If :startHeight is not provided, the most recent 10 Bitcoin blocks are returned, starting from the newest.

Request example (Starting from a specific block height)

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/blocks/100000

Request example (Starting from the lastest (tip) block)

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/blocks

Response example

[
  {
    "avgfee": 0,
    "avgfeerate": 0,
    "avgtxsize": 247,
    "blockhash": "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
    "feerate_percentiles": [
      0,
      0,
      0,
      0,
      0
    ],
    "height": 100000,
    "ins": 3,
    "maxfee": 0,
    "maxfeerate": 0,
    "maxtxsize": 259,
    "medianfee": 0,
    "mediantime": 1293622620,
    "mediantxsize": 257,
    "minfee": 0,
    "minfeerate": 0,
    "mintxsize": 225,
    "outs": 6,
    "subsidy": 5000000000,
    "swtotal_size": 0,
    "swtotal_weight": 0,
    "swtxs": 0,
    "time": 1293623863,
    "total_out": 5301000000,
    "total_size": 741,
    "total_weight": 2964,
    "totalfee": 0,
    "txs": 4,
    "utxo_increase": 3,
    "utxo_size_inc": 267,
    "utxo_increase_actual": 3,
    "utxo_size_inc_actual": 267
  },
  {...}
]


GET Mempool Info

Endpoint
/v1/mempool/info

Description
Provides detailed information about the node's memory pool, which is the collection of unconfirmed transactions that the node has received and validated. This API is typically used for monitoring and understanding the state of the memory pool. The result is identical to Bitcoin Core's method getmempoolinfo().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/mempool/info

Response example

{
  "loaded": true,
  "size": 266249,
  "bytes": 105844532,
  "usage": 654519088,
  "total_fee": 1.51269445,
  "maxmempool": 5000000000,
  "mempoolminfee": 0.00001,
  "minrelaytxfee": 0.00001,
  "incrementalrelayfee": 0.00001,
  "unbroadcastcount": 0,
  "fullrbf": true
}


GET Mempool Histogram

Endpoint This endpoint is updated once per minute
/v1/mempool/histogram

Description
Return a histogram of the fee rates paid by transactions in the memory pool, weighted by transaction size. The histogram is an array of [fee, vsize] pairs, where vsizen is the cumulative virtual size of mempool transactions with a fee rate in the interval [feen-1, feen], and feen-1 > feen. Fee intervals may have variable size.

You can use the histogram to calculate the vMB from the tip of a Bitcoin transaction based on its fee rate. This allows you to determine whether the transaction is included in the current mining block template and if it will be confirmed in the next block.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/mempool/histogram

Response example

[
  [4.00, 463282],
  [3.10, 1169919],
  [2.40, 4931637],
  [2.10, 2826034],
  [1.01, 5710834],
  [1.00, 25550868]
]


GET Mempool Recent

Endpoint This endpoint is updated once per minute
/v1/mempool/recent

Description
Returns all recent mempool transactions from the last minute with basic information about each transaction. The list is sorted by broadcast/first seen time. At certain times, the list can become quite large.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/mempool/recent

Response example

[
  {
    "txid": "ed4a3a18bc481ccd34b202ab1c6a2d7ceff8d3a5732280dbacf1bf44ef0b3adc",
    "feerate": 5.7,
    "vsize": 141,
    "rbf": false,
    "time": 1734084779
  },
  {
    "txid": "d0f01770e0abe08fdb6f59fc843ad5f347d0d7adc84b8354d1e82d3e6a231933",
    "feerate": 5.01,
    "vsize": 342,
    "rbf": false,
    "time": 1734084779
  },
  {
    "txid": "f14487b864ffba80d41470a07619068a9d39b4c84d9636feac7132bc8b17db40",
    "feerate": 3.85,
    "vsize": 172,
    "rbf": false,
    "time": 1734084779
  },
  {...}
]


GET Mempool Recent Short

Endpoint This endpoint is updated once per minute
/v1/mempool/recent/short

Description
Returns the 10 most recent mempool transactions from the past minute, including basic information about each transaction. The list is sorted by broadcast time (or first seen time).

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/mempool/recent/short

Response example

[
  {
    "txid": "ed4a3a18bc481ccd34b202ab1c6a2d7ceff8d3a5732280dbacf1bf44ef0b3adc",
    "feerate": 5.7,
    "vsize": 141,
    "rbf": false,
    "time": 1734084779
  },
  {
    "txid": "d0f01770e0abe08fdb6f59fc843ad5f347d0d7adc84b8354d1e82d3e6a231933",
    "feerate": 5.01,
    "vsize": 342,
    "rbf": false,
    "time": 1734084779
  },
  {
    "txid": "f14487b864ffba80d41470a07619068a9d39b4c84d9636feac7132bc8b17db40",
    "feerate": 3.85,
    "vsize": 172,
    "rbf": false,
    "time": 1734084779
  },
  {... 7 more ...}
]


GET Mempool Transaction IDs

Endpoint This endpoint is updated once per minute
/v1/mempool/txids

Description
Retrieve the complete list of transaction IDs (txids) currently in the mempool, presented as an array. Keep in mind that the list is extremely large—hundreds of thousands of transactions!

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/mempool/txids

Response example

[
  "b94b67d2b87143d87d7b8a9f905e869bebff808beab50405181e4bd57b9b7201",
  "0bd2d5a33a80ec18083cd90de38e483109240f799629f8b183d66e1673166c01",
  "6fbdfa30b3e205e8d00fa38847ff95746c40f18c5f92b7755dc74f6d66796101",
  "d1d83ff40094f8b334cb0346173eb2e20abe7f26d4250bbc237f8206cc922201",
  "db27e4fbf3e566f8a3b627b9dc9e2f7503454ad5ca1bc567ddcdc75b06b80601",
  "4c458192309d67bc4730c9eed8ab3ae9bd650d7c9187031b98c52d1f49e4e300",
  "8e7f32cbcfbb4822106758729c41f1acc733848e8b87086f571deb4ddf2ca500",
  "d5fb815c2f1b0bb1869473b7c3f86e10ddfc4ded1876e6e30e9cfc30e5155800",
  "6498f9a2dbe2e55357c8509df31f7cf8f57238fd9bf368440896475933e21600",
  "6fe5bf6856d4e388fa1933b651bd68c28e7950875ef43b2b3698a4a8e7270c00",
  ...
]


GET Fees Estimate

Endpoint
/v1/fees/estimate/:confTarget

Description
Estimates the approximate fee per virtual byte (sat/vB) required for a transaction to begin confirmation within the specified confTarget number of blocks, if possible, and returns the number of blocks for which the estimate is valid. The confTarget must be between 1 and 1008 (up to 7 days).

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/fees/estimate/6

Response example

{
  "feerate": 4.629,
  "blocks": 6
}


GET Fees Estimates

Endpoint
/v1/fees/estimates

Description
This endpoint provides a comprehensive fee estimate for Bitcoin transactions over a range of confirmation targets. It returns a JSON object where the keys represent the target number of blocks (from 1 to 144) and the values indicate the estimated fee in satoshis per virtual byte (sat/vB) required for confirmation within that target.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/fees/estimates

Response example

{
  "1": 6.976,
  "2": 6.976,
  "3": 6.212,
  [...]
  "142": 3.144,
  "143": 3.144,
  "144": 3.144
}


GET Fees Tip

Endpoint This endpoint is updated once per minute
/v1/fees/tip

Description
This API endpoint returns the current tip fee rate in sat/vB, which represents the minimum fee rate in the current block template that miners are targeting. Transactions with a fee rate lower than this value will not be included in the next block. You can use this information to estimate whether a transaction is likely to be included in the upcoming block.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/fees/tip

Response example

{
  "tip_fee_rate": 11.26
}


GET Mining Info

Endpoint
/v1/mining/info

Description
Returns a json object containing mining-related information. The result is identical to Bitcoin Core's method getmininginfo().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/mining/info

Response example

{
  "blocks": 874603,
  "currentblockweight": 3995799,
  "currentblocktx": 3513,
  "difficulty": 103919634711492.2,
  "networkhashps": 888795412855650900000,
  "pooledtx": 272774,
  "chain": "main",
  "warnings": ""
}


GET Stats Blockchain

Endpoint
/v1/stats/blockchain

Description
Returns an object containing various state info regarding blockchain processing. The result is identical to Bitcoin Core's method getblockchaininfo().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/stats/blockchain

Response example

{
  "chain": "main",
  "blocks": 874606,
  "headers": 874606,
  "bestblockhash": "00000000000000000001bc25bdcae5c11568b630cbbef0bcac03698fdd054819",
  "difficulty": 103919634711492.2,
  "time": 1734115744,
  "mediantime": 1734114711,
  "verificationprogress": 0.9999963641651073,
  "initialblockdownload": false,
  "chainwork": "0000000000000000000000000000000000000000a04f2891d4b2386e7732e00a",
  "size_on_disk": 707650008383,
  "pruned": false,
  "warnings": ""
}


GET Stats Transactions

Endpoint
/v1/stats/transactions

Description
Compute statistics about the total number and rate of transactions in the chain for the last 30 days. The result is identical to Bitcoin Core's method getchaintxstats().

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/stats/transactions

Response example

{
  "time": 1734115744,
  "txcount": 1131319278,
  "window_final_block_hash": "00000000000000000001bc25bdcae5c11568b630cbbef0bcac03698fdd054819",
  "window_final_block_height": 874606,
  "window_block_count": 4320,
  "window_interval": 2525041,
  "window_tx_count": 15055659,
  "txrate": 5.962540410234923
}


GET Price

Endpoint
/v1/price

Description
Returns bitcoin latest price denominated in USD.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/price

Response example

{
  "timestamp": 1734119701,
  "usd": 101474.66297300941
}


GET Price Historic

Endpoint
/v1/price/historic/:timestamp

Description
Returns the historical price of Bitcoin denominated in USD. The earliest possible timestamp is 1279408157 (Jul 17 2010 23:09:17 GMT). For dates or timestamps earlier than this, the returned value is null.

Request example

curl -H "X-API-Key: YOUR_API_KEY" https://api.bitref.com/v1/price/historic/1489805000

Response example

{
  "timestamp": 1489804798,
  "usd": 1056.32
}