0

I am trying to collect information such as, 'fast': 140, 'fastest': 165, 'safeLow': 100, 'average': 120, 'block_time': 8.875, 'blockNum': 10021935, 'speed': 0.8993211072506393,....etc. on the latest Ethereum block.

There are bunch of API provided in https://etherscan.io/apis but I am unable to get what I want. Any clue is highly appreciated.

The above example is shown from https://ethgasstation.info/api/ethgasAPI.json

0

Etherscan currently doesn't offer similar information through its API. They have two endpoints for providing gas information, but probably don't cover your need. See details at https://etherscan.io/apis#gastracker

If Eth Gas station is providing the right information, why don't you use that? You can find full documentation on their site https://docs.ethgasstation.info/.

Gas Price

Returns the fast, standard and safe low prices, along with the current block.

https://ethgasstation.info/api/ethgasAPI.json

Example response

{  
   "fast":50.0,
   "fastest":200.0,
   "safeLow":10.0,
   "average":20.0,
   "block_time":13.942307692307692,
   "blockNum":7403346,
   "speed":0.7090284960673774,
   "safeLowWait":13.4,
   "avgWait":1.8,
   "fastWait":0.5,
   "fastestWait":0.5
}
2
  • thank you @wslyvh, I wanted to check whether the price differs from oracle to oracle.
    – temp
    May 11 '20 at 20:01
  • Makes sense. So you could check the data from ETHGas station first and then pick the Gwei value of any timing that you want (e.g. the average) to compare it's wait time (e.g. avgWait) to that of Etherscan's with their endpoint. api.etherscan.io/…
    – wslyvh
    May 12 '20 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.