# Trias explorer block

## /api/all\_blocks&#x20;

***

Get block list data

### Request method

GET

### Request address

```
https://www.tscscan.io/api/all_blocks_v1/?size=25&page=1&chain=default 
```

### Request Parameters&#x20;

<table><thead><tr><th width="145" align="center">parameter</th><th width="235" align="center">description</th><th width="97" align="center">type</th><th width="105" align="center">default</th><th align="center"></th></tr></thead><tbody><tr><td align="center">chain</td><td align="center">chain type(default)</td><td align="center">string</td><td align="center">default</td><td align="center">no</td></tr><tr><td align="center">size</td><td align="center">request data size per page</td><td align="center">int</td><td align="center">50</td><td align="center">no</td></tr><tr><td align="center">page</td><td align="center">request pagination</td><td align="center">int</td><td align="center">1</td><td align="center">no</td></tr></tbody></table>

### Return Data Description&#x20;

**Trias return data**

<table><thead><tr><th width="137" align="center">field_name</th><th width="138" align="center">type</th><th>description</th></tr></thead><tbody><tr><td align="center">code</td><td align="center">int</td><td>status code, 200 for success</td></tr><tr><td align="center">total_size</td><td align="center">int</td><td>sum of block sizes</td></tr><tr><td align="center">page</td><td align="center">int</td><td>pagination</td></tr><tr><td align="center">total_page</td><td align="center">int</td><td>total pages</td></tr><tr><td align="center">return_data</td><td align="center">list dict</td><td>block transaction list</td></tr></tbody></table>

**Block data**&#x20;

<table><thead><tr><th width="189" align="center">field_name</th><th width="132" align="center">type</th><th>description</th></tr></thead><tbody><tr><td align="center">hash</td><td align="center">string</td><td>block hash</td></tr><tr><td align="center">miner</td><td align="center">string</td><td>miner address</td></tr><tr><td align="center">number</td><td align="center">int</td><td>block number</td></tr><tr><td align="center">transactionsCount</td><td align="center">int</td><td>transaction count</td></tr><tr><td align="center">size</td><td align="center">int</td><td>block size</td></tr><tr><td align="center">blockReward</td><td align="center">0</td><td>block reward</td></tr><tr><td align="center">timestamp</td><td align="center">int</td><td>block timestamp</td></tr><tr><td align="center">credit_value</td><td align="center">list</td><td>credit value list information</td></tr><tr><td align="center">gasLimit</td><td align="center">int</td><td>block gas limit size</td></tr><tr><td align="center">gasUsed</td><td align="center">int</td><td>block gas used size</td></tr><tr><td align="center">time</td><td align="center">string</td><td>transaction time</td></tr><tr><td align="center">avgFee</td><td align="center">int</td><td>average gas</td></tr><tr><td align="center">gas_used</td><td align="center">int</td><td>gas used size</td></tr><tr><td align="center">gas_Rate</td><td align="center">0</td><td>block reward</td></tr><tr><td align="center">blockcredit</td><td align="center">0</td><td>block credit</td></tr></tbody></table>

### Return Data Example&#x20;

Trias return data example

```
{
  "code":  200,
  "total_size":  10000,
  "page":  1,
  "first_number":  0,
  "last_number":  0,
  "total_page":  400,
  "return_data":  [
            {
           "hash":  "0x29e0e088618b0ddd37cb7e8c8b4e52f296e2006d346963d55a835546809929e9",
           "miner":  "0xEcb7beD0204D3B8d244e7a121d649BA654ede492",
           "number":  1608622,
           "transactionsCount":  6,
           "size":  12189,
           "blockReward":  "0 TSM",
           "timestamp":  1709208540,
           "credit_value":  [
           {
                        "193bfba425e7d3451d8410f1f4fa4554812df713":  1124977
                    },
                    {
                        "279915786fb12e67f0f18b765ca6831d9a73a5e3":  1127904
                    },
                    {
                        "2ac30b3946da0fa0d94db97f680e0e1ebaaa3c86":  1126840
                    },
                    {
                        "3637f213c9dbd5e2d8c65a6410475aec410473d5":  1126990
                    },
                    {
                        "394fb9f059d2887a61abace3dccbbf32d91fa123":  1128365
                    },
                    {
                         "9a059e83defaef0b7dc650222dae7abc3dc0d0c7":  1127407
                    },
                    {
                        "dd38105ee1915e04342568575869c94a1270805e":  1125872
                    },
                    {
                        "ecb7bed0204d3b8d244e7a121d649ba654ede492":  1126620
                    },
                    {
                        "eef9becbf568559653fbce25d0b946cc2e30771c":  1129415
                    }
                ],
            "gasLimit":  39999389,
            "gasUsed":  5476862,
            "time":  1709208540,
            "avgFee":  0.00332,
            "gas_used":  "5476862(13.6924%)",
            "gas_Rate":  0.13692364150862404,
            "blockcredit":  1126620
        }
        ,,,
    ]
}
```

## /api/block\_info&#x20;

***

Get block basic information

### Request method&#x20;

GET

### Request address

```
https://www.tscscan.io/api/block_info_v1/?block_hash=0xd0b8e8ae11ff0450373cf9b873c3c579d74a16c6c81abe161b644400aa8a86dc&chain=default 
```

### Request Parameters&#x20;

<table><thead><tr><th width="136" align="center">parameters</th><th width="235" align="center">description</th><th width="94" align="center">type</th><th width="101" align="center">default</th><th align="center">required</th></tr></thead><tbody><tr><td align="center">chain</td><td align="center">chain type(default)</td><td align="center">string</td><td align="center">default</td><td align="center">no</td></tr><tr><td align="center">block_hash</td><td align="center">block hash</td><td align="center">string</td><td align="center">no</td><td align="center">yes</td></tr></tbody></table>

### Return Data Description&#x20;

**Trias return data**

<table><thead><tr><th width="161" align="center">Field_name</th><th width="150" align="center">type</th><th align="center">description</th></tr></thead><tbody><tr><td align="center">code</td><td align="center">int</td><td align="center">status code, 200 for success </td></tr><tr><td align="center">return_data</td><td align="center">dict</td><td align="center">block details</td></tr></tbody></table>

**Block details**&#x20;

<table><thead><tr><th width="166" align="center">field_name</th><th width="156" align="center">type</th><th align="center">description</th></tr></thead><tbody><tr><td align="center">number</td><td align="center">int</td><td align="center">block number</td></tr><tr><td align="center">size</td><td align="center">int</td><td align="center">block size</td></tr><tr><td align="center">timestamp</td><td align="center">int</td><td align="center">block timestamp</td></tr><tr><td align="center">difficulty</td><td align="center">string</td><td align="center">block diffcultly value,hexstring</td></tr><tr><td align="center">nonce</td><td align="center">string</td><td align="center">block nonce value</td></tr><tr><td align="center">parentHash</td><td align="center">string</td><td align="center">parent block hash</td></tr><tr><td align="center">nextHash</td><td align="center">string</td><td align="center">next block hash</td></tr><tr><td align="center">miner</td><td align="center">string</td><td align="center">block miner</td></tr><tr><td align="center">gasLimit</td><td align="center">int</td><td align="center">block gasLimit</td></tr><tr><td align="center">gas_used</td><td align="center">int</td><td align="center">block gasUsed</td></tr><tr><td align="center">credit_value</td><td align="center">list dict</td><td align="center">blokc credit value</td></tr><tr><td align="center">total_fee</td><td align="center">int</td><td align="center">block transaction totle fee</td></tr><tr><td align="center">is_computed</td><td align="center">bool</td><td align="center">is computed total_fee</td></tr><tr><td align="center">blockReward</td><td align="center">int</td><td align="center">block award, field not used</td></tr><tr><td align="center">stateRoot</td><td align="center">string</td><td align="center">block state root</td></tr><tr><td align="center">hash</td><td align="center">string</td><td align="center">block hash</td></tr><tr><td align="center">confirmed</td><td align="center">bool</td><td align="center">confirmed state</td></tr><tr><td align="center">time</td><td align="center">string</td><td align="center">block time</td></tr><tr><td align="center">confirmations</td><td align="center">int</td><td align="center">confirmations number</td></tr><tr><td align="center">nextHash</td><td align="center">string</td><td align="center">next hash</td></tr><tr><td align="center">gas_used</td><td align="center">int</td><td align="center">block gasUsed value</td></tr><tr><td align="center">Timestamp</td><td align="center">string</td><td align="center">block timesatmp</td></tr><tr><td align="center">status</td><td align="center">string</td><td align="center">confirmed or not</td></tr><tr><td align="center">blockcredit</td><td align="center">0</td><td align="center">block credit</td></tr></tbody></table>

### Return Data Example&#x20;

Trias return data example

```
{
    "code": 200,
    "return_data": {
        "number": 1605753,
        "transactionsCount": 5,
        "timestamp": 1709199893,
        "size": 1635,
        "difficulty": "0x2",
        "nonce": "0x0000000000000000 ",
        "parentHash": "0x21c8c812f3e9bc23e83dab6484980a32f120d33186e88e20d69ee65225ba14be",
        "miner": "0x193bfBA425e7D3451d8410f1f4fa4554812Df713",
        "gasLimit": 40000000,
        "gasUsed": 110004,
        "credit_value": [
            {
                "0x193bfba425e7d3451d8410f1f4fa4554812df713": 1122840
            },
            {
                "0x279915786fb12e67f0f18b765ca6831d9a73a5e3": 1125698
            },
            {
                "0x2ac30b3946da0fa0d94db97f680e0e1ebaaa3c86": 1124665
            },
            {
                "0x3637f213c9dbd5e2d8c65a6410475aec410473d5": 1124799
            },
            {
                "0x394fb9f059d2887a61abace3dccbbf32d91fa123": 1126159
            },
            {
                "0x9a059e83defaef0b7dc650222dae7abc3dc0d0c7": 1125277
            },
            {
                "0xdd38105ee1915e04342568575869c94a1270805e": 1123698
            },
            {
                "0xecb7bed0204d3b8d244e7a121d649ba654ede492": 1124446
            },
            {
                "0xeef9becbf568559653fbce25d0b946cc2e30771c": 1127216
            }
            ],
        "is_computed": false,
        "total_fee": 0,
        "blockReward": "0 TSM",
        "stateRoot": "0xa9cbaf2df64f51df630a9831c180501aa77af8ea1699f7fcbf34e85e8adcb974",
        "hash": "0xd0b8e8ae11ff0450373cf9b873c3c579d74a16c6c81abe161b644400aa8a86dc",
        "confirmed": true,
        "time": "2024-02-29 17:44:53",
        "confirmations": 1019,
        "nextHash": "0x3623204e47e74e30e7caad8f7b8855e08b49a7d35831764fd5a1cc6f602665c7",
        "gas_used": "110004(0.2750%)",
        "Timestamp": "Feb-29-2024 09:44:53 AM +UTC",
        "status": "Confirmed",
        "blockcredit": 1122840
    }
}
```

## /api/block\_transactions/&#x20;

***

Return block details

### Request method&#x20;

GET

### Request address

```
https://www.tscscan.io/api/block_transactions_v1/?size=25&page=1&chain=default&block_hash=0xd0b8e8ae11ff0450373cf9b873c3c579d74a16c6c81abe161b644400aa8a86dc 
```

### Request Parameters&#x20;

<table><thead><tr><th width="145" align="center">parameter</th><th width="235" align="center">description</th><th width="97" align="center">type</th><th width="105" align="center">default</th><th align="center">required</th></tr></thead><tbody><tr><td align="center">chain</td><td align="center">chain type(default)</td><td align="center">string</td><td align="center">default</td><td align="center">no</td></tr><tr><td align="center">block_hash</td><td align="center">block hash</td><td align="center">string</td><td align="center">no</td><td align="center">yes</td></tr><tr><td align="center">size</td><td align="center">request data size per page</td><td align="center">int</td><td align="center">50</td><td align="center">no</td></tr><tr><td align="center">page</td><td align="center">request pagination</td><td align="center">int</td><td align="center">1</td><td align="center">no</td></tr></tbody></table>

### Return Data Description&#x20;

**Trias return data**

<table><thead><tr><th width="221" align="center">field_name</th><th width="138" align="center">type</th><th>description</th></tr></thead><tbody><tr><td align="center">code</td><td align="center">int</td><td>status code, 200 for success</td></tr><tr><td align="center">total_size</td><td align="center">int</td><td>sum of block sizes</td></tr><tr><td align="center">page</td><td align="center">int</td><td>pagination</td></tr><tr><td align="center">total_page</td><td align="center">int</td><td>total pages</td></tr><tr><td align="center">contract_count</td><td align="center">int</td><td>contracts amount</td></tr><tr><td align="center">address_transactions</td><td align="center">int</td><td>transaction address amount </td></tr><tr><td align="center">return_data</td><td align="center">list dict</td><td>block transaction list</td></tr></tbody></table>

**Block transaction**

<table><thead><tr><th width="215" align="center">field_name</th><th width="144">type</th><th>description</th></tr></thead><tbody><tr><td align="center">id</td><td>int</td><td>Database primary key (not useful for business scenarios) </td></tr><tr><td align="center">blockHash</td><td>string</td><td>transaction block hash</td></tr><tr><td align="center">hash</td><td>string</td><td>transaction hash</td></tr><tr><td align="center">to</td><td>string</td><td>transaction to address</td></tr><tr><td align="center">gasPrice</td><td>int</td><td>transaction gas price</td></tr><tr><td align="center">source</td><td>string</td><td>transaction from address</td></tr><tr><td align="center">value</td><td>int</td><td>transaction value</td></tr><tr><td align="center">gas</td><td>int</td><td>transaction gas</td></tr><tr><td align="center">fee</td><td>int</td><td>transaction fee</td></tr><tr><td align="center">blockNumber</td><td>int</td><td>block number</td></tr><tr><td align="center">status</td><td>string</td><td>execution status</td></tr><tr><td align="center">contract_label</td><td>bool</td><td>includes contract transactions</td></tr><tr><td align="center">timestamp</td><td>int</td><td>transaction timestamp</td></tr><tr><td align="center">tokenamount</td><td>string</td><td>transfer token amount</td></tr><tr><td align="center">method</td><td>string</td><td>execution contract methods</td></tr></tbody></table>

### Return Data Example&#x20;

Trias return data example

```
{
          "code":  200,
          "total_size":  5,
          "page":  1,
          "total_page":  1,
          "contract_count":  0,
          "address_transactions":  5,
          "return_data":  [
                    {
                     "hash":  "0xd6dd3e54d02429d270ad30757e9e5d1e6a6ff04de4070f1ad564ef7b39077135",
                              "to":  "0x0000000000000000000000000000000000001000",
                              "gasPrice":  0,
                              "source":  "0x193bfBA425e7D3451d8410f1f4fa4554812Df713",
                              "value":  "0.00010312875",
                              "gas":  9223372036854775807,
                              "fee":  "0",
                              "blockNumber":  1605753,
                              "status":  "succ",
                              "contract_label":  true,
                              "timestamp":  1709199893,
                              "tokenamount":  "0",
                              "method":  "Common"
                    }
          ]
        ...
}
```
