# Get Block Number Over Interval

Returns block numbers and timestamps sampled at hourly or daily intervals within a requested time range.

_Source: https://beta.taostats.io/docs/api-reference/block/get-block-interval_

_Last reviewed: 2026-09-18_

```http
GET https://api.taostats.io/api/block/interval/v1
```

Requires an API key in the `Authorization` header.

Returns block numbers and timestamps sampled at hourly or daily intervals within a requested time range. Use this to map a reporting period to indexed blocks.

## Try it

Try this request in the browser on the HTML version of this page, or use the code samples below.

### Examples

Find which block numbers correspond to a time window

```text
https://api.taostats.io/api/block/interval/v1?timestamp_start=1735689600&timestamp_end=1735776000
```

### Code samples

**cURL**

```bash
curl -H "Authorization: <YOUR_API_KEY>" \
  "https://api.taostats.io/api/block/interval/v1?timestamp_start=1735689600&timestamp_end=1735776000"
```

**JavaScript**

```js
const response = await fetch('https://api.taostats.io/api/block/interval/v1?timestamp_start=1735689600&timestamp_end=1735776000', {
  headers: {
    Authorization: '<YOUR_API_KEY>',
  },
});
const data = await response.json();
```

**Python**

```python
import requests

response = requests.get(
    "https://api.taostats.io/api/block/interval/v1?timestamp_start=1735689600&timestamp_end=1735776000",
    headers={"Authorization": "<YOUR_API_KEY>"},
)
data = response.json()
```

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `timestamp_start` | query | `integer (int64)` | Yes | Start of timestamp range in Unix timestamp (seconds since 1970-01-01) (inclusive) |
| `timestamp_end` | query | `integer (int64)` | Yes | End of timestamp range in Unix timestamp (seconds since 1970-01-01) (inclusive) |
| `frequency` | query | `string` |  | Default by_day One of `by_hour`, `by_day`. |
| `page` | query | `integer (int32)` |  | The page number of the response. |
| `limit` | query | `integer (int32)` |  | The number of responses. max is 200, |
| `order` | query | `string` |  | One of `date_asc`, `date_desc`. |

## Responses

### `200` — Blocks retrieved successfully

| Field | Type | Required |
| --- | --- | --- |
| `data` | `array` | Yes |
| `data[].block_number` | `integer (int32)` | Yes |
| `data[].timestamp` | `string (date-time)` | Yes |
| `pagination` | `object` | Yes |
| `pagination.current_page` | `integer (int32)` | Yes |
| `pagination.next_page` | `integer (int32), nullable` |  |
| `pagination.per_page` | `integer (int32)` | Yes |
| `pagination.prev_page` | `integer (int32), nullable` |  |
| `pagination.total_items` | `integer (int32)` | Yes |
| `pagination.total_pages` | `integer (int32)` | Yes |

**Example response**

```json
{
  "data": [
    {
      "block_number": 5007431,
      "timestamp": "2025-02-25T23:59:48Z"
    },
    {
      "block_number": 5000231,
      "timestamp": "2025-02-24T23:59:48.001Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "per_page": 50,
    "prev_page": null,
    "total_items": 5,
    "total_pages": 1
  }
}
```

**Response details**

```text
    {
      "block_number": 5451731,
      "timestamp": "2025-04-28T16:59:48Z"
    },
```

### Other responses

| Status | Meaning |
| --- | --- |
| `400` | Bad request |
| `404` | Blocks not found |
| `500` | Internal server error |

Every request needs an `Authorization` header holding your API key — see [Getting started with the Taostats API](https://beta.taostats.io/docs/start-here/getting-started-with-taostats-api).
