Anyblock is now proudly part of Blockdaemon - read the announcement in our blog

Search documentation

Gas Endpoints

Overview

This section describes Anyblock gas endpoints. Each of them returns a JSON object with the corresponding gas metrics for all Ethereum-based networks we serve.

Gas is the unit measuring the amount of computational effort that is required to conduct a transaction or execute a contract on the Ethereum blockchain platform. Gas prices are denoted in gwei, which are small fractions of the cryptocurrency Ether (ETH).

gasprice (Gas Fee Estimates)

GET /{technology}/{blockchain}/{network}/gasprice
GET /{technology}/{blockchain}/{network}/latest-minimum-gasprice (alias, deprecated)
This endpoint outputs the estimated gas fees and other gas metrics for a given triple of technology, blockchain, and network.

As shown in the sections below, the calculation method and the output depend on whether a given network supports Ethereum’s EIP-1559 update.

EIP-1559 Networks

For the networks supporting the EIP-1559 update, our endpoint outputs the estimated priority fee, maximum priority fee, and effective gas price as well as other metrics.

Depending on the metric, the latest 20 or 200 blocks are taken into account for the calculation.

A sample query (Ethereum Mainnet):
https://api.anyblock.tools/ethereum/ethereum/mainnet/gasprice

The output:

{
    "health": true,
    "blockNumber": 13556603,
    "blockTime": 14.28643216080402,
    "slow": 102.41,
    "standard": 113.923499284,
    "fast": 136.074253706,
    "instant": 173.935867462,
    "latestBlockBaseFee": 111.176308673,
    "latestBlockMinFee": 111.176308673,
    "eip1559": {
        "slow": {
            "probability": "30%",
            "priorityFee": 0,
            "maxFee": 222.352617346
        },
        "standard": {
            "probability": "60%",
            "priorityFee": 1,
            "maxFee": 223.352617346
        },
        "fast": {
            "probability": "90%",
            "priorityFee": 1.5,
            "maxFee": 223.852617346
        },
        "faster": {
            "probability": "96%",
            "priorityFee": 2,
            "maxFee": 224.352617346
        },
        "instant": {
            "probability": "99%",
            "priorityFee": 3,
            "maxFee": 225.352617346
        }
    }
}

Output fields:

Field Description Calculation method
health A validation whether the estimation is sound The validation is based on whether the latest 200 blocks return non-empty gas price data
blockNumber The latest block number N/A
blockTime The mean block time The mean block time is calculated from the latest 200 blocks
slow
standard
fast
instant
The estimated effective gas prices to include a transaction at a given speed The calculation method takes into account the minimum effective gas prices in the latest 200 blocks. It provides different estimates based on the percentiles of these values:
  • slow – 35th
  • standard – 60th
  • fast – 90th
  • instant – 100th

You can use them as gas price estimates for legacy transactions

latestBlockBaseFee The base fee in the latest block N/A
latestBlockMinFee The minimum effective gas price in the latest block transactions N/A
eip1559 The main estimates you need for EIP-1559 transactions N/A
├── slow
├── standard
├── fast
├── faster
└── instant
The estimates of probability, priorityFee, and maxFee (see below) to include a transaction at a given speed The calculation method takes into account the 3 cheapest EIP-1559 transactions in each of the latest 20 blocks (if there are legacy transactions, they are ignored). The estimates are based on the percentiles of the cheapest priority fees:
  • slow – 35th
  • standard – 60th
  • fast – 90th
  • faster – 100th
  • instant – the faster priority fee boosted by 1.5 to ensure a 99% inclusion probability
 ├── probability The probability of the transaction to be included in the next block We calculated this probability by looking at the accuracy of our predictions over 100.000 blocks from the Ethereum mainnet. The calculation was performed once and is not being updated
 ├── priorityFee The estimated priority fee See the information on slow, standard, fast, faster, and instant estimates (above)
 └── maxFee The estimated maximum priority fee 2 * latestBlockBaseFee + priorityFee

Legacy Networks

For the networks not supporting the EIP-1559 update, our endpoint outputs the estimated gas price as well as other metrics.

The latest 200 blocks are taken into account for the calculation.

A sample query (Ethereum POA xDai):
https://api.anyblock.tools/ethereum/poa/xdai/gasprice

The output:

{
	"health": true,
	"blockNumber": 18964666,
	"blockTime": 5,
	"slow": 1,
	"standard": 1,
	"fast": 1.219999999,
	"instant": 1.219999999
}

Output fields:

Field Description Calculation method
health A validation whether the estimation is sound The validation is based on whether the latest 200 blocks return non-empty gas price data
blockNumber The latest block number N/A
blockTime The mean block time The mean block time is calculated from the latest 200 blocks
slow
standard
fast
instant
The estimated gas prices to include a transaction at a given speed The calculation method takes into account the minimum gas prices in the latest 200 blocks. It provides different estimates based on the percentiles of these values:
  • slow– 35th
  • standard – 60th
  • fast – 90th
  • instant – 100th

gasprice (Address History)

GET /{technology}/{blockchain}/{network}/{address}/gasprice

This endpoint retrieves the gas price statistics for a given destination contract address and triple of technology, blockchain, and network.

A maximum of 1000 transactions is taken into account for the calculation.
To use this endpoint, you need to specify the destination contract address, for example: 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359

A sample query (Ethereum Mainnet):
https://api.anyblock.tools/ethereum/ethereum/mainnet/0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359/gasprice

The output:

{
   	"mean": 10.328411770318,
   	"median": 8,
   	"percentile95": 25,
   	"min": 1,
   	"max": 198.4
}

Output fields:

Field Description
mean The mean gas price
median The median gas price
percentile95 The 95th percentile gas price
min The minimum gas price
max The maximum gas price

gasusage (Address History)

GET /{technology}/{blockchain}/{network}/{address}/gasusage

This endpoint retrieves the gas usage statistics for a given destination contract address and triple of technology, blockchain, and network.

A maximum of 1000 transactions is taken into account for the calculation.

To use this endpoint, you need to specify the destination contract address, for example: 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359

A sample query (Ethereum Mainnet):
https://api.anyblock.tools/ethereum/ethereum/mainnet/0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359/gasusage

The output:

{
   	"mean": 41177.621,
   	"median": 45273,
   	"percentile95": 52426,
   	"min": 14945,
   	"max": 53406
}

Output fields:

Field Description
mean The mean gas usage
median The median gas usage
percentile95 The 95th percentile gas usage
min The minimum gas usage
max The maximum gas usage

Interested or questions?

 

Sascha Göbel
(Co-Founder & Chief Technology Officer)
sascha@anyblockanalytics.com
+49 6131 3272372

    

Pin It on Pinterest