How can I get all stats by day?
Tags: web3, ethereum, blockchain, web3dev
Published: 2022-03-04 18:22:04


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4sj377slfyq1k9e3hazq.png)

**Hello everyone!**
We at WatchData are in the business of making life better for developers and the entire crypto community. Our API is a simple and easy way to interact with blockchain and we want to tell and show you what you can get by using WatchData.

Here is a brief analysis of our endpoints.

In this series of articles, you can get answers to the following questions:

- What is it?
- What is it for?
- What can I do with it?

Today we'll start with [watch_getStatsByDay](https://docs.watchdata.io/structured-data/stats-new/watch_getstatsbyday). We added this endpoint recently, but now we want to tell you what its value and usefulness are.

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. 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.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.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xnkoiv53qs85bw8rmgpc.png)

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](https://docs.watchdata.io/introduction/quick-start-guide-to-watchdata). 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

`{
    "jsonrpc":"2.0",
    "method":"watch_getStatsByDay",
    "params":[1646053739],
    "id":0
}`

Example response

`{
    "id": 0,
    "jsonrpc": "2.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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dpnag6grv2bcoekph17l.png)

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!

-----
This example shows the method, which gives the data within one day, if you need other ranges, please contact us marketing@thewatch.io
Or join **[our discord community](https://discord.com/invite/TZRJbZ6bdn)**, there, in the channel #general you can ask any questions that interest you, as well as in the channel #feature-request suggest a feature or statistical information that you need in the first place.

**HELPFUL LINKS
**

- [WatchData main](https://www.watchdata.io/)
- [Raw Data
](https://www.watchdata.io/raw-data)
- [Structured data](https://www.watchdata.io/structured-data)
- [Metrics for analysis](https://watchdata.notion.site/Metrics-for-analysis-98dea0a697764bc6ae51643828449dc9)
- [For Miners](https://watchdata.notion.site/For-Miners-70367c9705ae482c90674d070eedea61)
- [WatchData Discord](https://discord.com/invite/TZRJbZ6bdn)
- [WatchData Twitter](https://twitter.com/Watchdata_web3)
- [WatchData Docs](https://docs.watchdata.io/introduction/welcome-to-watchdata-docs)