# Get Blocks

## **ENDPOINT**

{% code fullWidth="false" %}

```
GET https://api.data123.io/aleo/<API KEY>/v1/testnet3/blocks?start={start_height}&end={end_height}
```

{% endcode %}

### **Arguments**

<table><thead><tr><th width="198">Parameter</th><th width="128">Type</th><th width="119">Request</th><th>Description</th></tr></thead><tbody><tr><td>start_height</td><td>u32</td><td>Yes</td><td>The starting block height of the requested blocks</td></tr><tr><td>end_height</td><td>u32</td><td>Yes</td><td>The ending block height of the requested blocks</td></tr></tbody></table>

### **Response**

| Parameter | type                                                 | Description           |
| --------- | ---------------------------------------------------- | --------------------- |
| result    | [array](https://developer.aleo.org/concepts/blocks/) | The latest state root |

### Request

{% tabs %}
{% tab title="REST" %}

```bash
curl https://api.data123.io/aleo/<API KEY>/v1/testnet3/blocks?start_height=1000&end_height=1005
```

{% endtab %}

{% tab title="JSON-RPC" %}

<pre class="language-bash"><code class="lang-bash"><strong>curl https://api.data123.io/aleo/&#x3C;API KEY>/rpc/v1/testnet3 \
</strong>    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"getBlocks","params":[1000,1005],"id":1}'
</code></pre>

{% 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://doc.data123.io/reference/api-reference/aleo/rpc-methods/get-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.
