# /wallet/getblockbylimitnext - Tron

> Example code for the getblockbylimitnext REST method. Complete guide on how to use getblockbylimitnext REST method in GetBlock Web3 documentation.

This endpoint returns a range of blocks between a start height (inclusive) and an end height (exclusive), in one call.

> **Info:** This is a read endpoint. It is also served by the Solidity node at `https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/walletsolidity/getblockbylimitnext`, which returns only confirmed, irreversible data. Use the Solidity node for balance and payment verification.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| startNum | integer | Yes | First block height in the range, inclusive |
| endNum | integer | Yes | End block height, exclusive |

## Request

#### cURL

```bash
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/getblockbylimitnext' \
--header 'Content-Type: application/json' \
--data-raw '{
  "startNum": 68000000,
  "endNum": 68000005
}'
```

#### JavaScript

#### example.js

```javascript
const response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/getblockbylimitnext',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"startNum": 68000000, "endNum": 68000005})
    }
);
console.log(await response.json());
```

#### Python

#### example.py

```python
import requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/getblockbylimitnext',
    headers={'Content-Type': 'application/json'},
    json={"startNum": 68000000, "endNum": 68000005}
)

print(response.json())
```

## Response

```json
{
  "block": [
    {
      "blockID": "0000000002f3a5b0f6d2e6c9a1b4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8",
      "block_header": {
        "raw_data": {
          "number": 68000000,
          "timestamp": 1719400000000
        }
      }
    }
  ]
}
```

## Response Parameters

| Field | Type | Description |
| --- | --- | --- |
| block | array | Blocks in the requested range, each with header and transactions |

## Use Cases

* **Batch Indexing**: Fetch a window of blocks in one request
* **Backfill**: Catch up a store over a range of heights
* **Analytics**: Read a contiguous span of blocks for analysis
* **Reorg Windows**: Re-scan a recent range after a rollback

## Error Handling

| HTTP Status | Message | Description |
| --- | --- | --- |
| 200 | OK | The request succeeded; some TRON errors are returned in the 200 body as an Error field |
| 400 | Bad request | The request body is malformed or a required field is missing |
| 500 | Internal error | The node failed to process the request |
