Gas Price API
Accurate next block gas price estimation.
The Gas Price API gives you the gas price needed to have a certain probability to qualify for inclusion in the next block (for Ethereum or Polygon) or the next ∼10 seconds, depending on the chain. Need a high probability of being confirmed at the expense of spending extra gas? Use the 99% probability prediction. Don't mind if the transaction takes longer to confirm? Use the 50% probability prediction.
Gas Platform currently supports the following networks
Arbitrum One
mainnet
42161
Avalanche
mainnet
43114
Base
mainnet
8453
Blast
mainnet
81457
Chiliz
mainnet
88888
Cronos
mainnet
25
Ethereum
mainnet
1
Fantom
mainnet
250
Gnosis
mainnet
100
Immutable zkEVM
mainnet
204
Linea
mainnet
59144
Lisk
mainnet
1135
Mantle
mainnet
5000
Moonbeam
mainnet
1284
opBNB
mainnet
13371
Optimism
mainnet
10
Polygon
mainnet
137
Ronin
mainnet
2020
Scroll
mainnet
534352
SEI
pacific-1
1329
ZetaChain
mainnet
7000
ZKsync
mainnet
324
You can view an introductory video on Gas Platform here.
Looking for a network that's not currently supported? Let us know by using our contact form here.
Authentication
A valid Blocknative API key is OPTIONAL in the Authorization
Header of every request. Request an API key here.
A free API key is recommended for more generous rate limits and future features.
API Endpoint
GET
https://api.blocknative.com/gasprices/blockprices
Returns a range of confidence intervals for gas prices needed to qualify a transaction for inclusion in the next block or next ∼10 seconds, depending on the chain. The order of confidence intervals is subject to change.
Rate Limits
Each endpoint is limited to provide updated results once per second for paid tier API keys, or every 5 seconds for free tier API keys. Polling faster than these rates may deliver stale data.
Request
Example request
Or without the optional apikey
Example non-default chain request
Example custom confidence level request
An alternative format for confidence levels is
Example Response Payload
Header
Authorization
string
OPTIONAL if used, must contain a valid apikey
Query Parameters
confidenceLevels
integer
Override default confidence levels (99,95,90,80,70) in response with up to 5 confidence levels.
Ethereum Mainnet confidence levels are from 1 - 99 (increments of 1) Other chains confidence levels are any from (99,95,90,80,70,50)
chainid
integer
The network chain ID. Default is 1 (Ethereum Mainnet).
Type0 and Type2 Transactions
Type0 transactions (Pre EIP-1559) should utilize the Price
number under each confidence level. Type2 transactions (EIP-1559) should utilize the values for maxPriorityFeePerGas
(also known as the "tip") and maxFeePerGas
.
Description of Terms
maxPrice
Highest priced transaction in the mempool.
currentBlockNumber
Block number at the time of prediction.
msSinceLastBlock
Milliseconds since the last block was mined relative to when data was computed.
blockNumber
Block this prediction is for.
estimatedTransaction Count
Number of items we estimate will be included in next block based on mempool snapshot.
baseFeePerGas
Base fee per gas for current block in gwei. (Only type2 transactions Post EIP-1559 have this value and it's burned by the network upon transaction success).
blobBaseFeePerGas
Base fee per gas for blobs for current block in gwei. (Only type3 transactions Post EIP-4844 have this value and it's burned by the network upon transaction success).
estimatedPrices -> confidence
The likelihood the next block will contain a transaction with a price >= to the listed price.
estimatedPrices -> price
Price in Gwei (used for type0 transactions: Pre EIP-1559).
estimatedPrices -> maxPriorityFeePerGas
Max priority fee per gas in gwei also known as the "tip" (used for type2 transactions: EIP-1559).
estimatedPrices -> maxFeePerGas
Max fee per gas in gwei (used for type2 transactions: EIP-1559). maxFeePerGas is computed from baseFeePerGas prediction ∼10 seconds after the current pending block + maxPriorityFeePerGas.
Last updated