---
title: "Get a block by number"
method: GET
path: "/{chain}/blocks/{number}"
tags: ["Chain"]
---

# Get a block by number

`GET /{chain}/blocks/{number}`

## Request

- Base URL: `https://api.blockvectra.com/v1/data`
- URL: `https://api.blockvectra.com/v1/data/{chain}/blocks/{number}`
- Auth: API key in header `x-api-key`

Fetch a block by its block number. No pagination.

## Path parameters

- `chain` string, required
- `number` integer, required

## Response `200`

The block.

- BlockEnvelope: `next_cursor` is never present (this endpoint has no pagination).
  - `data` Block, required
    - `number` integer, required
    - `hash` string, required: 32-byte hash/topic, canonical form always `0x` + 64 lowercase hex digits.
    - `parent_hash` string, required: 32-byte hash/topic, canonical form always `0x` + 64 lowercase hex digits.
    - `timestamp` string, date-time, required: `YYYY-MM-DDTHH:MM:SSZ`, UTC, second precision.
    - `miner` string, required: 20-byte address, canonical form always `0x` + 40 lowercase hex digits.
    - `gas_limit` integer, required
    - `gas_used` integer, required
    - `base_fee_per_gas` string, required: Non-negative integer that may exceed 2^53, rendered as a plain decimal string — never a JSON number, never scientific or hex notation.
    - `state_root` string, required: 32-byte hash/topic, canonical form always `0x` + 64 lowercase hex digits.
    - `transactions_root` string, required: 32-byte hash/topic, canonical form always `0x` + 64 lowercase hex digits.
    - `receipts_root` string, required: 32-byte hash/topic, canonical form always `0x` + 64 lowercase hex digits.
    - `tx_count` integer, required
    - `size` integer, required
    - `l1_block_number` integer, nullable, required: Present (non-null) only on L2 chains that record an L1 origin block.
    - `extra` ExtraJson, required: Additional chain-specific fields as a JSON object; `{}` when there are none. Shape varies by chain.
  - `meta` Meta, required: Metadata present on every success response.
    - `chain` string, required: Chain identifier; the value of the `{chain}` path parameter.
    - `chain_slug` string, required: Canonical uppercase chain slug; `chain` is always its lowercase form.
    - `chain_external_id` string, required: CAIP-2 formatted external chain identifier (`eip155:{chain_id}`).
    - `as_of_block` integer, required: The newest fully written block (the `blocks` table's maximum height); the only serving bound for block-scoped endpoints. For snapshot endpoints (balances, holders, nfts, dex prices, stocks) it is the service's current indexed head, not the block height of the snapshot: read the snapshot time from `meta.refreshed_at`, and treat the data as stale when `refreshed_at` is `null`.
    - `safe_block` integer, nullable, required: A marker only: the node's consensus `safe` block. Always present; `null` while no value is known (the node has no such tag, or the indexer has not read one yet). Only grows, never below `finalized_block`, and may be above or below `as_of_block`. It never truncates, rejects or bounds a response; see Finality in the API description.
    - `finalized_block` integer, nullable, required: A marker only: the node's consensus `finalized` block. Always present; `null` while no value is known (the node has no such tag, or the indexer has not read one yet). Only grows, and may be above or below `as_of_block`. It never truncates, rejects or bounds a response; see Finality in the API description.
    - `coverage` 'full' | 'partial', required: `"partial"` appears only from `GET /{chain}/addresses/{address}/transactions` and `GET /{chain}/addresses/{address}/transfers`, when `clamp=true` narrowed the served window, and from those two, `GET /{chain}/tokens/{token}/transfers` and `GET /{chain}/dex/swaps` when the block window starts before the lower bound of the dataset the endpoint reads -- the chain's first indexed block, or higher while that dataset is still being backfilled (see Coverage in the API description and each endpoint's window description). Every other endpoint reports `"full"`.
    - `refreshed_at` string, date-time, required: `YYYY-MM-DDTHH:MM:SSZ`, UTC, second precision.

## Other responses

- `400`: `error.code = "bad_request"`: `{number}` is not a valid non-negative integer.
- `401`: HTTP 401: a missing API key returns missing_api_key; an unknown, disabled, or revoked key returns the same invalid_api_key error envelope. error.code and error.data.reason contain the reason. Rejected requests are not billed.
- `402`: Payment required: the paid balance or the free grant is exhausted. The response body is `{"error":{"code":"insufficient_balance"}}`. Rejected requests are not billed.
- `404`: `error.code = "not_found"`: either `{chain}` is unknown or not public, or block `{number}` does not exist (never indexed, or removed by a reorg). A `{number}` above the indexed head is `409 not_indexed_yet` instead.
- `409`: After the operation passes its earlier routing, capability, parameter and permit checks and reaches the indexed-head check, `error.code = "not_indexed_yet"` when the requested block (a `{number}` path parameter, or the block a hash resolved to) is above `as_of_block`, the newest fully written block (see "Errors" above). It carries `indexed_through`, the highest indexed block. `meta.finalized_block` is a marker only and never rejects an indexed block. On a chain with no indexed block at all it is also `not_indexed_yet` but `indexed_through` is **absent** (block 0 is not indexed either).
- `422`: `error.code = "no_coverage"`: no data here, which is permanent except while a dataset is being backfilled (a windowed endpoint's lower bound can move down as the backfill proceeds, so retry later). Either the chain does not have this endpoint's capability, or the requested block (or whole block window) is before the chain's first covered block (`coverage.from_block`) -- for the windowed endpoints, the lower bound of the dataset they read, which is that block or higher while the dataset is still being backfilled -- or the capability needs history from genesis (`balances`, `holders`, `nfts`) and `coverage.from_block` is not `0` yet or the indexed blocks have holes, or (traces) the block falls in a permanent trace coverage gap. A block window entirely before the lower bound is reported as this `422` even when its `to_block` is also above `as_of_block`. See Coverage in the API description (the history start in examples is a placeholder; read `GET /chains` `coverage.from_block` at runtime).
- `429`: Rate limited. `{"error":{"code":"rate_limited"}}` when the key CU rate limit is exceeded (the response includes `Retry-After`) or the account call rate limit is exceeded (no `Retry-After`). `{"error":{"code":"cost_exceeds_burst"}}` when a single request exceeds the key burst capacity; split the request, retrying as sent never succeeds. Rejected requests are not billed.
- `503`: `error.code = "unavailable"`: the service is temporarily unavailable, timed out, busy on this chain (no query slot freed up in time, see `limits.max_concurrent_queries` in `GET /chains`), or shutting down (see "Errors" above). Always carries an HTTP `Retry-After` header (seconds); wait at least that long before retrying.

---

[API](https://skmtc.dev/blockvectra/apis/blockvectra-data-api.md) · [All operations](https://skmtc.dev/blockvectra/apis/blockvectra-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/blockvectra/apis/blockvectra-data-api/revisions/c5b949e955b5?raw)
