Free Account Users can access only up to a month of blockchain history from the latest block, while paid users don't have this limitation.
Setting up the range
When using our raw data endpoints, you have to specify in what time period you want to get the information.
We support setting up the range via block numbers, timestamps and block hash
Block_number Parameters
To set up the range, use block_number_start
and block_number_end
. This will tell the API what blocks to scan on the blockchain. Those parameters supports int256
values and if you want to set the range to the latest block on the blockchain, set the value as latest
.
Negative block number parameters
You can set your block_number_start
and block_number_end
as negative numbers.
For example, setting it to block_number_start=-1000
will mean that the starting point is 1000 blocks away from the latest block. Just remember that the end can't be set to an earlier block than the start.
Example
So, to scan from 1000th block to 2000th block, we need to set the block_number
parameters in the request as
?block_number_start=1000&block_number_end=2000
And if you want to scan every single block, set the starting point as 0 and latest
at the end
?block_number_start=0&block_number_end=latest
Timestamps parameters
If you do not know what blocks should you use, you can set the range as timestamps: timestamp_start
and timestamp_end
Timestamps are represented in UNIX Epoch Time, so you will need to convert your desired time period to UNIX time.
Let's say, you want to get the info about the transfers of Address X from January 1st 2022 00:00 GMT to January 31th 2022 23:59 GMT. In UNIX Epoch time it will look like this: 1640995200
and 1643673540
The API will start and finish the scanning from the closest blocks to these timestamps.
Example
?timestamp_start=1640995200×tamp_end=1643673540
Block_hash parameter
Use this if you want to get the information in one specific block, use block_hash
as one of your request's parameters
Example
So, you want to get the info in block 1337 on Ethereum. The hash for this block is 0x0c195cccdaf1c289879187a819ae8caed341fd5568e32d98b584c37dc09c59e7
and the parameter will look like this:
?block_hash=0x0c195cccdaf1c289879187a819ae8caed341fd5568e32d98b584c37dc09c59e7
Range offset
Imagine that you are getting the information on a very active Smart Contract. You've set the range parameters and a limit
of 1000 results. The response always starts with range
parameters, where we can gain useful information
"range": {
"has_more": true,
"start_block": 1,
"end_block": 6946724,
"next_offset": "000000000069e99f-000a-00000001"
}
"has_more": true
means there's more than 1000 results on that Smart Contract in this time period. To see the next "page", we need to set the offset
parameter in our request to the same value as range.next_offset
in previous response.
So it will look like this:
?offset=000000000069e99f-000a-00000001