# Blocks

### Get Block Rewards by BlockNo <a href="#get-block-rewards-by-blockno" id="get-block-rewards-by-blockno"></a>

Returns the block reward awarded for validating a certain block.

```
https://api.ibvmscan.io/api
   ?module=block
   &action=getblockreward
   &blockno=2170000
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.ibvmscan.io/api?module=block\&action=getblockreward\&blockno=2170000\&apikey=YourApiKeyToken) 🔗

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                                                |
| ------------ | ---------------------------------------------------------------------------------------------------------- |
| blockno      | the `integer` block number to check block rewards for eg. [`12697906`](https://bscscan.com/block/12697906) |
| {% endtab %} |                                                                                                            |

{% tab title="Response" %}
Sample response

```
{
   "status":"1",
   "message":"OK",
   "result":{
      "blockNumber":"2170000",
      "timeStamp":"1605182836",
      "blockMiner":"0x68bf0b8b6fb4e317a0f9d6f03eaf8ce6675bc60d",
      "blockReward":"13657915000000000",
      "uncles":[
         
      ],
      "uncleInclusionReward":"0"
   }
}
```

{% hint style="info" %}
⏳ **Tip :** The `timestamp` field is denoted in [**Unix timestamp.**](https://www.unixtimestamp.com/)
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Estimated Block Countdown Time by BlockNo <a href="#get-estimated-block-countdown-time-by-blockno" id="get-estimated-block-countdown-time-by-blockno"></a>

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

```
https://api.ibvmscan.io/api
   ?module=block
   &action=getblockcountdown
   &blockno=11926850
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.ibvmscan.io/api?module=block\&action=getblockcountdown\&blockno=11926850\&apikey=YourApiKeyToken) 🔗

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                                                                |
| ------------ | -------------------------------------------------------------------------------------------------------------------------- |
| blockno      | the `integer` block number to estimate time remaining to be validated eg. [`12697906`](https://bscscan.com/block/12697906) |
| {% endtab %} |                                                                                                                            |

{% tab title="Response" %}
Sample response

```
{
   "status":"1",
   "message":"OK",
   "result":{
      "CurrentBlock":"10526852",
      "CountdownBlock":"10926850",
      "RemainingBlock":"399998",
      "EstimateTimeInSec":"1240008.8"
   }
}
```

{% endtab %}
{% endtabs %}

## Get Block Number by Timestamp <a href="#get-block-number-by-timestamp" id="get-block-number-by-timestamp"></a>

Returns the block number that was validated at a certain timestamp.

```
https://api.ibvmscan.io/api
   ?module=block
   &action=getblocknobytime
   &timestamp=1601510400
   &closest=before
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.ibvmscan.io/api?module=block\&action=getblocknobytime\&timestamp=1601510400\&closest=before\&apikey=YourApiKeyToken) 🔗

{% tabs %}
{% tab title="Request" %}
Query Parameters

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

{% hint style="info" %}
⏳ **Tip :** Convert a regular date-time to a [**Unix timestamp.**](https://www.unixtimestamp.com/)
{% endhint %}
{% endtab %}

{% tab title="Response" %}
Sample response

```
{
   "status":"1",
   "message":"OK",
   "result":"946206"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://ibvm.gitbook.io/ibvm-doc/explorer-documentation/blocks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
