> For the complete documentation index, see [llms.txt](https://docs.taal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.taal.com/core-products/whatsonchain/chain-info.md).

# Chain Info

## Get Blockchain Info <a href="#get-blockchain-info" id="get-blockchain-info"></a>

This endpoint retrieves information about the state of the specified chain for the selected network.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/chain/info
```

{% endcode %}

#### Example Request

{% tabs fullWidth="false" %}
{% tab title="BSV" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/chain/info"
```

{% endcode %}
{% endtab %}

{% tab title="BTC" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/chain/info"
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "chain": "main",
    "blocks": 905064,
    "headers": 905064,
    "bestblockhash": "0000000000000000112ea3732c0417a2cee0130e9217dbba1b0ff078c92c904e",
    "difficulty": 51223782275.04099,
    "mediantime": 1752242156,
    "verificationprogress": 0.9999990488341951,
    "pruned": false,
    "chainwork": "00000000000000000000000000000000000000000167559704876ce49d636d35"
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "chain": "main",
    "blocks": 904937,
    "headers": 904937,
    "bestblockhash": "000000000000000000005c486692de6f8726bd9223bf4a2f80babedff0d44a91",
    "difficulty": 116958512019762.1,
    "mediantime": 1752160121,
    "verificationprogress": 0.9999988962482643,
    "pruned": false,
    "chainwork": "0000000000000000000000000000000000000000d12c110e37cfdb5d73cdd4ec",
    "size_on_disk": 763791035344
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| chain     | Desired blockchain: `bsv` or `btc`. |
| network   | Selected network: `main` or `test`. |

## Get Circulating Supply <a href="#get-circulating-supply" id="get-circulating-supply"></a>

This endpoint retrieves the circulating supply of the specified blockchain.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/circulatingsupply
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/circulatingsupply"
```

{% endcode %}
{% endtab %}

{% tab title="BTC" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/circulatingsupply"
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```
19890434.375
```

{% endtab %}

{% tab title="BTC" %}

```
19890428.125
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                          |
| --------- | ------------------------------------ |
| chain     | Desired blockchain: `bsv` or `btc`.  |
| network   | Selected network: `main`  or `test`. |

## Get Chain Tips <a href="#get-chain-tips" id="get-chain-tips"></a>

This endpoint retrieves information about all known tips in the block tree.

The possible values for status:

1. `invalid`: This branch contains at least one invalid block.
2. `headers-only`: Not all blocks for this branch are available, but the headers are valid.
3. `valid-headers`: All blocks are available for this branch, but they were never fully validated.
4. `valid-fork`: This branch is not part of the active chain, but is fully validated.
5. `active`: This is the tip of the active main chain, which is certainly valid.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/chain/tips
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/chain/tips"
```

{% endcode %}
{% endtab %}

{% tab title="BTC" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/chain/tips"
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
[{
    "height": 905064,
    "hash": "0000000000000000112ea3732c0417a2cee0130e9217dbba1b0ff078c92c904e",
    "branchlen": 0,
    "status": "active"
}, {
    "height": 905048,
    "hash": "0000000000000000089a618e0f8b8fa5dcc8a201211d09aea1434a1e03c357cf",
    "branchlen": 1,
    "status": "valid-headers"
},
 ...
]
```

{% endtab %}

{% tab title="BTC" %}

```json
[{
    "height": 905086,
    "hash": "0000000000000000000061958ebfa47a17b104af4cf77cd0f23141748397d505",
    "branchlen": 0,
    "status": "active"
}, {
    "height": 904623,
    "hash": "00000000000000000002274bf6db24519f56a7d6b4841f216cb82e7dc345b499",
    "branchlen": 1,
    "status": "valid-fork"
},
...
]
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| chain     | Desired blockchain: `bsv` or `btc`. |
| network   | Selected network: `main` or `test`. |

## Get Peer Info <a href="#get-blockchain-info" id="get-blockchain-info"></a>

This endpoint retrieves information about peers connected to the node.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/peer/info
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/peer/info"
```

{% endcode %}
{% endtab %}

{% tab title="BTC" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/peer/info"
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
[{
    "id": 14,
    "addr": "78.110.160.26:56514",
    "addrlocal": "135.181.137.155:8333",
    "services": "0000000000000021",
    "relaytxes": true,
    "lastsend": 1752244985,
    "lastrecv": 1752244982,
    "bytessent": 9198799,
    "bytesrecv": 1112300,
    "conntime": 1752211964,
    "timeoffset": -58,
    "pingtime": 0.042279,
    "minping": 0.039421,
    "version": 70016,
    "subver": "/Bitcoin SV:1.0.16/",
    "inbound": true,
    "addnode": false,
    "startingheight": 905015,
    "txninvsize": 0,
    "banscore": 0,
    "synced_headers": 905064,
    "synced_blocks": 905064,
    "whitelisted": false,
    "bytessent_per_msg": {
        "addr": 27507,
        "blocktxn": 0,
        "cmpctblock": 0,
        "feefilter": 0,
        "getaddr": 0,
        "getdata": 0,
        "getheaders": 1053,
        "headers": 954,
        "inv": 3158821,
        "notfound": 0,
        "ping": 8832,
        "pong": 8832,
        "reject": 0,
        "sendcmpct": 33,
        "sendheaders": 24,
        "tx": 5992415,
        "verack": 24,
        "version": 146
    },
    "bytesrecv_per_msg": {
        "addr": 55,
        "blocktxn": 0,
        "cmpctblock": 0,
        "feefilter": 0,
        "getaddr": 24,
        "getdata": 109395,
        "getheaders": 1053,
        "headers": 4801,
        "inv": 978214,
        "notfound": 0,
        "ping": 8832,
        "pong": 8832,
        "reject": 694,
        "sendcmpct": 33,
        "sendheaders": 24,
        "tx": 0,
        "verack": 24,
        "version": 147
    }
},
...
]
```

{% endtab %}

{% tab title="BTC" %}

```json
[{
    "id": 19,
    "addr": "192.53.168.227:14985",
    "addrlocal": "65.108.123.176:44132",
    "services": "0000000000000c09",
    "relaytxes": false,
    "lastsend": 1752244946,
    "lastrecv": 1752244946,
    "bytessent": 3247905,
    "bytesrecv": 2058824,
    "conntime": 1749118420,
    "timeoffset": 0,
    "pingtime": 0.319371,
    "version": 70016,
    "subver": "/Satoshi:28.1.0/",
    "inbound": false,
    "startingheight": 899889,
    "banscore": 0,
    "feefilter": 0,
    "syncnode": false,
    "v2_connection": false
}, {
    "id": 26,
    "addr": "176.9.38.204:8333",
    "addrlocal": "65.108.123.176:58004",
    "services": "000000000000040d",
    "relaytxes": true,
    "lastsend": 1752245027,
    "lastrecv": 1752245028,
    "bytessent": 1042075735,
    "bytesrecv": 520385665,
    "conntime": 1749119628,
    "timeoffset": -1,
    "pingtime": 4.409384,
    "version": 70015,
    "subver": "/Satoshi:0.18.1/",
    "inbound": false,
    "startingheight": 899889,
    "banscore": 0,
    "feefilter": 0,
    "syncnode": false,
    "v2_connection": false
},
...
]
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| chain     | Desired blockchain: `bsv` or `btc`. |
| network   | Selected network: `main` or `test`. |
