> For the complete documentation index, see [llms.txt](https://docs.quaiscan.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quaiscan.io/developer-support/api/rpc-endpoints/block.md).

# Block

### `https://quaiscan.io/api?module=block`

## Get block reward by block number

`getblockreward`

Returns the block reward and 'uncle' block rewards when applicable.

**Example:**

```
https://quaiscan.io/api
   ?module=block
   &action=getblockreward
   &blockno={blockNumber}
```

{% tabs %}
{% tab title="Request Param" %}

| Parameter    | Description                                                     |
| ------------ | --------------------------------------------------------------- |
| blockno      | `integer` block number to check block rewards for eg. `2165403` |
| {% endtab %} |                                                                 |

{% tab title="Example Result" %}

```json
{
	"message": "OK",
	"result": {
		"blockMiner": "0x00a3e45aa16163f2663015b6695894d918866d19",
		"blockNumber": "2165403",
		"blockReward": "5314181600000000000",
		"timeStamp": "1472533979",
		"uncleInclusionReward": null,
		"uncles": null
	},
	"status": "1"
}
```

{% endtab %}
{% endtabs %}

## Get estimated block countdown time by block number

`getblockcountdown`

Returns the estimated time remaining, in seconds, until a certain block is included in blockchain.

**Example:**

```
https://quaiscan.io/api
   ?module=block
   &action=getblockcountdown
   &blockno={blockNumber}
```

{% tabs %}
{% tab title="Request Param" %}

| Parameter    | Description                                                     |
| ------------ | --------------------------------------------------------------- |
| blockno      | `integer` block number to check block rewards for eg. `2165403` |
| {% endtab %} |                                                                 |

{% tab title="Example Result" %}

```json
{
	"message": "OK",
	"result": {
		"CurrentBlock": "115334213",
		"CountdownBlock": "116015880",
		"RemainingBlock": "681667",
		"EstimateTimeInSec": "1363349.0"
	},
	"status": "1"
}
```

{% endtab %}
{% endtabs %}

## Get block number by time stamp

`getblocknobytime`

Returns the block number created closest to a provided timestamp.

**Example:**

```
https://quaiscan.io/api
   ?module=block
   &action=getblocknobytime
   &timestamp={blockTimestamp}
   &closest={before/after}
```

{% tabs %}
{% tab title="Request Param" %}

| Parameter | Description                                                          |
| --------- | -------------------------------------------------------------------- |
| timestamp | `integer` representing the Unix timestamp in seconds.                |
| closest   | closest block to the provided timestamp, either `before` or `after`. |

Note: [How to convert date/time to a Unix timestamp](https://www.unixtimestamp.com/).
{% endtab %}

{% tab title="Example Result" %}

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

{% endtab %}
{% endtabs %}

## Get the latest block number

`quai_block_number`

Mimics Quai Network JSON RPC's quai\_blockNumber.

**Example:**

```
https://quaiscan.io/api
   ?module=block
   &action=quai_block_number
```

{% tabs %}
{% tab title="Request Param" %}

| Parameter | Description                                                                                                         |
| --------- | ------------------------------------------------------------------------------------------------------------------- |
| id        | <mark style="background-color:yellow;">optional</mark> nonnegative integer that represents the json rpc request id. |

More on [json rpc request id](https://www.jsonrpc.org/specification).
{% endtab %}

{% tab title="Example Result" %}

```
{
  "jsonrpc": "2.0",
  "result": "0x103538a",
  "id": 1
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.quaiscan.io/developer-support/api/rpc-endpoints/block.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
