Skip to main content

qn_getBlocksInTimestampRange RPC Method - Block Timestamp Lookup

Retrieves all blocks within a specified Unix timestamp range, allowing you to query historical blocks in a defined time window. The response can be paginated to efficiently handle large sets of data, making it useful for detailed analysis across extended time periods.

Updated on
Aug 09, 2026
Please note that this RPC method requires the Block Timestamp Lookup add-on enabled on your Quicknode endpoint. This method is available for mainnet only.

Parameters

startTimestamp
integer
REQUIRED

The Unix timestamp (in seconds) marking the start of the desired time range

endTimestamp
integer
REQUIRED

The Unix timestamp (in seconds) marking the end of the desired time range

pageSize
integer

(Optional) Defines how many blocks to return per page. The default value is 100, with a maximum of 1000

lastTimestamp
integer

(Optional) The timestamp of the last block from the previous page, used to paginate through large result sets

lastBlockNumber
integer

(Optional) The block number of the last block from the previous page, used in conjunction with lastTimestamp for pagination

Returns

result
object

The result object which contains the following fields:

blocks
array

An array that contains the list of block objects that fall within the specified timestamp range. Each object represents a block and contains the following fields:

blockNumber
integer

The unique number of the block on the blockchain

network
string

The blockchain network on which the block exists

timestamp
integer

The Unix timestamp (in seconds) representing when the block was created

pagination
object

The pagination object which contains the following fields:

hasNextPage
boolean

A boolean value that indicates whether there are more pages of results to retrieve. If true, it means there are additional blocks that fall within the specified timestamp range but were not included in the current response due to the pageSize limit

nextPageParams
object

The nextPageParams object which contains the following fields:

lastBlockNumber
integer

The block number of the last block in the current page

lastTimestamp
integer

The timestamp of the last block in the current page

pageSize
integer

The number of blocks that were returned in the current response

Request
Response
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": {
5
"blocks": [
6
{
7
"blockNumber": 29402654,
8
"network": "ethereum",
9
"timestamp": 1730000000
10
},
11
{
12
"blockNumber": 29402655,
13
"network": "ethereum",
14
"timestamp": 1730000012
15
},
16
{
17
"blockNumber": 29402656,
18
"network": "ethereum",
19
"timestamp": 1730000024
20
},
21
{
22
"blockNumber": 29402657,
23
"network": "ethereum",
24
"timestamp": 1730000036
25
},
26
{
27
"blockNumber": 29402658,
28
"network": "ethereum",
29
"timestamp": 1730000048
30
}
31
],
32
"pagination": {
33
"hasNextPage": true,
34
"nextPageParams": {
35
"lastBlockNumber": 29402658,
36
"lastTimestamp": 1730000048,
37
"pageSize": 5
38
}
39
}
40
}
41
}
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": {
5
"blocks": [
6
{
7
"blockNumber": 29402654,
8
"network": "ethereum",
9
"timestamp": 1730000000
10
},
11
{
12
"blockNumber": 29402655,
13
"network": "ethereum",
14
"timestamp": 1730000012
15
},
16
{
17
"blockNumber": 29402656,
18
"network": "ethereum",
19
"timestamp": 1730000024
20
},
21
{
22
"blockNumber": 29402657,
23
"network": "ethereum",
24
"timestamp": 1730000036
25
},
26
{
27
"blockNumber": 29402658,
28
"network": "ethereum",
29
"timestamp": 1730000048
30
}
31
],
32
"pagination": {
33
"hasNextPage": true,
34
"nextPageParams": {
35
"lastBlockNumber": 29402658,
36
"lastTimestamp": 1730000048,
37
"pageSize": 5
38
}
39
}
40
}
41
}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free