# alchemy_getBlockByTimestamp

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

POST https://zerointerop-mainnet.g.alchemy.com/v2/{apiKey}

Returns the block whose timestamp is closest to the timestamp you pass in. The response is the same block object that `eth_getBlockByNumber` returns, so you can use it anywhere you would use a block fetched by number.

**How the block is chosen**

* **Closest block:** returns the block whose timestamp is nearest to the requested time. This block can be before or after the requested time.
* **Ties:** if two blocks are equally close, returns the earlier block.
* **Clamping:** a timestamp after the latest block returns the latest block. A timestamp before the genesis block returns the genesis block.

**Timestamp formats**

* Unix time in seconds, for example `1700000000`.
* Unix time in milliseconds, for example `1700000000000`. Values of `1000000000000` or greater are read as milliseconds.
* An ISO-8601 date-time string with a time zone, for example `2023-11-14T22:13:20Z` or `2023-11-14T17:13:20-05:00`. Date-only strings and strings without a time zone are rejected.

**Supported networks:** all EVM networks. Non-EVM networks return an `Unsupported method` error.

**Batch requests are not supported yet.** Send each `alchemy_getBlockByTimestamp` call as its own request. A batch that contains this method returns a `-32000` error for each entry.


Reference: https://www.alchemy.com/docs/chains/zero/zero-api-endpoints/alchemy-get-block-by-timestamp

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| blockByTimestampParams | object | Yes | An object with the timestamp to look up and whether to include full transaction objects. |

## Result

**Block** (object): The block closest to the requested timestamp, in the same format as `eth_getBlockByNumber`.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "alchemy_getBlockByTimestamp",
  "params": [
    {
      "timestamp": 1500000000,
      "includeTransactions": false
    }
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "hash": "0x3d2ba8c1a6dcc76a2a4d4a471146da337b44b36fae177f742b15dd30cfcb28f4",
    "parentHash": "0xe45dfa90ee141805e0fd5fa73546513cf2f1162471b1573c4687ebd9652e4d73",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "miner": "0x829bd824b016326a401d083b33d092293333a830",
    "stateRoot": "0xe2ea614f5ff2bf49acc99776e99fd9485f5487a6efaba1804c802a60d30a570e",
    "transactionsRoot": "0x67c51ca5b3c5dbcffe4db695d72d57c7fd95084fbffceb81344376d8d84deb34",
    "receiptsRoot": "0x97a79d285313b5e03b3864c27741f9a1546d2264636f2020f7ea9b6a70064ae4",
    "logsBloom": "0x00000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000008000000000000000000000080000000008000010000000000020000000000000000000800000000000010002000000010000000000000000800000000000000000000000000800101000000000000000000000000000000000000000080000000100200000000000000000000000000020000000010000002000000000000800000000004000000000000000000000000000020000000000000000000000000000000000000000000000000400000000000100000",
    "difficulty": "0x437c622a88c63",
    "number": "0x3d543e",
    "gasLimit": "0x6685bd",
    "gasUsed": "0x33b0b",
    "timestamp": "0x59682eff",
    "extraData": "0xe4b883e5bda9e7a59ee4bb99e9b1bc",
    "mixHash": "0x25b0c2837cf24a013f90fdda2757db76caa6a5b6f1350e978cb300b3524e4886",
    "nonce": "0x841b89380855d31e",
    "size": "0x38f",
    "uncles": [],
    "transactions": [
      "0x76d749230d10c753446718b5d7cc09ebdd414d1abb62a2ae45fce6ef16e9f6ef",
      "0x939ba24a496b127ffc5ef817055969a481b556f115122f4320551a7d8c041488",
      "0x8148affff40ec6d48181c18d87107a057cea30e380cbf70612c100900b650617"
    ]
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "alchemy_getBlockByTimestamp",
  "params": [
    {
      "timestamp": 1500000000,
      "includeTransactions": false
    }
  ]
}'
```

### JavaScript

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

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

### Python

```python
import requests

url = "https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "alchemy_getBlockByTimestamp",
    "params": [
        {
            "timestamp": 1500000000,
            "includeTransactions": False
        }
    ]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

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

func main() {

	url := "https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"alchemy_getBlockByTimestamp\",\n  \"params\": [\n    {\n      \"timestamp\": 1500000000,\n      \"includeTransactions\": false\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"alchemy_getBlockByTimestamp\",\n  \"params\": [\n    {\n      \"timestamp\": 1500000000,\n      \"includeTransactions\": false\n    }\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"alchemy_getBlockByTimestamp\",\n  \"params\": [\n    {\n      \"timestamp\": 1500000000,\n      \"includeTransactions\": false\n    }\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: alchemy_getBlockByTimestamp
summary: Returns the block closest to a given timestamp.
description: |
  Returns the block whose timestamp is closest to the timestamp you pass in. The response is the same block object that `eth_getBlockByNumber` returns, so you can use it anywhere you would use a block fetched by number.

  **How the block is chosen**

  * **Closest block:** returns the block whose timestamp is nearest to the requested time. This block can be before or after the requested time.
  * **Ties:** if two blocks are equally close, returns the earlier block.
  * **Clamping:** a timestamp after the latest block returns the latest block. A timestamp before the genesis block returns the genesis block.

  **Timestamp formats**

  * Unix time in seconds, for example `1700000000`.
  * Unix time in milliseconds, for example `1700000000000`. Values of `1000000000000` or greater are read as milliseconds.
  * An ISO-8601 date-time string with a time zone, for example `2023-11-14T22:13:20Z` or `2023-11-14T17:13:20-05:00`. Date-only strings and strings without a time zone are rejected.

  **Supported networks:** all EVM networks. Non-EVM networks return an `Unsupported method` error.

  **Batch requests are not supported yet.** Send each `alchemy_getBlockByTimestamp` call as its own request. A batch that contains this method returns a `-32000` error for each entry.
tags:
  - name: alchemy
params:
  - name: blockByTimestampParams
    required: true
    description: An object with the timestamp to look up and whether to include full transaction objects.
    schema:
      type: object
      required:
        - timestamp
      additionalProperties: false
      properties:
        timestamp:
          description: The time to find the closest block for. Accepts Unix seconds, Unix milliseconds, or an ISO-8601 date-time string with a time zone. Must not be negative.
          oneOf:
            - title: Unix seconds or milliseconds
              type: integer
              minimum: 0
            - title: ISO-8601 date-time
              type: string
              format: date-time
        includeTransactions:
          description: If `true`, returns full transaction objects. If `false`, returns only transaction hashes.
          type: boolean
          default: false
result:
  name: Block
  description: The block closest to the requested timestamp, in the same format as `eth_getBlockByNumber`.
  schema:
    title: Block object
    type: object
    required:
      - hash
      - parentHash
      - sha3Uncles
      - miner
      - stateRoot
      - transactionsRoot
      - receiptsRoot
      - logsBloom
      - number
      - gasLimit
      - gasUsed
      - timestamp
      - extraData
      - mixHash
      - nonce
      - size
      - transactions
      - uncles
    additionalProperties: false
    properties:
      hash:
        title: Hash
        type: string
        pattern: ^0x[0-9a-f]{64}$
      parentHash:
        title: Parent block hash
        type: string
        pattern: ^0x[0-9a-f]{64}$
      sha3Uncles:
        title: Ommers hash
        type: string
        pattern: ^0x[0-9a-f]{64}$
      miner:
        title: Coinbase
        type: string
        pattern: ^0x[0-9a-fA-F]{40}$
      stateRoot:
        title: State root
        type: string
        pattern: ^0x[0-9a-f]{64}$
      transactionsRoot:
        title: Transactions root
        type: string
        pattern: ^0x[0-9a-f]{64}$
      receiptsRoot:
        title: Receipts root
        type: string
        pattern: ^0x[0-9a-f]{64}$
      logsBloom:
        title: Bloom filter
        type: string
        pattern: ^0x[0-9a-f]{512}$
      difficulty:
        title: Difficulty
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      number:
        title: Number
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      gasLimit:
        title: Gas limit
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      gasUsed:
        title: Gas used
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      timestamp:
        title: Timestamp
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      extraData:
        title: Extra data
        type: string
        pattern: ^0x[0-9a-f]*$
      mixHash:
        title: Mix hash
        type: string
        pattern: ^0x[0-9a-f]{64}$
      nonce:
        title: Nonce
        type: string
        pattern: ^0x[0-9a-f]{16}$
      baseFeePerGas:
        title: Base fee per gas
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      withdrawalsRoot:
        title: Withdrawals root
        type: string
        pattern: ^0x[0-9a-f]{64}$
      blobGasUsed:
        title: Blob gas used
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      excessBlobGas:
        title: Excess blob gas
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      parentBeaconBlockRoot:
        title: Parent Beacon Block Root
        type: string
        pattern: ^0x[0-9a-f]{64}$
      size:
        title: Block size
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      transactions:
        anyOf:
          - title: Transaction hashes
            type: array
            items:
              title: 32 byte hex value
              type: string
              pattern: ^0x[0-9a-f]{64}$
          - title: Full transactions
            type: array
            items:
              type: object
              title: Transaction information
              required:
                - blockHash
                - blockNumber
                - from
                - hash
                - transactionIndex
              unevaluatedProperties: false
              oneOf:
                - title: Signed 4844 Transaction
                  type: object
                  required:
                    - accessList
                    - blobVersionedHashes
                    - chainId
                    - gas
                    - input
                    - maxFeePerBlobGas
                    - maxFeePerGas
                    - maxPriorityFeePerGas
                    - nonce
                    - r
                    - s
                    - to
                    - type
                    - value
                    - yParity
                  properties:
                    type:
                      title: type
                      type: string
                      pattern: ^0x([0-9a-fA-F]?){1,2}$
                    nonce:
                      title: nonce
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    to:
                      title: to address
                      type: string
                      pattern: ^0x[0-9a-fA-F]{40}$
                    gas:
                      title: gas limit
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    value:
                      title: value
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    input:
                      title: input data
                      type: string
                      pattern: ^0x[0-9a-f]*$
                    maxPriorityFeePerGas:
                      title: max priority fee per gas
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: Maximum fee per gas the sender is willing to pay to miners in wei
                    maxFeePerGas:
                      title: max fee per gas
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei
                    maxFeePerBlobGas:
                      title: max fee per blob gas
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: The maximum total fee per gas the sender is willing to pay for blob gas in wei
                    accessList:
                      title: accessList
                      description: EIP-2930 access list
                      type: array
                      items:
                        title: Access list entry
                        type: object
                        additionalProperties: false
                        properties:
                          address:
                            title: hex encoded address
                            type: string
                            pattern: ^0x[0-9a-fA-F]{40}$
                          storageKeys:
                            type: array
                            items:
                              title: 32 byte hex value
                              type: string
                              pattern: ^0x[0-9a-f]{64}$
                    blobVersionedHashes:
                      title: blobVersionedHashes
                      description: List of versioned blob hashes associated with the transaction's EIP-4844 data blobs.
                      type: array
                      items:
                        title: 32 byte hex value
                        type: string
                        pattern: ^0x[0-9a-f]{64}$
                    chainId:
                      title: chainId
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: Chain ID that this transaction is valid on.
                    yParity:
                      title: yParity
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
                    r:
                      title: r
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    s:
                      title: s
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                - title: Signed 1559 Transaction
                  type: object
                  required:
                    - accessList
                    - chainId
                    - gas
                    - gasPrice
                    - input
                    - maxFeePerGas
                    - maxPriorityFeePerGas
                    - nonce
                    - r
                    - s
                    - type
                    - value
                    - yParity
                  properties:
                    type:
                      title: type
                      type: string
                      pattern: ^0x2$
                    nonce:
                      title: nonce
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    to:
                      title: to address
                      oneOf:
                        - title: Contract Creation (null)
                          type: 'null'
                        - title: Address
                          type: string
                          pattern: ^0x[0-9a-fA-F]{40}$
                    gas:
                      title: gas limit
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    value:
                      title: value
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    input:
                      title: input data
                      type: string
                      pattern: ^0x[0-9a-f]*$
                    maxPriorityFeePerGas:
                      title: max priority fee per gas
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: Maximum fee per gas the sender is willing to pay to miners in wei
                    maxFeePerGas:
                      title: max fee per gas
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei
                    gasPrice:
                      title: gas price
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: The effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.
                    accessList:
                      title: accessList
                      description: EIP-2930 access list
                      type: array
                      items:
                        title: Access list entry
                        type: object
                        additionalProperties: false
                        properties:
                          address:
                            title: hex encoded address
                            type: string
                            pattern: ^0x[0-9a-fA-F]{40}$
                          storageKeys:
                            type: array
                            items:
                              title: 32 byte hex value
                              type: string
                              pattern: ^0x[0-9a-f]{64}$
                    chainId:
                      title: chainId
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: Chain ID that this transaction is valid on.
                    yParity:
                      title: yParity
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
                    v:
                      title: v
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.
                    r:
                      title: r
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    s:
                      title: s
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                - title: Signed 2930 Transaction
                  type: object
                  required:
                    - accessList
                    - chainId
                    - gas
                    - gasPrice
                    - input
                    - nonce
                    - r
                    - s
                    - type
                    - value
                    - yParity
                  properties:
                    type:
                      title: type
                      type: string
                      pattern: ^0x1$
                    nonce:
                      title: nonce
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    to:
                      title: to address
                      oneOf:
                        - title: Contract Creation (null)
                          type: 'null'
                        - title: Address
                          type: string
                          pattern: ^0x[0-9a-fA-F]{40}$
                    gas:
                      title: gas limit
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    value:
                      title: value
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    input:
                      title: input data
                      type: string
                      pattern: ^0x[0-9a-f]*$
                    gasPrice:
                      title: gas price
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: The gas price willing to be paid by the sender in wei
                    accessList:
                      title: accessList
                      description: EIP-2930 access list
                      type: array
                      items:
                        title: Access list entry
                        type: object
                        additionalProperties: false
                        properties:
                          address:
                            title: hex encoded address
                            type: string
                            pattern: ^0x[0-9a-fA-F]{40}$
                          storageKeys:
                            type: array
                            items:
                              title: 32 byte hex value
                              type: string
                              pattern: ^0x[0-9a-f]{64}$
                    chainId:
                      title: chainId
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: Chain ID that this transaction is valid on.
                    yParity:
                      title: yParity
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
                    v:
                      title: v
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.
                    r:
                      title: r
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    s:
                      title: s
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                - title: Signed Legacy Transaction
                  type: object
                  required:
                    - gas
                    - gasPrice
                    - input
                    - nonce
                    - r
                    - s
                    - type
                    - v
                    - value
                  properties:
                    type:
                      title: type
                      type: string
                      pattern: ^0x0$
                    nonce:
                      title: nonce
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    to:
                      title: to address
                      oneOf:
                        - title: Contract Creation (null)
                          type: 'null'
                        - title: Address
                          type: string
                          pattern: ^0x[0-9a-fA-F]{40}$
                    gas:
                      title: gas limit
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    value:
                      title: value
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    input:
                      title: input data
                      type: string
                      pattern: ^0x[0-9a-f]*$
                    gasPrice:
                      title: gas price
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: The gas price willing to be paid by the sender in wei
                    chainId:
                      title: chainId
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                      description: Chain ID that this transaction is valid on.
                    v:
                      title: v
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    r:
                      title: r
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                    s:
                      title: s
                      type: string
                      pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
              properties:
                blockHash:
                  title: block hash
                  type: string
                  pattern: ^0x[0-9a-f]{64}$
                blockNumber:
                  title: block number
                  type: string
                  pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
                from:
                  title: from address
                  type: string
                  pattern: ^0x[0-9a-fA-F]{40}$
                hash:
                  title: transaction hash
                  type: string
                  pattern: ^0x[0-9a-f]{64}$
                transactionIndex:
                  title: transaction index
                  type: string
                  pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      withdrawals:
        title: Withdrawals
        type: array
        items:
          type: object
          title: Validator withdrawal
          required:
            - index
            - validatorIndex
            - address
            - amount
          additionalProperties: false
          properties:
            index:
              title: index of withdrawal
              type: string
              pattern: ^0x([1-9a-f]+[0-9a-f]{0,15})|0$
            validatorIndex:
              title: index of validator that generated withdrawal
              type: string
              pattern: ^0x([1-9a-f]+[0-9a-f]{0,15})|0$
            address:
              title: recipient address for withdrawal value
              type: string
              pattern: ^0x[0-9a-fA-F]{40}$
            amount:
              title: value contained in withdrawal
              type: string
              pattern: ^0x([1-9a-f]+[0-9a-f]{0,31})|0$
      uncles:
        title: Uncles
        type: array
        items:
          title: 32 byte hex value
          type: string
          pattern: ^0x[0-9a-f]{64}$
errors:
  - code: -32602
    message: 'Invalid params. Returned when `timestamp` is missing, negative, or not in a supported format, or when `params` is not shaped as `[{"timestamp": ..., "includeTransactions": ...}]`.'
  - code: -32000
    message: Server error. Returned for batch requests, which are not supported yet, and when the request can't be completed on the selected network.
examples:
  - name: alchemy_getBlockByTimestamp example
    params:
      - name: blockByTimestampParams
        value:
          timestamp: 1500000000
          includeTransactions: false
    result:
      name: Block
      value:
        hash: '0x3d2ba8c1a6dcc76a2a4d4a471146da337b44b36fae177f742b15dd30cfcb28f4'
        parentHash: '0xe45dfa90ee141805e0fd5fa73546513cf2f1162471b1573c4687ebd9652e4d73'
        sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
        miner: '0x829bd824b016326a401d083b33d092293333a830'
        stateRoot: '0xe2ea614f5ff2bf49acc99776e99fd9485f5487a6efaba1804c802a60d30a570e'
        transactionsRoot: '0x67c51ca5b3c5dbcffe4db695d72d57c7fd95084fbffceb81344376d8d84deb34'
        receiptsRoot: '0x97a79d285313b5e03b3864c27741f9a1546d2264636f2020f7ea9b6a70064ae4'
        logsBloom: 0x00000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000008000000000000000000000080000000008000010000000000020000000000000000000800000000000010002000000010000000000000000800000000000000000000000000800101000000000000000000000000000000000000000080000000100200000000000000000000000000020000000010000002000000000000800000000004000000000000000000000000000020000000000000000000000000000000000000000000000000400000000000100000
        difficulty: '0x437c622a88c63'
        number: '0x3d543e'
        gasLimit: '0x6685bd'
        gasUsed: '0x33b0b'
        timestamp: '0x59682eff'
        extraData: '0xe4b883e5bda9e7a59ee4bb99e9b1bc'
        mixHash: '0x25b0c2837cf24a013f90fdda2757db76caa6a5b6f1350e978cb300b3524e4886'
        nonce: '0x841b89380855d31e'
        size: '0x38f'
        uncles: []
        transactions:
          - '0x76d749230d10c753446718b5d7cc09ebdd414d1abb62a2ae45fce6ef16e9f6ef'
          - '0x939ba24a496b127ffc5ef817055969a481b556f115122f4320551a7d8c041488'
          - '0x8148affff40ec6d48181c18d87107a057cea30e380cbf70612c100900b650617'
```
