> For the complete documentation index, see [llms.txt](https://docs.tajirchain.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tajirchain.com/etherscan-compatible-explorer-api/block.md).

# Block

The Block module retrieves block rewards, countdown estimates, timestamp-based block lookup and the latest indexed block number.

### Endpoint

```
https://explorer.tajirchain.com/api?module=block
```

### Available Actions

| Action              | Purpose                             |
| ------------------- | ----------------------------------- |
| `getblockreward`    | Get reward information for a block  |
| `getblockcountdown` | Estimate time until a future block  |
| `getblocknobytime`  | Find a block near a timestamp       |
| `eth_block_number`  | Get the latest indexed block number |

### Get Block Reward

#### Action

```
getblockreward
```

| Parameter | Required | Description  |
| --------- | -------- | ------------ |
| `blockno` | Yes      | Block number |

```bash
curl "https://explorer.tajirchain.com/api?module=block&action=getblockreward&blockno=653000"
```

Example response structure:

```json
{
  "message": "OK",
  "result": {
    "blockMiner": "0x...",
    "blockNumber": "653000",
    "blockReward": "0",
    "timeStamp": 1787840980,
    "uncleInclusionReward": "0",
    "uncles": []
  },
  "status": "1"
}
```

A zero block reward can be valid depending on Tajir Chain’s block-production and fee configuration.

### Get Block Countdown

#### Action

```
getblockcountdown
```

| Parameter | Required | Description         |
| --------- | -------- | ------------------- |
| `blockno` | Yes      | Future block number |

```bash
curl "https://explorer.tajirchain.com/api?module=block&action=getblockcountdown&blockno=700000"
```

Example response structure:

```json
{
  "message": "OK",
  "result": {
    "CountdownBlock": "700000",
    "CurrentBlock": "653457",
    "EstimateTimeInSec": "93086.0",
    "RemainingBlock": "46543"
  },
  "status": "1"
}
```

The countdown is an estimate and can change with network conditions.

### Get Block by Timestamp

#### Action

```
getblocknobytime
```

| Parameter   | Required | Description               |
| ----------- | -------- | ------------------------- |
| `timestamp` | Yes      | Unix timestamp in seconds |
| `closest`   | Yes      | `before` or `after`       |

```bash
curl "https://explorer.tajirchain.com/api?module=block&action=getblocknobytime&timestamp=1787840000&closest=before"
```

Example response:

```json
{
  "message": "OK",
  "result": {
    "blockNumber": "652510"
  },
  "status": "1"
}
```

### Get Latest Block Number

#### Action

```
eth_block_number
```

| Parameter | Required | Description                 |
| --------- | -------- | --------------------------- |
| `id`      | No       | JSON-RPC request identifier |

```bash
curl "https://explorer.tajirchain.com/api?module=block&action=eth_block_number&id=1"
```

Example response:

```json
{
  "jsonrpc": "2.0",
  "result": "0x...",
  "id": "1"
}
```

The block number is returned in hexadecimal format.
