NAV Navigation

Introduction

Welcome to Bitails! We are a BSV archive, indexer, and UTXO manager that provides APIs, sockets, and other features for developers and companies working on BSV. With Bitails, you don't need to worry about the size of the BSV blockchain. Our focus is on providing exceptional services to help you build your ideas faster and with less effort. Try out our new features and easily manage UTXOs, send data to BSV, fetch data from BSV, watch entities, and create your applications with ease!

Pricing

Plans

Bitails offers a diverse range of flexible pricing plans to meet the unique needs of users. From basic plans ideal for small-scale usage to advanced packages tailored for larger enterprises, Bitails ensures both scalability and affordability.

Plan Features Monthly Yearly
Free
  • 10 requests per second
  • 1,000 requests per day
  • 10 MB transaction size limit
  • Email support
$0 $0
Basic
  • 30 requests per second
  • 300,000 requests per day
  • 20 MB transaction size limit
  • Additional features
  • Priority support
$300 $3300 (1 month free)
Professional
  • Unlimited requests per second
  • 500,000 requests per day
  • 40 MB transaction size limit
  • All Features
  • Dedicated support
$500 $5500 (1 month free)
Enterprise
  • Custom requests per second
  • Custom requests per day
  • Custom transaction size limit
  • All features
  • Custom Service Level Agreements (SLA)
Contact us for pricing Contact us for pricing

For detailed information on Bitails' pricing plans and to discuss a tailored solution that suits your specific requirements, please contact us at [email protected].

Authentication & API Key

# Example of using an API key with cURL
curl -X GET "https://api.bitails.io/network/info" -H "apikey: YOUR_API_KEY_HERE"

The NodeJS example for using the API key in a request.

const https = require('https');

const options = {
  hostname: 'api.bitails.io',
  path: '/network/info',
  method: 'GET',
  headers: {
    'apikey': 'YOUR_API_KEY_HERE'
  }
};

const req = https.request(options, res => {
  console.log(`statusCode: ${res.statusCode}`);
  res.on('data', d => {
    process.stdout.write(d);
  });
});

req.on('error', error => {
  console.error(error);
});

req.end();

To access Bitails' API services, users are required to include their unique API key in the request header. For users without an API key, access is limited to 10 transactions per second (TPS) and 1000 daily requests.

Swagger

The Swagger UI is available for both mainnet and testnet.

Mainnet - API: https://api.bitails.io/swagger

Testnet - API: https://test-api.bitails.io/swagger

Mainnet - mAPI: https://mapi.bitails.io/swagger

Testnet - mAPI: https://test-mapi.bitails.io/swagger

Scripthash

Get Unspent of Scripthash

# Example scripthash: c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232 
curl "https://api.bitails.io/scripthash/c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232/unspent"

The above command returns JSON structured like this:

[
  {
    "scripthash": "c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232",
    "unspent": [
      {
        "txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
        "vout": 1,
        "satoshis": 3522,
        "time": "1645960789",
        "blockheight": 815019,
        "confirmations": 200
      }
    ]
  }
]

This endpoint retrieves unspent outputs (UTXOs) of a scripthash.

HTTP Request

GET https://api.bitails.io/scripthash/{scripthash}/unspent

Parameter Description
scripthash The scripthash to query.
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.

Get Unspent of Multiple Scripthashes

curl -X POST "https://api.bitails.io/scripthash/unspent/multi" \
-H "Content-Type: application/json" \
-d '{"scripthashes": ["213fb7922dc20cae6bd1cbf27f708a15fc089efdac632118fc8fb60ef1899630", "bbec6039916d01db85a839e06d84d95415515a7d791393128303707e5dd1c211"]}'

The above command returns JSON structured like this:

[
  {
    "scripthash": "bbec6039916d01db85a839e06d84d95415515a7d791393128303707e5dd1c211",
    "unspent": [
      {
        "txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
        "vout": 1,
        "satoshis": 3522,
        "time": "1645960789",
        "blockheight": 815019,
        "confirmations": 200
      }
    ]
  },
  {
    "scripthash": "213fb7922dc20cae6bd1cbf27f708a15fc089efdac632118fc8fb60ef1899630",
    "unspent": [
      {
        "txid": "some_other_txid",
        "vout": 0,
        "satoshis": 5000,
        "time": "1645960888",
        "blockheight": 815020,
        "confirmations": 199
      }
    ]
  }
]

This endpoint retrieves unspent outputs (UTXOs) for multiple scripthashes.

HTTP Request

POST https://api.bitails.io/scripthash/unspent/multi

Parameter Description
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return per scripthash.

Get Balance of Scripthash

# c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232 
curl "https://api.bitails.io/scripthash/c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232/balance"

The above command returns JSON structured like this:

{
  "scripthash": "c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232",
  "confirmed": 36453,
  "unconfirmed": 1000,
  "summary": 37453,
  "count": 34
}

This endpoint retrieves the balance of a scripthash.

HTTP Request

GET https://api.bitails.io/scripthash/{scripthash}/balance

Parameter Description
scripthash The scripthash to query.

Get Balance of Multiple Scripthashes

curl -X POST "https://api.bitails.io/scripthash/balance/multi" \
-H "Content-Type: application/json" \
-d '{"scripthashes": ["213fb7922dc20cae6bd1cbf27f708a15fc089efdac632118fc8fb60ef1899630", "bbec6039916d01db85a839e06d84d95415515a7d791393128303707e5dd1c211"]}'

The above command returns JSON structured like this:

{
  "confirmed": 36453,
  "unconfirmed": 1000,
  "summary": 37453,
  "count": 34
}

This endpoint retrieves the total balance of multiple scripthashes combined.

HTTP Request

POST https://api.bitails.io/scripthash/balance/multi

Get History of Scripthash

# c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232 
curl "https://api.bitails.io/scripthash/c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232/history"

The above command returns JSON structured like this:

[
  {
    "scripthash": "c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232",
    "histories": [
      {
        "txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
        "inputSatoshis": 2000,
        "outputSatoshis": 0,
        "time": 1655049588,
        "blockheight": 815019
      }
    ]
  }
]

This endpoint retrieves the history of a scripthash. Note that the inputSatoshis and outputSatoshis refer to the role of the scripthash in the transaction. In other words, when inputSatoshis is a non-zero value, it means the scripthash was seen in the inputs of the transaction (Spent), and when outputSatoshis is non-zero, it implies that the scripthash was seen in the output of the transaction (Received).

HTTP Request

GET https://api.bitails.io/scripthash/{scripthash}/history

URL Parameters

Parameter Description
scripthash The scripthash to query.
pgkey (Optional) Pagination key from a previous response to fetch the next page.
limit (Optional) Number of history items to return. Maximum 5000.

Scenario Using pgkey

1. The first request has no pgkey. It's recommended to set a limit, e.g., limit=5000.

2. The response will include up to 5000 history items plus a pgkey, which acts as a placeholder pointing to the last served data.

3. In later requests, this pgkey should be sent to the server. Each response will have a new pgkey to be used in the next request.

How do we know when we get to the end of the history?

Good question! When you receive a response that no longer contains a pgkey, it means you have reached the end of the history. It is like scrolling to the bottom of a page.

Get Details of Scripthash

# c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232 
curl "https://api.bitails.io/scripthash/c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232/details"

The above command returns JSON structured like this:

{
  "balance": {
    "scripthash": "c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232",
    "confirmed": 36453,
    "unconfirmed": 1000,
    "summary": 37453,
    "count": 34
  },
  "lastSeen": {
    "txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
    "inputSatoshis": 0,
    "outputSatoshis": 12120,
    "time": 1655049588,
    "blockheight": 815019
  },
  "firstSeen": {
    "txid": "c3d6c4b466bc369561fa854cab42a6acd89aeeb528c5ffbde83e7a380dfc7914",
    "inputSatoshis": 0,
    "outputSatoshis": 12120,
    "time": 1655049588,
    "blockheight": 815019
  }
}

This endpoint retrieves the details of a scripthash.

HTTP Request

GET https://api.bitails.io/scripthash/{scripthash}/details

Parameter Description
scripthash The scripthash to query.

Address

Get Unspent of Address

# 18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e 
curl "https://api.bitails.io/address/18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e/unspent"

The above command returns JSON structured like this:

{
  "address": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
  "scripthash": "c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232",
  "unspent": [
    {
      "txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
      "vout": 1,
      "satoshis": 3522,
      "time": 1645960789,
      "blockheight": 815019,
      "confirmations": 200
    }
  ]
}

This endpoint retrieves unspent outputs (UTXOs) of an address.

HTTP Request

GET https://api.bitails.io/address/{address}/unspent

Parameter Description
address The address to query.
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.

Get Unspent of Multiple Addresses

curl -X POST "https://api.bitails.io/address/unspent/multi" \
-H "Content-Type: application/json" \
-d '{"addresses": ["18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e", "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e"]}'

The above command returns JSON structured like this:

[
  {
    "address": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
    "scripthash": "c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232",
    "unspent": [
      {
        "txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
        "vout": 1,
        "satoshis": 3522,
        "time": 1645960789,
        "blockheight": 815019,
        "confirmations": 200
      }
    ]
  },
  {
    "address": "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e",
    "scripthash": "some_other_scripthash",
    "unspent": [
      {
        "txid": "some_other_txid",
        "vout": 0,
        "satoshis": 5000,
        "time": 1645960888,
        "blockheight": 815020,
        "confirmations": 199
      }
    ]
  }
]

This endpoint retrieves unspent outputs (UTXOs) of multiple addresses.

HTTP Request

POST https://api.bitails.io/address/unspent/multi

Parameter Description
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return per address.

Get Balance of Address

# 18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e  
curl "https://api.bitails.io/address/18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e/balance"

The above command returns JSON structured like this:

{
  "address": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
  "scripthash": "c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232",
  "confirmed": 36453,
  "unconfirmed": 1000,
  "summary": 37453,
  "count": 34
}

This endpoint retrieves the balance of an address.

HTTP Request

GET https://api.bitails.io/address/{address}/balance

Parameter Description
address The address to query.

Get Balance of Multiple Addresses

curl -X POST "https://api.bitails.io/address/balance/multi" \
-H "Content-Type: application/json" \
-d '{"addresses": ["18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e", "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e"]}'

The above command returns JSON structured like this:

{
  "confirmed": 36453,
  "unconfirmed": 1000,
  "summary": 37453,
  "count": 34
}

This endpoint retrieves the combined balance of multiple addresses.

HTTP Request

POST https://api.bitails.io/address/balance/multi

Get Balance of Multiple Addresses Separately

curl -X POST "https://api.bitails.io/address/balance/multi/separate" \
-H "Content-Type: application/json" \
-d '{"addresses": ["18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e", "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e"]}'

The above command returns JSON structured like this:

[
  {
    "confirmed": 36453,
    "unconfirmed": 1000,
    "summary": 37453,
    "count": 34,
    "address": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e"
  },
  {
    "confirmed": 10000,
    "unconfirmed": 0,
    "summary": 10000,
    "count": 2,
    "address": "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e"
  }
]

This endpoint retrieves the balance of multiple addresses separately.

HTTP Request

POST https://api.bitails.io/address/balance/multi/separate

Get History of Address

# 18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e  
curl "https://api.bitails.io/address/18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e/history"

The above command returns JSON structured like this:

[
  {
    "address": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
    "scripthash": "c79e8d823c1ce9b80c9c340a389409f489989800044466c9d05bfef12c472232",
    "histories": [
      {
        "txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
        "inputSatoshis": 0,
        "outputSatoshis": 12120,
        "time": 1655049588,
        "blockheight": 815019
      }
    ]
  }
]

This endpoint retrieves the history of an address. Note that inputSatoshis and outputSatoshis refer to the role of the address in the transaction. When inputSatoshis is non-zero, the address was in the inputs (Spent). When outputSatoshis is non-zero, the address was in the outputs (Received).

HTTP Request

GET https://api.bitails.io/address/{address}/history

Parameter Description
address The address to query.
pgkey (Optional) Pagination key for fetching the next page.
limit (Optional) Number of history items to return. Maximum 5000.

Scenario Using pgkey

1. The first request has no pgkey. It's recommended to set a limit, e.g., limit=5000.

2. The response will include up to 5000 history items plus a pgkey, which acts as a placeholder pointing to the last served data.

3. In later requests, this pgkey should be sent to the server. Each response will have a new pgkey to be used in the next request.

How do we know when we get to the end of the history?

Good question! When you receive a response that no longer contains a pgkey, it means you have reached the end of the history.

Get History of Multiple Addresses

curl -X POST "https://api.bitails.io/address/history/multi" \
-H "Content-Type: application/json" \
-d '{"addresses": ["18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e", "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e"]}'

The above command returns JSON structured like this:

[
  {
    "txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
    "inputSatoshis": 1123,
    "outputSatoshis": 0,
    "time": 1655049588,
    "blockheight": 815019
  },
  {
    "txid": "some_other_txid",
    "inputSatoshis": 3243,
    "outputSatoshis": 0,
    "time": 1655049589,
    "blockheight": 815020
  }
]

This endpoint retrieves the combined history of multiple addresses.

HTTP Request

POST https://api.bitails.io/address/history/multi

Parameter Description
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.

Get Details of Address

# 18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e  
curl "https://api.bitails.io/address/18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e/details"

The above command returns JSON structured like this:

{
  "balance": {
    "address": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
    "confirmed": 36453,
    "unconfirmed": 1000,
    "summary": 37453,
    "count": 34
  },
  "lastSeen": {
    "txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
    "inputSatoshis": 0,
    "outputSatoshis": 12120,
    "time": 1655049588,
    "blockheight": 815019
  },
  "firstSeen": {
    "txid": "c3d6c4b466bc369561fa854cab42a6acd89aeeb528c5ffbde83e7a380dfc7914",
    "inputSatoshis": 0,
    "outputSatoshis": 12120,
    "time": 1655049588,
    "blockheight": 815019
  }
}

This endpoint retrieves the details of an address.

HTTP Request

GET https://api.bitails.io/address/{address}/details

Parameter Description
address The address to query.

Get the Richest Addresses

curl "https://api.bitails.io/analytics/address/rich"

The above command returns JSON structured like this:

[
  {
    "address": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
    "scripthash": "dd5d03690485426ca964ec1cf5c05e1cf6b59952177f59ba735d958fe1945298",
    "type": "pubkeyhash",
    "balance": 3733434432453
  }
]

This endpoint retrieves the top 100 addresses with the highest BSV balance. This list gets updated on a daily basis around 2:00 A.M. UTC.

HTTP Request

GET https://api.bitails.io/analytics/address/rich

Transaction

The Transaction API is used to retrieve the details of a transaction. Find documentation regarding sockets on transactions in the 'Socket' section.

Get Input of Transaction (Deprecated)

# 687a32b54ea9a8f270e648cdd6666185e452e5a9a92cabfc506d1bc1e3ecc5ac  
curl "https://api.bitails.io/tx/687a32b54ea9a8f270e648cdd6666185e452e5a9a92cabfc506d1bc1e3ecc5ac/input/0"

The above command returns JSON structured like this:

{
  "index": 0,
  "source": {
    "txid": "5a63449e5bcbc2e266857c9a2f90ae4cea9907b4dd16793d2db11f9524caaff7",
    "index": 0,
    "script": "76a9141519647c1f457a5f7784ef552ce0538dd3a5678a88ac",
    "scripthash": "43451f28dff6dd3109af4b83e5fe7828120d1169d1c1c5106c58b2f7039d50c4",
    "satoshis": 18776
  },
  "scriptSig": "483045022100cfda7d900ccce55c40089df9474e61177f27ac2f3be74b9e958805fab61c992202206ad20dbfcdb244fa8d49fbbb6fde6d5dbe43cd9f93e8d96b6bea983079f17829412102062d9f5d80fcd868c5db4ace2fb38d907296c0b2a00b603a0ec4237b850a04e7",
  "sequence": 4294967295
}

This endpoint retrieves a specific input of a transaction.

HTTP Request

GET https://api.bitails.io/tx/{txid}/input/{inputIndex}

Parameter Description
txid The transaction ID.
inputIndex The index of the input.

Get Inputs of Transaction (Deprecated)

# f3f4e891bf22e62530acdedae2ec383cd961b8ca70039c4183c1dee16ef8463b  
curl "https://api.bitails.io/tx/f3f4e891bf22e62530acdedae2ec383cd961b8ca70039c4183c1dee16ef8463b/inputs/0/3"

The above command returns JSON structured like this:

[
  {
    "index": 0,
    "source": {
      "txid": "5a63449e5bcbc2e266857c9a2f90ae4cea9907b4dd16793d2db11f9524caaff7",
      "index": 0,
      "script": "76a9141519647c1f457a5f7784ef552ce0538dd3a5678a88ac",
      "scripthash": "43451f28dff6dd3109af4b83e5fe7828120d1169d1c1c5106c58b2f7039d50c4",
      "satoshis": 18776
    },
    "scriptSig": "483045022100cfda7d900ccce55c40089df9474e61177f27ac2f3be74b9e958805fab61c992202206ad20dbfcdb244fa8d49fbbb6fde6d5dbe43cd9f93e8d96b6bea983079f17829412102062d9f5d80fcd868c5db4ace2fb38d907296c0b2a00b603a0ec4237b850a04e7",
    "sequence": 4294967295
  }
]

This endpoint retrieves multiple inputs of a transaction within a given range.

HTTP Request

GET https://api.bitails.io/tx/{txid}/inputs/{fromIndex}/{toIndex}

Parameter Description
txid The transaction ID.
fromIndex The starting index of inputs to retrieve.
toIndex The ending index of inputs to retrieve.

Get Output of Transaction (Deprecated)

# f3f4e891bf22e62530acdedae2ec383cd961b8ca70039c4183c1dee16ef8463b  
curl "https://api.bitails.io/tx/f3f4e891bf22e62530acdedae2ec383cd961b8ca70039c4183c1dee16ef8463b/output/0"

The above command returns JSON structured like this:

{
  "index": 0,
  "type": "nulldata",
  "reqSigs": -1,
  "scripthash": "cbb5deafd5267b5cc8b09e4396928035121de3135ff053117eceebb882875d82",
  "scriptSize": 938,
  "partialScript": false,
  "script": "006a22... (partial data)"
}

This endpoint retrieves a specific output of a transaction.

HTTP Request

GET https://api.bitails.io/tx/{txid}/output/{outputIndex}

Parameter Description
txid The transaction ID.
outputIndex The index of the output.

Get Outputs of Transaction (Deprecated)

# f3f4e891bf22e62530acdedae2ec383cd961b8ca70039c4183c1dee16ef8463b  
curl "https://api.bitails.io/tx/f3f4e891bf22e62530acdedae2ec383cd961b8ca70039c4183c1dee16ef8463b/outputs/0/3"

The above command returns JSON structured like this:

[
  {
    "index": 0,
    "type": "nulldata",
    "reqSigs": -1,
    "scripthash": "cbb5deafd5267b5cc8b09e4396928035121de3135ff053117eceebb882875d82",
    "scriptSize": 938,
    "partialScript": false,
    "script": "006a22... (partial data)"
  },
  {
    "index": 1,
    "type": "pubkeyhash",
    "reqSigs": 1,
    "satoshis": 800,
    "scripthash": "some_other_scripthash",
    "scriptSize": 25,
    "partialScript": false,
    "script": "76a914feaf96c5b259c80d36bdd1d6f1d8caa9bb584fe188ac"
  }
]

This endpoint retrieves multiple outputs of a transaction.

HTTP Request

GET https://api.bitails.io/tx/{txid}/outputs/{fromIndex}/{toIndex}

Parameter Description
txid The transaction ID.
fromIndex The starting index of outputs to retrieve.
toIndex The ending index of outputs to retrieve.

Get Transaction By ID

# c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0  
curl "https://api.bitails.io/tx/c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0"

The above command returns JSON structured like this:

{
  "txid": "c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0",
  "blockhash": "00000000000000001055c413778451e93e4ab0b4ee442900470abe777916da35",
  "blockheight": 742364,
  "inblockIndex": 5,
  "confirmations": 1234,
  "time": 1654203396,
  "size": 1128,
  "fee": 645,
  "ops": [0],
  "inputsCount": 2,
  "sumOfInputsSatoshis": 1247,
  "outputsCount": 2,
  "sumOfOutputsSatoshis": 602,
  "locktime": 0,
  "partialInputs": false,
  "inputs": [
    {
      "index": 0,
      "source": {
        "txid": "5a63449e5bcbc2e266857c9a2f90ae4cea9907b4dd16793d2db11f9524caaff7",
        "index": 0,
        "script": "76a914334e3f294c770f954055533c8141a91a7f7ab0fa88ac",
        "scripthash": "2d287814f112e35f2c665b7c29a4ff2e8c8435c1d6353e5a0b34432209e87f73",
        "satoshis": 18776
      },
      "scriptSig": "48304502... (partial data)",
      "sequence": 4294967295
    }
  ],
  "partialOutputs": false,
  "outputs": [
    {
      "index": 0,
      "type": "nulldata",
      "reqSigs": -1,
      "scripthash": "cbb5deafd5267b5cc8b09e4396928035121de3135ff053117eceebb882875d82",
      "scriptSize": 938,
      "partialScript": false,
      "script": "006a22... (partial data)"
    }
  ]
}

This endpoint retrieves the parsed format of a transaction.

HTTP Request

GET https://api.bitails.io/tx/{txid}

Parameter Description
txid The transaction ID.

Get Transaction Status By ID

# c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0  
curl "https://api.bitails.io/tx/c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0/status"

The above command returns JSON structured like this:

{
  "txid": "c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0",
  "blockhash": "00000000000000001055c413778451e93e4ab0b4ee442900470abe777916da35",
  "blockheight": 742364,
  "blocktime": 1654203396,
  "confirmations": 1234,
  "status": "confirmed"
}

This endpoint retrieves the status of a transaction (possible values: `confirmed`, `mempool`, `Not Found`).

HTTP Request

GET https://api.bitails.io/tx/{txid}/status

Parameter Description
txid The transaction ID.

Get Multiple Transactions Status By Their IDs

curl -X POST "https://api.bitails.io/tx/status/multi" \
-H "Content-Type: application/json" \
-d '{"txIds": ["c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0"]}'

The above command returns JSON structured like this:

[
  {
    "txid": "c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0",
    "blockhash": "00000000000000001055c413778451e93e4ab0b4ee442900470abe777916da35",
    "blockheight": 742364,
    "blocktime": 1654203396,
    "confirmations": 1234,
    "status": "confirmed"
  }
]

This endpoint retrieves the status of a batch of transactions (`confirmed`, `mempool`, `Not Found`).

HTTP Request

POST https://api.bitails.io/tx/status/multi

Parameter Description
txIds An array of transaction IDs in the request body.

Get UTXO Status

curl "https://api.bitails.io/tx/c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0/output/1/status"

The above command returns JSON structured like this:

{
  "txid": "c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0",
  "index": 1,
  "blockheight": 742364,
  "status": "exists",
  "spent": false
}

This endpoint retrieves the status of a UTXO.

exists/false: The UTXO is mined in a previous block and has not been spent in the mempool.

exists/true: The UTXO is mined in a previous block but has been spent recently in a transaction which is not yet mined.

mempool/false: The UTXO was just created and has not been mined or spent.

mempool/true: The UTXO was just created and has not been mined but has been spent in another transaction which is also in the mempool.

unknown: We don't have the UTXO (it was spent or never existed).

HTTP Request

GET https://api.bitails.io/tx/{txid}/output/{outputIndex}/status

Parameter Description
txid The transaction ID of the UTXO.
outputIndex The output index of the UTXO.

Get Multiple UTXOs Status

curl -X POST "https://api.bitails.io/tx/output/status/multi" \
-H "Content-Type: application/json" \
-d '{"outputs": [{"txid":"c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0", "index": 1 }]}'

The above command returns JSON structured like this:

[
  {
    "txid": "c32597ddd7d8623d7eb1ddd854ab36541e037dc1f9f0ab7aaf55d3a1e5a17af0",
    "index": 1,
    "blockheight": 742364,
    "status": "exists",
    "spent": false
  }
]

This endpoint retrieves the status of multiple UTXOs.

exists/false: The UTXO is mined and unspent.

exists/true: The UTXO is mined but spent in a mempool transaction.

mempool/false: The UTXO is in the mempool and unspent.

mempool/true: The UTXO is in the mempool and has also been spent in another mempool transaction.

unknown: The UTXO was not found (it may have been spent or never existed).

HTTP Request

POST https://api.bitails.io/tx/output/status/multi

Parameter Description
outputs An array of objects, each containing a `txid` and `index`, in the request body.

Get Merkle Proof

# 13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89  
curl "https://api.bitails.io/tx/13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89/proof"

The above command returns JSON structured like this:

{
  "blockhash": "00000000000000000085985685d702b6c2911db73800cc5601333e2f60312ba2",
  "branches": [
    {
      "pos": "R",
      "hash": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c"
    },
    {
      "pos": "L",
      "hash": "966d90b60347991a47feff12dd3533d89b68cda452488e236481da0456a169d6"
    }
  ],
  "hash": "13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89",
  "merkleRoot": "10aff887bac4789106e85312b2afdcebd71926c15b0604236af9f2972ab30d8d"
}

This endpoint retrieves the Merkle proof of a transaction.

HTTP Request

GET https://api.bitails.io/tx/{txid}/proof

Parameter Description
txid The transaction ID.

Get Merkle Proof - TSC Format

# 13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89  
curl "https://api.bitails.io/tx/13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89/proof/tsc"

The above command returns JSON structured like this:

{
  "index": 6,
  "txOrId": "13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89",
  "target": "00000000000000000085985685d702b6c2911db73800cc5601333e2f60312ba2",
  "nodes": [
    "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
    "966d90b60347991a47feff12dd3533d89b68cda452488e236481da0456a169d6",
    "ea0b162823c00a628575ab0c4c008837a1d8e6544932be457dff1c5ef8c5a2bc",
    "831c2840c0882ca369fd18b5187ea55a3108245480c6b25ff6cd15ec0f563990"
  ]
}

This endpoint retrieves the Merkle proof of a transaction in the TSC (Tokenized Smart Contracts) compatible format.

HTTP Request

GET https://api.bitails.io/tx/{txid}/proof/tsc

Parameter Description
txid The transaction ID.

Send Raw Transaction

curl -X POST "https://api.bitails.io/tx/broadcast" \
-H "Content-Type: application/json" \
-d '{"raw": "0100000001..."}'

The above command returns JSON structured like this:

{
  "txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c"
}

This endpoint broadcasts a raw transaction in hex format to the blockchain. The maximum size is 32MB.

HTTP Request

POST https://api.bitails.io/tx/broadcast

Request Body

Key Value
raw The raw transaction in hex format.

Send Multiple Raw Transactions

curl -X POST "https://api.bitails.io/tx/broadcast/multi" \
-H "Content-Type: application/json" \
-d '{"raws": ["01000000...", "01000000..."]}'

The above command returns JSON structured like this:

[
  {
    "txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
    "error": null
  },
  {
    "txid": "some_other_txid",
    "error": {
      "code": 64,
      "message": "transaction already in block chain"
    }
  }
]

This endpoint broadcasts multiple raw transactions in hex format to the blockchain. Each transaction can be up to 32MB.

HTTP Request

POST https://api.bitails.io/tx/broadcast/multi

Request Body

Key Value
raws An array of raw transactions in hex format.

Send Big Raw Transaction

// Example using NodeJS and the 'form-data' library
const FormData = require('form-data');
const axios = require('axios');

const form = new FormData();
const rawTxHex = '0100000001944a3a02dd89a9eb0336a137...';
form.append('raw', Buffer.from(rawTxHex, 'hex'), {
  filename: 'raw'
});

axios.post('https://api.bitails.io/tx/broadcast/multipart', form, {
  headers: {
    ...form.getHeaders()
  }
})
.then(res => {
  console.log(res.data);
})
.catch(err => {
  console.error(err);
});

The above command returns JSON structured like this:

{
  "txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c"
}

This endpoint is useful for broadcasting a very large transaction using multipart form data.

HTTP Request

POST https://api.bitails.io/tx/broadcast/multipart

Request Body

Key Value
raw The raw transaction as a file/buffer in a multipart form.

Block

Get Block By Height

curl "https://api.bitails.io/block/height/780000"

The above command returns JSON structured like this:

{
  "hash": "000000000000000005e14d3f9fdfb70745308706615cfa9edca4f4558332b201",
  "size": 81577,
  "height": 780000,
  "version": 536870912,
  "versionHex": "20000000",
  "merkleroot": "4af279645e1b337e655ae3286fc2ca09f58eb01efa6ab27adedd1e9e6ec19091",
  "transactionCount": 150,
  "time": 1509343584,
  "minerId": "TAAL",
  "orphan": false,
  "transactionsDetails": [
    {
      "index": 0,
      "txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
      "inputsCount": 2,
      "outputsCount": 2,
      "size": 350
    }
  ]
}

This endpoint retrieves block data by its height.

HTTP Request

GET https://api.bitails.io/block/height/{height}

Parameter Description
height The height of the block.

Count Blocks By Miner

curl "https://api.bitails.io/block/count?minerId=taal"

The above command returns a raw count like this:

56736

This endpoint retrieves the total number of blocks mined by a specific miner.

HTTP Request

GET https://api.bitails.io/block/count?minerId={minerId}

Parameter Description
minerId The name of the miner (e.g., taal, gorillapool).

Get Block List

curl "https://api.bitails.io/block/list?skip=1000&limit=10&sort=height&direction=asc"

The above command returns JSON structured like this:

[
  {
    "hash": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09",
    "height": 1000,
    "time": 1232346882,
    "size": 216,
    "transactionsCount": 1,
    "details": {
      "transactionsInputsCount": 1,
      "sumOfInputSatoshis": 0,
      "transactionsOutputsCount": 1,
      "sumOfOutputSatoshis": 0,
      "totalFee": 0,
      "minerId": ""
    }
  }
]

This endpoint retrieves a list of blocks with details.

HTTP Request

GET https://api.bitails.io/block/list?skip={skip}&limit={limit}&sort={sortBy}&direction={asc|desc}

URL Parameters

Parameter Description
skip Number of blocks to skip.
limit Number of blocks to list.
sortBy Field to sort by: `height`, `size`, `transactions`, `fees`.
direction Sort direction: `asc` or `desc`.

Get Latest Block

curl "https://api.bitails.io/block/latest"

The above command returns JSON structured like this:

{
  "hash": "000000000000000005e14d3f9fdfb70745308706615cfa9edca4f4558332b201",
  "size": 81577,
  "height": 820000,
  "merkleroot": "4af279645e1b337e655ae3286fc2ca09f58eb01efa6ab27adedd1e9e6ec19091",
  "transactionCount": 150,
  "time": 1509343584,
  "minerId": "TAAL",
  "partialTransactions": true,
  "transactionsDetails": [
    {
      "index": 0,
      "txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
      "size": 350
    }
  ]
}

This endpoint retrieves the latest block.

HTTP Request

GET https://api.bitails.io/block/latest

Get Block By Hash

curl "https://api.bitails.io/block/00000000000000000058a67bbadcf82be15cce1c1539aa63120bbb255a0b1586"

The above command returns JSON structured like this:

{
  "hash": "00000000000000000058a67bbadcf82be15cce1c1539aa63120bbb255a0b1586",
  "size": 81577,
  "height": 790000,
  "transactionCount": 150,
  "transactionsDetails": [
    {
      "index": 0,
      "txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
      "size": 350
    }
  ]
}

This endpoint retrieves block data by its hash.

HTTP Request

GET https://api.bitails.io/block/{blockhash}

Parameter Description
blockhash The hash of the block.

Get Block Header by Height

curl "https://api.bitails.io/block/header/height/765465/raw"

The above command returns JSON structured like this:

{
  "header": "010000000c59cf62add14129195d91b7e55dad81b539002d7366acfc01902c0000000000ec5abb8c8b90e2e04c14648853ba9d262e4e8677b374a7da52650f2ea5ea1a9275f2794c9820691b0689738c"
}

This endpoint retrieves the raw block header by its height.

HTTP Request

GET https://api.bitails.io/block/header/height/{blockheight}/raw

Parameter Description
blockheight The height of the block.

Get Block Header by Hash

curl "https://api.bitails.io/block/00000000000000000c32fce76b3ccaf9606b1a54579a381449482d4b902953ad/header"

The above command returns JSON structured like this:

{
  "header": "010000000c59cf62add14129195d91b7e55dad81b539002d7366acfc01902c0000000000ec5abb8c8b90e2e04c14648853ba9d262e4e8677b374a7da52650f2ea5ea1a9275f2794c9820691b0689738c"
}

This endpoint retrieves the raw block header by its hash.

HTTP Request

GET https://api.bitails.io/block/{blockHash}/header

Parameter Description
blockHash The hash of the block.

Get Transactions of Block

curl "https://api.bitails.io/block/00000000000000000058a67bbadcf82be15cce1c1539aa63120bbb255a0b1586/transactions?from=10&limit=20"

The above command returns JSON structured like this:

[
  {
    "index": 10,
    "txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
    "inputsCount": 2,
    "outputsCount": 2,
    "size": 350,
    "ops": [4,6],
    "tags": ["upfile"]
  },
  {
    "index": 11,
    "txid": "some_other_txid",
    "inputsCount": 1,
    "outputsCount": 2,
    "size": 224
  }
]

This endpoint retrieves the transactions of a block.

HTTP Request

GET https://api.bitails.io/block/{blockhash}/transactions

Parameter Description
blockhash The hash of the block.
from (Optional) The starting index of transactions.
limit (Optional) The number of transactions to return.

Get Stats of Transactions

curl "https://api.bitails.io/block/stats/tag/summary?fromTime=1684230509&toTime=1684930509"

The above command returns JSON structured like this:

[
  {
    "tag": "upfile",
    "count": 1472
  },
  {
    "tag": "run",
    "count": 850
  }
]

This endpoint retrieves the stats summary of transactions (based on tags) in blocks, not including transactions in the mempool.

HTTP Request

GET https://api.bitails.io/block/stats/tag/summary

Parameter Description
fromTime Start time in Unix epoch format (required).
toTime (Optional) End time in Unix epoch format.

Get Histogram Stats of Transactions

curl "https://api.bitails.io/block/stats/tag/1h/histogram?fromTime=1700659941&toTime=1701091969"

The above command returns JSON structured like this:

[
  {
    "time": 1700661491,
    "tags": [
      {
        "tag": "stas",
        "count": 7
      },
      {
        "tag": "run",
        "count": 28
      }
    ]
  }
]

This endpoint retrieves the histogram summary of transactions (based on tags) in blocks, not including transactions in the mempool.

HTTP Request

GET https://api.bitails.io/block/stats/tag/{period}/histogram

Parameter Description
period The time period for aggregation: `1h`, `24h`, `7d`.
fromTime Start time in Unix epoch format (required).
toTime (Optional) End time in Unix epoch format.

Get Histogram Mining Stats

curl "https://api.bitails.io/block/stats/mining/1h/histogram?fromTime=1700659941&toTime=1701091969"

The above command returns JSON structured like this:

[
  {
    "time": 1700661491,
    "miners": [
      {
        "minerId": "TAAL",
        "count": 1,
        "size": 423234,
        "fees": 685653,
        "txs": 1232
      }
    ]
  }
]

This endpoint retrieves the histogram summary of blocks mined by miners in a period of time.

HTTP Request

GET https://api.bitails.io/block/stats/mining/{period}/histogram

Parameter Description
period The time period for aggregation: `1h`, `24h`, `7d`.
fromTime Start time in Unix epoch format (required).
toTime (Optional) End time in Unix epoch format.

Get Histogram Mining Metrics

curl "https://api.bitails.io/block/stats/props/1h/histogram?fromTime=1700659941&toTime=1701091969"

The above command returns JSON structured like this:

[
  {
    "averageNumOfTxs": 2501,
    "totalNumOfTxs": 2501,
    "totalTxsInputs": 3825,
    "totalTxsOutputs": 5628,
    "averageSize": 1049412,
    "totalSize": 1049412,
    "averageFees": 73,
    "txAverageFee": 73,
    "txMedianFee": 5,
    "totalBlockFees": 183119,
    "averageFeeRate": 0.17449676580790005,
    "averageTxSize": 419,
    "MedianTxSize": 293,
    "time": 1700661491
  }
]

This endpoint retrieves the histogram metrics for blocks mined in a period of time.

HTTP Request

GET https://api.bitails.io/block/stats/props/{period}/histogram

Parameter Description
period The time period for aggregation: `1h`, `24h`, `7d`.
fromTime Start time in Unix epoch format (required).
toTime (Optional) End time in Unix epoch format.

Mempool

Get Mempool Info

curl "https://api.bitails.io/mempool"

The above command returns JSON structured like this:

{
  "transactionsCount": 23764,
  "size": 10998880813,
  "circulatedSatoshis": "2976405264895",
  "age": 1776
}

This endpoint retrieves information about the mempool.

HTTP Request

GET https://api.bitails.io/mempool

Get Mempool Transactions

curl "https://api.bitails.io/mempool/transactions"

The above command returns JSON structured like this:

[
  {
    "txid": "c09e7ecccc9305377b01c754e008b7bd434b092e0d629a1c836806a30d86338f",
    "countOfInputs": 2,
    "countOfOutputs": 1,
    "ops": [0],
    "size": 403,
    "timestamp": 1658243646
  }
]

This endpoint retrieves transactions currently in the mempool.

HTTP Request

GET https://api.bitails.io/mempool/transactions

URL Parameters

Parameter Description
from (Optional) The starting index for pagination.
limit (Optional) The number of transactions to retrieve.

Network

Get Network Stats

curl "https://api.bitails.io/network/stats"

The above command returns JSON structured like this:

{
  "daily": {
    "transactions": 1858986,
    "tpsAverage": 21.759002588863734,
    "blocks": 140,
    "blockAverageTime": 610,
    "blockAverageSize": 120234565,
    "size": 18810864256
  },
  "weekly": {
    "transactions": 12345678,
    "tpsAverage": 20.123
  }
}

This endpoint retrieves network statistics aggregated over daily, weekly, monthly, yearly, and all-time periods.

HTTP Request

GET https://api.bitails.io/network/stats

Get Network Info

curl "https://api.bitails.io/network/info"

The above command returns JSON structured like this:

{
  "blocks": 747778,
  "bestblockhash": "000000000000000009103cdfe9355853a1653148d5be978141d31f7bf2786cee",
  "chainwork": "00000000000000000000000000000000000000000139ace7839b1aef60d83f3c",
  "difficulty": 74430838267.01804,
  "mediantime": 1657539582
}

This endpoint retrieves current network information.

HTTP Request

GET https://api.bitails.io/network/info

Download

Download Transaction

# 40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914 
curl "https://api.bitails.io/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914" --output tx.bin

The above command returns the transaction in binary. Here is a JavaScript example of how to process the data:

// Example using NodeJS and Axios
const axios = require('axios');

function bufferToHex(buffer) {
  return Buffer.from(buffer).toString('hex');
}

axios.get('https://api.bitails.io/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914', {
  responseType: 'arraybuffer'
})
.then(response => {
  console.log(bufferToHex(response.data));
})
.catch(error => {
  console.error(error);
});

This endpoint downloads the full raw transaction data in binary format.

HTTP Request

GET https://api.bitails.io/download/tx/{txid}

Parameter Description
txid The transaction ID.

Download Transaction in Hex

# 40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914 
curl "https://api.bitails.io/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914/hex"

The above command returns the transaction as a hex string.

This endpoint retrieves the full raw transaction data as a hex-encoded string.

HTTP Request

GET https://api.bitails.io/download/tx/{txid}/hex

Parameter Description
txid The transaction ID.

Download Transaction Output

# 40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914 
curl "https://api.bitails.io/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914/output/0" --output output.bin

The above command returns the transaction output in binary. Here is a JavaScript example:

const axios = require('axios');

axios.get('https://api.bitails.io/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914/output/0', {
  responseType: 'arraybuffer'
})
.then(response => {
  console.log(Buffer.from(response.data).toString('hex'));
})
.catch(error => {
  console.error(error);
});

This endpoint retrieves a specific transaction output's script in binary format, saving bandwidth by not downloading the entire transaction.

HTTP Request

GET https://api.bitails.io/download/tx/{txid}/output/{outputIndex}

Parameter Description
txid The transaction ID.
outputIndex The index of the output.

Download Transaction Output in Hex

# 40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914 
curl "https://api.bitails.io/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914/output/0/hex"

This endpoint retrieves a specific transaction output's script as a hex-encoded string.

HTTP Request

GET https://api.bitails.io/download/tx/{txid}/output/{outputIndex}/hex

Parameter Description
txid The transaction ID.
outputIndex The index of the output.

Download Transaction Input

# 40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914 
curl "https://api.bitails.io/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914/input/0" --output input.bin

This endpoint retrieves a specific transaction input's script in binary format.

HTTP Request

GET https://api.bitails.io/download/tx/{txid}/input/{inputIndex}

Parameter Description
txid The transaction ID.
inputIndex The index of the input.

Download Transaction Input in Hex

# 40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914 
curl "https://api.bitails.io/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914/input/0/hex"

This endpoint retrieves a specific transaction input's script as a hex-encoded string.

HTTP Request

GET https://api.bitails.io/download/tx/{txid}/input/{inputIndex}/hex

Parameter Description
txid The transaction ID.
inputIndex The index of the input.

Search

Search Blockchain

curl "https://api.bitails.io/search?q=upfile&type=ops"

The above command returns JSON structured like this:

{
  "ops": {
    "from": 0,
    "limit": 10,
    "total": 1400,
    "remain": 1390,
    "results": [
      {
        "txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
        "n": 0,
        "time": 1655049588,
        "highlight": [
          "Upfile-v1data:text/plain;base64,dGhpcyBpcyBhIHRlc3QgRmlsZQ==Upfile-v1"
        ]
      }
    ]
  }
}

This endpoint retrieves transactions containing the specified search query.

HTTP Request

GET https://api.bitails.io/search?q={text}

Parameter Description
q The text or data to search for.
type (Optional) Type of search: `all`, `ops`, `tx`, `block`, `scripthash`, `address`.
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.
fromTime (Optional) Start time in Unix epoch format.
toTime (Optional) End time in Unix epoch format.

Socket

Fire up a socket and watch the network! A perfect tool for monitoring the blockchain in real-time. It can be used for wallets, IoT devices, and many other use cases.

Mempool Info

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('connect', () => {
  console.log('Connected to socket!');
});
socket.on('mempool', info => console.log(info));

Get mempool info in a 5-second interval.

Topic

mempool

Watch All Transactions

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('tx', (data) => {
  console.log(data);
});

Watch the network for all new transactions entering the mempool.

Topic

tx

Watch a Specific Transaction

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('tx-9e8ea17aa1fd450bf2e0ff41891e05286ba117d08f207f508094a2b1e0e7669d', (data) => {
  console.log('Transaction confirmed!', data);
});

Watch the network for a specific transaction to be confirmed in a block.

Topic

tx-{txid}

Watch all Addresses

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('lock-address', (data) => {
  console.log(data);
});

Watch the network for transactions involving any address.

Topic

lock-address

Lock to Address

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('lock-address-18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e', (data) => {
  console.log('New UTXO for address:', data);
});

This subscribes to a feed of new UTXOs created for a specific address. It is triggered whenever the address is included in the outputs of a new transaction.

Topic

lock-address-{address}

Watch All Scripthashes

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('lock-scripthash', (data) => {
  console.log(data);
});

Watch the network for transactions involving any scripthash.

Topic

lock-scripthash

Lock to Scripthash

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('lock-scripthash-e4f725c7f7a95838f3fc8c138b7d5ce19dfbb8cd6cb9cb37f590533855dba399', (data) => {
  console.log('New UTXO for scripthash:', data);
});

This subscribes to a feed of new UTXOs for a specific scripthash. It is triggered whenever the scripthash is included in a transaction's outputs.

Topic

lock-scripthash-{scripthash}

Spent UTXOs on All Addresses

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('spent-address', (data) => {
  console.log('UTXO spent:', data);
});

This topic lists all spent UTXOs from any address.

Topic

spent-address

Spent UTXOs from an Address

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('spent-address-1GhhT4dXpqdtum9pS2Rqzbuyjm5gNDUHEU', (data) => {
  console.log('UTXO spent from address:', data);
});

This subscribes to a feed of spent UTXOs for a specific address. It is triggered whenever the address is included in a transaction's inputs.

Topic

spent-address-{address}

Spent UTXOs on All Scripthashes

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('spent-scripthash', (data) => {
  console.log('UTXO spent from scripthash:', data);
});

This topic lists all spent UTXOs from any scripthash.

Topic

spent-scripthash

Spent UTXOs from a Scripthash

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('spent-scripthash-e4f725c7f7a95838f3fc8c138b7d5ce19dfbb8cd6cb9cb37f590533855dba399', (data) => {
  console.log('UTXO spent from specific scripthash:', data);
});

This subscribes to a feed of spent UTXOs for a specific scripthash. It is triggered whenever the scripthash is included in a transaction's inputs.

Topic

spent-scripthash-{scripthash}

Notify When the UTXO is Spent

const { io } = require('socket.io-client');
const endpoint = 'https://api.bitails.io/global';
const socket = io(endpoint, { transports: ['websocket'] });
socket.on('utxo-spent-9e8ea17aa1fd450bf2e0ff41891e05286ba117d08f207f508094a2b1e0e7669d_0', (data) => {
  console.log('The specified UTXO has been spent!', data);
});

This endpoint notifies you when a specific UTXO (identified by its transaction ID and output index) is spent.

Topic

utxo-spent-{txid}_{outputIndex}

Stas Protocol

Token-based UTXOs of an Address

curl "https://api.bitails.io/address/1AMzdZFfkJC7PnxXQndCPKp2q2v8TZSW9E/tokens/unspent?from=0&limit=10"

The above command returns JSON structured like this:

{
  "address": "1AMzdZFfkJC7PnxXQndCPKp2q2v8TZSW9E",
  "utxos": [
    {
      "redeemAddr": "1AMzdZFfkJC7PnxXQndCPKp2q2v8TZSW9E",
      "symbol": "STAS",
      "txid": "some_txid",
      "index": 0,
      "script": "some_script_hex",
      "amount": 2000
    }
  ]
}

This endpoint retrieves unspent token outputs (Stas-UTXOs) for a given address.

HTTP Request

GET https://api.bitails.io/address/{address}/tokens/unspent

Parameter Description
address The address to query.
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.

Token-based UTXOs of Multiple Addresses

curl -X POST "https://api.bitails.io/address/tokens/unspent/multi?from=0&limit=10" \
-H "Content-Type: application/json" \
-d '{"addresses": ["18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e", "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e"]}'

The above command returns JSON structured like this:

[
  {
    "address": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
    "utxos": [
      {
        "redeemAddr": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
        "symbol": "STAS",
        "txid": "some_txid_1",
        "index": 0,
        "script": "some_script_hex_1",
        "amount": 2000
      }
    ]
  },
  {
    "address": "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e",
    "utxos": [
      {
        "redeemAddr": "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e",
        "symbol": "STAS",
        "txid": "some_txid_2",
        "index": 1,
        "script": "some_script_hex_2",
        "amount": 5000
      }
    ]
  }
]

This endpoint retrieves unspent token outputs (Stas-UTXOs) for multiple addresses.

HTTP Request

POST https://api.bitails.io/address/tokens/unspent/multi

Parameter Description
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return per address.

The body of the POST request is an array of addresses:

{"addresses": ["address1", "address2", ...]}

UTXOs of a Token in an Address

curl "https://test-api.bitails.io/address/mm3SVBJwqRi6fR2DwfLQ5arFLeJHXeuF91/token/3c9ca41f66c5b20d6aecf198fe9c35b3c5bf51bc/symbol/ABC5/unspent?from=0&limit=10"

The above command returns JSON structured like this:

{
  "address": "mm3SVBJwqRi6fR2DwfLQ5arFLeJHXeuF91",
  "utxos": [
    {
      "redeemAddr": "mm3SVBJwqRi6fR2DwfLQ5arFLeJHXeuF91",
      "symbol": "ABC5",
      "txid": "some_txid",
      "index": 0,
      "script": "some_script_hex",
      "amount": 1000
    }
  ]
}

This endpoint retrieves the UTXOs of a specific token held by a specific address.

HTTP Request

GET https://api.bitails.io/address/{address}/token/{tokenId}/symbol/{symbol}/unspent

Parameter Description
address The address holding the tokens.
tokenId The ID of the token.
symbol The symbol of the token.
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.

UTXOs of a Token in Multiple Addresses

curl -X POST "https://api.bitails.io/address/token/3c9ca41f66c5b20d6aecf198fe9c35b3c5bf51bc/symbol/ABC5/unspent/multi?from=0&limit=10" \
-H "Content-Type: application/json" \
-d '{"addresses": ["mm3SVBJwqRi6fR2DwfLQ5arFLeJHXeuF91", "another_address"]}'

The above command returns JSON structured like this:

[
  {
    "address": "mm3SVBJwqRi6fR2DwfLQ5arFLeJHXeuF91",
    "utxos": [
      {
        "redeemAddr": "mm3SVBJwqRi6fR2DwfLQ5arFLeJHXeuF91",
        "symbol": "ABC5",
        "txid": "some_txid",
        "index": 0,
        "script": "some_script_hex",
        "amount": 2000
      }
    ]
  }
]

This endpoint retrieves the UTXOs of a specific token held by multiple addresses.

HTTP Request

POST https://api.bitails.io/address/token/{tokenId}/symbol/{symbol}/unspent/multi

Parameter Description
tokenId The ID of the token.
symbol The symbol of the token.
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return per address.

The body of the POST request is an array of addresses:

{"addresses": ["address1", "address2", ...]}

Token-based Balance of an Address

curl "https://api.bitails.io/address/18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e/tokens/balance"

The above command returns JSON structured like this:

[
  {
    "redeemAddr": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
    "symbol": "STAS",
    "image": "image_url_or_data_uri",
    "protocol": "STAS",
    "balance": 2000
  }
]

This endpoint retrieves the token balances for a specific address.

HTTP Request

GET https://api.bitails.io/address/{address}/tokens/balance

Parameter Description
address The address to query.

Token-based Balance of Multiple Addresses

curl -X POST "https://api.bitails.io/address/tokens/balance/multi" \
-H "Content-Type: application/json" \
-d '{"addresses": ["18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e", "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e"]}'

The above command returns JSON structured like this:

[
  {
    "redeemAddr": "18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e",
    "symbol": "STAS",
    "image": "image_url_or_data_uri",
    "protocol": "STAS",
    "balance": 5000
  }
]

This endpoint retrieves the combined token balances across multiple addresses.

HTTP Request

POST https://api.bitails.io/address/tokens/balance/multi

The body of the POST request is an array of addresses:

{"addresses": ["address1", "address2", ...]}

Token-based History of an Address

curl "https://api.bitails.io/address/18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e/tokens/history?from=0&limit=10"

The above command returns JSON structured like this:

[
  {
    "txid": "some_txid",
    "tokenId": "some_token_id",
    "symbol": "STAS",
    "inputAmount": 0,
    "outputAmount": 1000,
    "time": 1655049588
  }
]

This endpoint retrieves the Stas-based token transaction history for an address.

HTTP Request

GET https://api.bitails.io/address/{address}/tokens/history

Parameter Description
address The address to query.
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.

A Token's History of an Address

curl "https://test-api.bitails.io/address/mm3SVBJwqRi6fR2DwfLQ5arFLeJHXeuF91/history/token/3c9ca41f66c5b20d6aecf198fe9c35b3c5bf51bc/symbol/ABC5?from=0&limit=10"

The above command returns JSON structured like this:

[
  {
    "txid": "some_txid",
    "tokenId": "3c9ca41f66c5b20d6aecf198fe9c35b3c5bf51bc",
    "symbol": "ABC5",
    "inputAmount": 0,
    "outputAmount": 1000,
    "time": 1655049588
  }
]

This endpoint retrieves the transaction history for a specific token at a specific address.

HTTP Request

GET https://api.bitails.io/address/{address}/history/token/{tokenId}/symbol/{symbol}

Parameter Description
address The address holding the tokens.
tokenId The ID of the token.
symbol The symbol of the token.
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.

Token-based History of Multiple Addresses

curl -X POST "https://api.bitails.io/address/history/token/multi?from=0&limit=10" \
-H "Content-Type: application/json" \
-d '{"addresses": ["18C5qX7sM98gKtgGqTAXTa53dnbyrSkx6e", "17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e"]}'

The above command returns JSON structured like this:

[
  {
    "txid": "some_txid",
    "tokenId": "some_token_id",
    "symbol": "STAS",
    "inputAmount": 500,
    "outputAmount": 0,
    "time": 1655049999
  }
]

This endpoint retrieves the combined Stas-based token history for multiple addresses.

HTTP Request

POST https://api.bitails.io/address/history/token/multi

Parameter Description
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.

The body of the POST request is an array of addresses:

{"addresses": ["address1", "address2", ...]}

A Token's History of Multiple Addresses

curl -X POST "https://test-api.bitails.io/address/history/token/3c9ca41f66c5b20d6aecf198fe9c35b3c5bf51bc/symbol/ABC5/multi?from=0&limit=10" \
-H "Content-Type: application/json" \
-d '{"addresses": ["mm3SVBJwqRi6fR2DwfLQ5arFLeJHXeuF91", "another_address"]}'

The above command returns JSON structured like this:

[
  {
    "txid": "some_txid",
    "tokenId": "3c9ca41f66c5b20d6aecf198fe9c35b3c5bf51bc",
    "symbol": "ABC5",
    "inputAmount": 0,
    "outputAmount": 1000,
    "time": 1655049588
  }
]

This endpoint retrieves a specific token's combined history across multiple addresses.

HTTP Request

POST https://api.bitails.io/address/history/token/{tokenId}/symbol/{symbol}/multi

Parameter Description
tokenId The ID of the token.
symbol The symbol of the token.
from (Optional) The starting index for pagination.
limit (Optional) The number of results to return.

The body of the POST request is an array of addresses:

{"addresses": ["address1", "address2", ...]}

Token Details

curl "https://api.bitails.io/token/617b84206f91180229b5161a57910e17e3f4cf42/symbol/FUNE"

The above command returns JSON structured like this:

{
  "contractTxs": ["contract_txid_1"],
  "issuanceTxs": ["issuance_txid_1"],
  "name": "FunE",
  "tokenId": "617b84206f91180229b5161a57910e17e3f4cf42",
  "protocolId": "STAS",
  "symbol": "FUNE",
  "description": "A sample token",
  "image": "image_url_or_data_uri",
  "totalSupply": 1000000,
  "decimals": 8,
  "satsPerToken": 1
}

This endpoint retrieves the details of a token by its ID and symbol.

HTTP Request

GET https://api.bitails.io/token/{tokenId}/symbol/{symbol}

Parameter Description
tokenId The ID of the token.
symbol The symbol of the token.

A Token's Transactions History

curl "https://api.bitails.io/token/617b84206f91180229b5161a57910e17e3f4cf42/symbol/FUNE/tx"

The above command returns JSON structured like this:

{
  "redeemAddr": "some_redeem_address",
  "tokenId": "617b84206f91180229b5161a57910e17e3f4cf42",
  "symbol": "FUNE",
  "txs": [
    "txid_1",
    "txid_2"
  ]
}

This endpoint retrieves the complete transaction history of a token by its ID and symbol.

HTTP Request

GET https://api.bitails.io/token/{tokenId}/symbol/{symbol}/tx

Parameter Description
tokenId The ID of the token.
symbol The symbol of the token.

Token Existence Check

curl "https://api.bitails.io/token/tx/0b616f44f8ab16614d334be5dab53fa57d10058db991f774b700632a2565817d/out/0/exists"

The above command returns JSON structured like this:

{
  "exists": true,
  "isStas": true,
  "spent": false
}

This endpoint checks if a specific transaction output exists, if it is a Stas Protocol token, and its spent/unspent status.

HTTP Request

GET https://api.bitails.io/token/tx/{txid}/out/{outputIndex}/exists

Parameter Description
txid The transaction ID.
outputIndex The output index of the transaction.

Tokens List

curl "https://api.bitails.io/token/list"

The above command returns JSON structured like this:

[
  {
    "tokenId": "aeded8ce7e2d25544be184ceb16875ede4711425",
    "symbol": "USDXS",
    "imageUrl": "image_url_or_data_uri",
    "owners": 676,
    "circulationSupply": 4756839,
    "utxos": 5432
  }
]

This endpoint retrieves a list of the top STAS protocol tokens, sorted by the number of unique owners.

HTTP Request

GET https://api.bitails.io/token/list

ESV Adapter

To access the ESV server, use esv.bitails.io at TCP port 50001 and TLS port 50002.

To run your own server or to contribute to the project, visit the GitHub page.

Errors

Error 404

The requested resource could not be found.

Error 500

An internal server error occurred. We have been notified and are looking into it.

Error 503

The service is temporarily unavailable due to scheduled maintenance. Please try again later.

Contact Us

Contact Info

The following is the contact information for Bitails:

Thank you for using Bitails!