> For the complete documentation index, see [llms.txt](https://sodex.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sodex.com/documentation/for-developers/api-reference/json-rpc/eth-getblockbyhash.md).

# eth\_getBlockByHash

POST `https://mainnet.valuechain.xyz`

Returns information about a block by hash.

## Parameters

| Name        | Type    | Required | Description                                                                 |
| ----------- | ------- | -------- | --------------------------------------------------------------------------- |
| `blockHash` | hash    | Yes      | 32-byte block hash.                                                         |
| `hydrated`  | boolean | Yes      | If `true`, return full transactions; if `false`, return transaction hashes. |

## Result

**Block** (object or null): Block object, or `null` if the hash is unknown.

## Example

### Response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "number": "0xd81e9f",
    "hash": "0x565381ec3a896e084662587ed4eba8f3b6745ffeff7b1d7b672b4b1bb724f3b5",
    "parentHash": "0xd030ea66153bcfef30754d893a7b7873a28a91a84822e92483cdf9e0a7953782",
    "transactions": [
      "0xb269e14e09977c2969efcabd2eabbef7aeb8196780a53fce6dc5b7605169b10d"
    ],
    "gasUsed": "0x5208",
    "baseFeePerGas": "0xf4240"
  }
}
```

## Code examples

### cURL

```bash
curl --request POST \
  --url https://mainnet.valuechain.xyz \
  --header 'Content-Type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBlockByHash", "params": ["0x565381ec3a896e084662587ed4eba8f3b6745ffeff7b1d7b672b4b1bb724f3b5", false]}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"jsonrpc": "2.0", "id": 1, "method": "eth_getBlockByHash", "params": ["0x565381ec3a896e084662587ed4eba8f3b6745ffeff7b1d7b672b4b1bb724f3b5", false]})
};

fetch('https://mainnet.valuechain.xyz', options)
  .then((res) => res.json())
  .then((res) => console.log(res))
  .catch((err) => console.error(err));
```

### Python

```python
import requests

url = "https://mainnet.valuechain.xyz"
payload = {
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBlockByHash",
  "params": [
    "0x565381ec3a896e084662587ed4eba8f3b6745ffeff7b1d7b672b4b1bb724f3b5",
    false
  ]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
```
