<!-- source: https://secondlayer.tools/docs/api-reference#get-block -->

## Block by height or hash

`GET /v1/index/blocks/{height_or_hash}`

A height returns the canonical block there. A hash returns that block whether or not it is canonical, so check `canonical` to spot an orphan. Not metered.

### Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `height_or_hash` | string, required | A block height (digits only) or a `0x`-prefixed block hash. |

### Responses

- `200` The block and the tip it was read against
- `401` This bind requires the instance token, and it was missing or wrong
- `404` No block at that height or with that hash (`Block not found`)
- `429` Rate limited; retry after `Retry-After` seconds

### Example

```bash
curl https://api.secondlayer.tools/v1/index/blocks/9048502 \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY"
```

```json
{
  "block": {
    "cursor": "9048502:0",
    "block_height": 9048502,
    "block_hash": "0x2a20974330e301b65086d3cde9b0006c9b7471479ba9a3fc2ca72621479655cc",
    "parent_hash": "0x10606e958095ef9b964e3c3f2d9eb75bf8577fb8c09c24ee492b767f7504abea",
    "burn_block_height": 968276,
    "burn_block_hash": "0x000000000000000000019d25cd76d06a9eea796a906ac88300cd70fd70ccdb57",
    "index_block_hash": "0x990152a894e12288960c8b68e5790ad7994f9d261e9ad8adc13c72e76f914339",
    "block_time": "2026-09-23T13:14:42.000Z",
    "canonical": true
  },
  "tip": {
    "block_height": 9048938,
    "finalized_height": 9048671,
    "lag_seconds": 23,
    "source_block_height": 9048938
  }
}
```
