How can i Get stats by Day
A short how to guide.
Today we’ll start with watch_getStatsByDay. We added this endpoint recently, but now we want to tell you what its value and usefulness are.
  1. 1.
    watch_getStatsByDay — is a set of parameters collected in a single endpoint. This is the statistical data used in the ETH blockchain. By the way, this method will be available for other blockchains in the near future.
  2. 2.
    With this data you can get all the statistical information for 1 day in 1 click. This removes a headache for many users, because using this method you don’t have to collect and process data from different sources.
  3. 3.
    There are many ways to use and process this data, for example, you can use it in the following cases:
  • You can build a graph and estimate the statistics, on which day there were more transactions and on which day more commission was paid.
All you have to do is get a key and process the request through any API interaction tool, you can find a detailed guide → here. In the parameters, select the date you need and get an answer. To convert the unix timestamp you can use https://www.epochconverter.com/
Example Request
Curl
Postman
curl --location --request POST 'https://ethereum.api.watchdata.io/node/jsonrpc?api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc":"2.0",
"method":"watch_getStatsByDay",
"params":[1646053739],
"id":0
}'
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=YOUR_API_KEY
RequestType: POST
Body:
{
"jsonrpc":"2.0",
"method":"watch_getStatsByDay",
"params":[1646053739],
"id":0
}
Example Response
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"transactionCount": 1108112,
"averageGasPrice": 74184332107.8433,
"totalGasUsed": 99340469987,
"uncleBlockReward": 628250000000000000000,
"minersReward": 13744624508661043931629,
"blockCount": 6424
}
}
Returns explanation
Object - A block object with the following fields, or null when no block was found:
  • transactionCount: QUANTITY — number of transactions per day
  • averageGasPrice: QUANTITY, — average gas price per day.
  • totalGasUsed: QUANTITY, — total gas used per day
  • uncleBlockReward: QUANTITY, — uncle block reward by day
  • minersReward: QUANTITY, — miner’s reward per day
  • blockCount: QUANTITY, — number of blocks per day
This way you can collect data for the time period you need. For example
Using this data, you can build any graphs you want as well as serving specific information. Of course presented here is only a small part, it all depends on your product, you are free to work with any type of data, and we will help you with this!
Copy link