> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Get blocks

Get blocks

` GET /insights/v1/blocks `

Get blocks

Get blocks

## Servers

- ` https://data-api.b3.fun/ ` — B3 Data API - Multi-Chain Proxy

## Parameters

### ` chain ` (query, optional)

Use chain_id instead

- ` value `: type ` array `

  - example: ` [20,56,1] `

  - ` array item `: type ` number `

Example:

```json
[
  20,
  56,
  1
]
```

### ` chain_id ` (query, optional)

The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. Optional, because a single chain can as well be specified as a subdomain

- ` value `: type ` array `

  - example: ` [20,56,1] `

  - ` array item `: type ` number `

Example:

```json
[
  20,
  56,
  1
]
```

### ` filter_block_number ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block number

  - example: ` 1000000 `

Example:

```json
1000000
```

### ` filter_block_number_gte ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block number greater than or equal to

  - example: ` 1000000 `

Example:

```json
1000000
```

### ` filter_block_number_gt ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block number greater than

  - example: ` 1000000 `

Example:

```json
1000000
```

### ` filter_block_number_lte ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block number less than or equal to

  - example: ` 1000000 `

Example:

```json
1000000
```

### ` filter_block_number_lt ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block number less than

  - example: ` 1000000 `

Example:

```json
1000000
```

### ` filter_block_timestamp ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block timestamp

  - example: ` 1715222400 `

Example:

```json
1715222400
```

### ` filter_block_timestamp_gte ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block timestamp greater than or equal to

  - example: ` 1715222400 `

Example:

```json
1715222400
```

### ` filter_block_timestamp_gt ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block timestamp greater than

  - example: ` 1715222400 `

Example:

```json
1715222400
```

### ` filter_block_timestamp_lte ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block timestamp less than or equal to

  - example: ` 1715222400 `

Example:

```json
1715222400
```

### ` filter_block_timestamp_lt ` (query, optional)

- ` value `: type ` number `; nullable — Filter by block timestamp less than

  - example: ` 1715222400 `

Example:

```json
1715222400
```

### ` sort_by ` (query, optional)

- ` value `: type ` unknown ` — Field to sort results by

  - example: ` "block_number" `

  - ` anyOf alternative 1 `: type ` string `

    - Title: constant

    - enum: ` ["block_number"] `

  - ` anyOf alternative 2 `: type ` string `

    - Title: string

Example:

```json
"block_number"
```

### ` sort_order ` (query, optional)

- ` value `: type ` string ` — Sort order (asc or desc)

  - enum: ` ["asc","desc"] `

  - example: ` "desc" `

Example:

```json
"desc"
```

### ` group_by ` (query, optional)

- ` value `: type ` string `; nullable — Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number

### ` aggregate ` (query, optional)

- ` value `: type ` string `; nullable — Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used)

  - example: ` "count() as count" `

Example:

```json
"count() as count"
```

### ` filter_hash ` (query, optional)

- ` value `: type ` string ` — Filter by transaction hash

  - example: ` "0x218b632d932371478d1ae5a01620ebab1a2030f9dad6f8fba4a044ea6335a57e" `

Example:

```json
"0x218b632d932371478d1ae5a01620ebab1a2030f9dad6f8fba4a044ea6335a57e"
```

### ` limit ` (query, optional)

- ` value `: type ` integer ` — The number of items to return

  - default: ` 20 `

  - example: ` 20 `

  - minimum: ` 0 `

  - maximum: ` 1000 `

Example:

```json
20
```

### ` page ` (query, optional)

- ` value `: type ` integer `; nullable — Page number (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters.

  - default: ` 0 `

  - example: ` 0 `

  - minimum: ` 0 `

Example:

```json
0
```

## Responses

### ` 200 ` — Successful response

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` meta `

  - ` data `: type ` array `

    - ` array item `: type ` object `

      - Required fields: ` chain_id `, ` block_number `, ` block_hash `, ` parent_hash `, ` block_timestamp `, ` nonce `, ` sha3_uncles `, ` mix_hash `, ` miner `, ` state_root `, ` transactions_root `, ` receipts_root `, ` logs_bloom `, ` size `, ` extra_data `, ` difficulty `, ` total_difficulty `, ` transaction_count `, ` gas_limit `, ` gas_used `, ` withdrawals_root `, ` base_fee_per_gas `

      - ` chain_id `: type ` number `

      - ` block_number `: type ` number `

      - ` block_hash `: type ` string `

      - ` parent_hash `: type ` string `

      - ` block_timestamp `: type ` number `

      - ` nonce `: type ` string `

      - ` sha3_uncles `: type ` string `

      - ` mix_hash `: type ` string `

      - ` miner `: type ` string `

      - ` state_root `: type ` string `

      - ` transactions_root `: type ` string `

      - ` receipts_root `: type ` string `

      - ` logs_bloom `: type ` string `

      - ` size `: type ` number `

      - ` extra_data `: type ` string `

      - ` difficulty `: type ` string `

      - ` total_difficulty `: type ` string `

      - ` transaction_count `: type ` number `

      - ` gas_limit `: type ` number `

      - ` gas_used `: type ` number `

      - ` withdrawals_root `: type ` string `

      - ` base_fee_per_gas `: type ` number `

  - ` aggregations `: type ` unknown `; nullable

  - ` meta `: type ` object `

    - Required fields: ` chain_ids `, ` page `, ` limit_per_chain `, ` total_items `, ` total_pages `

    - ` chain_ids `: type ` array `

      - ` array item `: type ` number `

    - ` address `: type ` string `

    - ` signature `: type ` string `

    - ` page `: type ` number `

    - ` limit_per_chain `: type ` number `

    - ` total_items `: type ` number `

    - ` total_pages `: type ` number `

### ` 400 ` — Bad request

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 500 ` — Internal server error

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

## Request examples

### cURL

```curl
curl -X GET 'https://data-api.b3.fun//insights/v1/blocks'
```

### JavaScript

```javascript
const response = await fetch('https://data-api.b3.fun//insights/v1/blocks', {
  method: 'GET'
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

response = requests.get('https://data-api.b3.fun//insights/v1/blocks')
print(response.json())
```