---
title: "Block at Timestamp"
method: GET
path: "/timestamps/{timestamp}/block"
---

# Block at Timestamp

`GET /timestamps/{timestamp}/block`

Resolves a Unix timestamp (in seconds) to a block number. Returns the first block whose timestamp is greater than or equal to `timestamp`. Resolution prefers archival data and falls back to the real-time source when available; the `x-sqd-data-source` response header reports which source served the result (`network` or `real_time`).

## Path parameters

- `timestamp` integer, required

## Response `200`

Block number resolved.

- BlockNumberResponse
  - `block_number` integer, required — Number of the first block whose timestamp is greater than or equal to the requested timestamp.

## Other responses

- `404` — No block found at or after the given timestamp.
- `500` — Internal server error. Do not retry.
- `503` — Upstream data source temporarily unavailable. Retry later.

---

[API](https://skmtc.net/sqd/apis/sqd-portal-api-bitcoin-dataset-endpoints.md) · [All operations](https://skmtc.net/sqd/apis/sqd-portal-api-bitcoin-dataset-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sqd/sqd-portal-api-bitcoin-dataset-endpoints/versions/cf9d60e495b1/schema)
