blocks_by_height
Overview#
Fetch a block by its height. Includes transactions and block metadata.
Endpoint#
GET /v1/blocks/by_height/{block_height}
Request#
Path Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| block_height | string | Yes | Block height |
Query Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| with_transactions | boolean | No | Include transactions in response |
Code Examples#
- cURL
- Python
- TypeScript
- Rust
curl -X GET https://api-aptos-mainnet.n.dwellir.com/YOUR_API_KEY/v1/blocks/by_height/1000000?with_transactions=true \
-H "Accept: application/json"
b = client.block_by_height(1000000, with_transactions=True)
const b = await aptos.getBlockByHeight({ blockHeight: 1_000_000n, withTransactions: true });
let b = client.get_block_by_height(1_000_000, true).await?;