# /v2/beacon/blocks/{block_id}

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

GET https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v2/beacon/blocks/{block_id}

Retrieves full block details for the given block identifier.


Reference: https://www.alchemy.com/docs/chains/ethereum/ethereum-beacon-api-endpoints/ethereum-beacon-api-endpoints/v-2-beacon-blocks-block-id

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| block_id | string | Yes | Block identifier.   Can be one of:   `head` (canonical head in node's view),   `genesis`,   `finalized`,   `<slot>`,   `<hex encoded blockRoot with 0x prefix>`.  |

## Code Examples

### cURL

```bash
curl --request GET \
  --url https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v2/beacon/blocks/head
```

### JavaScript

```javascript
const options = {method: 'GET'};

fetch('https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v2/beacon/blocks/head', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v2/beacon/blocks/head"

response = requests.get(url)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v2/beacon/blocks/head"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.get("https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v2/beacon/blocks/head")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v2/beacon/blocks/head");
var client = new RestClient(options);
var request = new RestRequest("");
var response = await client.GetAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /eth/v2/beacon/blocks/{block_id}
method: GET
operation:
  summary: /v2/beacon/blocks/{block_id}
  description: |
    Retrieves full block details for the given block identifier.
  tags:
    - Ethereum Beacon API Endpoints
  security:
    - apiKey: []
  parameters:
    - name: block_id
      in: path
      required: true
      schema:
        type: string
        example: head
      description: |
        Block identifier.   Can be one of:   `head` (canonical head in node's view),   `genesis`,   `finalized`,   `<slot>`,   `<hex encoded blockRoot with 0x prefix>`.
  responses:
    '200':
      description: Block retrieved successfully.
      content:
        application/json:
          schema:
            type: object
            properties:
              version:
                type: string
                description: Protocol version (e.g. "electra").
              execution_optimistic:
                type: boolean
                description: Whether the execution payload is optimistic.
              finalized:
                type: boolean
                description: Whether the block is finalized.
              data:
                type: object
                description: Block contents.
                properties:
                  message:
                    type: object
                    properties:
                      slot:
                        type: string
                      proposer_index:
                        type: string
                      parent_root:
                        type: string
                      state_root:
                        type: string
                      body:
                        type: object
                        properties:
                          randao_reveal:
                            type: string
                          eth1_data:
                            type: object
                            properties:
                              deposit_root:
                                type: string
                              deposit_count:
                                type: string
                              block_hash:
                                type: string
                          graffiti:
                            type: string
                          proposer_slashings:
                            type: array
                            items:
                              type: object
                          attester_slashings:
                            type: array
                            items:
                              type: object
                          attestations:
                            type: array
                            items:
                              type: object
                          deposits:
                            type: array
                            items:
                              type: object
                          voluntary_exits:
                            type: array
                            items:
                              type: object
                          sync_aggregate:
                            type: object
                          bls_to_execution_changes:
                            type: array
                            items:
                              type: object
                          blob_kzg_commitments:
                            type: array
                            items:
                              type: string
                          execution_payload:
                            type: object
                          execution_requests:
                            type: object
                  signature:
                    type: string
          examples:
            exampleResponse:
              summary: Example real response
              value:
                version: electra
                execution_optimistic: false
                finalized: false
                data:
                  message:
                    slot: '12304813'
                    proposer_index: '356622'
                    parent_root: '0x9d7bf160847cebe069890d0d1811bd7665bff49fb65c311805ee0f124f4c7de2'
                    state_root: '0xb0850a65116ed2fdd74340230967f3688d076d3d9903e61d0de174ff9a09a385'
                    body:
                      randao_reveal: '0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505'
                      eth1_data:
                        deposit_root: '0x2ebc563cabdbbacbc56f0de1d2d1c2d5315a4b071fcd8566aabbf0a45161c64e'
                        deposit_count: '2045305'
                        block_hash: '0x0958d83550263ff0d9f9a0bc5ea3cd2a136e0933b6f43cbb17f36e4da8d809b1'
                      graffiti: '0x0000000000000000000000000000000000000000000000000000000000000000'
                      proposer_slashings: []
                      attester_slashings: []
                      attestations:
                        - aggregation_bits: 0xfffffffbffffffff...
                          data:
                            slot: '12304812'
                            index: '0'
                            beacon_block_root: '0x9d7bf160847cebe069890d0d1811bd7665bff49fb65c311805ee0f124f4c7de2'
                            source:
                              epoch: '384524'
                              root: '0x69d231105c8c6e602d868fc5e4015b429cf330125c3fdade8ac034db36f049b0'
                            target:
                              epoch: '384525'
                              root: '0x18a7f340369eb4459e2274fc3eb98aad725351a9031fe3cbea8e75e888d5f78d'
                          signature: '0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505'
                          committee_bits: '0xffffffffffffffff'
                      deposits: []
                      voluntary_exits: []
                      sync_aggregate:
                        sync_committee_bits: '0x01'
                        sync_committee_signature: 0xa5fc41bbabe5c6bf0e118146e6d517...
                      bls_to_execution_changes: []
                      blob_kzg_commitments: []
                      execution_payload:
                        parent_hash: '0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2'
                        fee_recipient: '0xAbcF8e0d4e9587369b2301D0790347320302cc09'
                        state_root: '0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2'
                        block_number: '1'
                        gas_limit: '1'
                        gas_used: '1'
                        timestamp: '1'
                        transactions: []
                        withdrawals: []
                      execution_requests:
                        deposits: []
                        withdrawals: []
                        consolidations: []
                  signature: '0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505'
```
