> For the complete documentation index, see [llms.txt](https://docs.cspr.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cspr.cloud/1.0.x/rest-api/block/get-blocks.md).

# Get blocks

Get paginated list of blocks

```
GET /blocks
```

## Query params

| Query param           | Description         |
| --------------------- | ------------------- |
| `proposer_public_key` | Proposer public key |

## Sorting

| Property       | Description                 |
| -------------- | --------------------------- |
| `block_height` | Sort blocks by block height |
| `timestamp`    | Sort blocks by timestamp    |

Default sorting is `block_height DESC`

## Optional properties

| Property                | Type   | Description                         |
| ----------------------- | ------ | ----------------------------------- |
| `proposer_account_info` | `JSON` | Account info of proposer public key |

## Response

[`PaginatedResponse`](/1.0.x/documentation/overview/pagination.md)[`<Block>`](/1.0.x/rest-api/block.md)

## Example

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/blocks' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'

```

```json
{
  "data": [
    {
      "block_height": 2293939,
      "block_hash": "bd1601111651cd2668b92235f6f1f1c55cf7becd0e89712fd4d78b5f4b47e203",
      "parent_block_hash": "decfdc241b04e38b9aa37aaad40f46d67c34e311fd4aa84c7af4544ca6674130",
      "state_root_hash": "89e786fd598f9f2f84955daaacc1573a1414fdf8dfa8c93e116ff70402c0bbfb",
      "era_id": 11750,
      "proposer_public_key": "020377bc3ad54b5505971e001044ea822a3f6f307f8dc93fa45a05b7463c0a053bed",
      "native_transfers_number": 0,
      "contract_calls_number": 0,
      "is_switch_block": false,
      "timestamp": "2023-12-18T13:34:55Z"
    },
    {
      "block_height": 2293938,
      "block_hash": "decfdc241b04e38b9aa37aaad40f46d67c34e311fd4aa84c7af4544ca6674130",
      "parent_block_hash": "64d65dc99dc327105db9137c76c49c840efc950a6bb58e88779177b08481e8c1",
      "state_root_hash": "89e786fd598f9f2f84955daaacc1573a1414fdf8dfa8c93e116ff70402c0bbfb",
      "era_id": 11750,
      "proposer_public_key": "01f340df2c32f25391e8f7924a99e93cab3a6f230ff7af1cacbfc070772cbebd94",
      "native_transfers_number": 0,
      "contract_calls_number": 0,
      "is_switch_block": false,
      "timestamp": "2023-12-18T13:34:22Z"
    },
    ...
    {
      "block_height": 2293930,
      "block_hash": "865b9b0a2bd58eee789a4dfbd48d0139b6b6b62d1e61862d8669acab7508b883",
      "parent_block_hash": "1b50cacc006c50b79c2b097c41ae9bb8c919ebbf709433c05d7cac78fb0196a5",
      "state_root_hash": "f842549d60720f646b5b6b3f27d74745f2a35da8d5444e32eb35ef585322cd25",
      "era_id": 11750,
      "proposer_public_key": "01c9d4ecac1606970fa3c8fa8079aa1c04fd5371d55adf96fc6d3952fc27e8bc04",
      "native_transfers_number": 0,
      "contract_calls_number": 0,
      "is_switch_block": false,
      "timestamp": "2023-12-18T13:30:00Z"
    }
  ],
  "item_count": 2293940,
  "page_count": 229394
}
```


---

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

```
GET https://docs.cspr.cloud/1.0.x/rest-api/block/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.
