Prices 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 Bitcoin) 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

Click on any chainID in the table below to access the corresponding API.

43 chains currently supported.

NameNetworkChain IDUnit
Arbitrum Onemain42161gwei
Avalanchemain43114
Basemain8453gwei
Berachainmain80094
Bitcoinmain0
Blastmain81457
Bobmain60808
BSC (BNB Smart Chain)main56
Chilizmain88888
Cronosmain25
Ethereummain1gwei
Fraxtalmain252
Gnosismain100
HyperEVMmain999
Immutable zkEVMmain13371
Inkmain57073
Lensmain232
Lineamain59144
Liskmain1135
Mantlemain5000
Metismain1088
Modemain34443
Moonbeammain1284
opBNBmain204
Optimismmain10gwei
Palmmain11297108109
Polygonmain137gwei
Polygon zkEVMmain1101
Roninmain2020
Rootstockmain30
Scrollmain534352
SEIpacific-11329gwei/gsei
Snax Chainmain2192
Soneiummain1868
Sonicmain146
Storymain1514
Swellmain1923
Taikomain167000
Unichainmain130
World Chainmain480
ZetaChainmain7000
Zircuitmain48900
ZKsyncmain324
Zoramain7777777

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

This will provide Ethereum Mainnet estimates across all confidence levels by default.

curl -H 'Authorization: optional-apikey-here' 'https://api.blocknative.com/gasprices/blockprices'
null

Or without the optional apikey

curl 'https://api.blocknative.com/gasprices/blockprices'
null

Example using ChainID

curl 'https://api.blocknative.com/gasprices/blockprices?chainid=1514'

Example using System and Network parameters

To know which parameters to use, refer to the list under /chains .

curl 'https://api.blocknative.com/gasprices/blockprices?system=story&network=mainnet'
null

Example using custom confidence level request

curl -H 'Authorization: optional-apikey-here' 'https://api.blocknative.com/gasprices/blockprices?chainid=1&confidenceLevels=50&confidenceLevels=70&confidenceLevels=80&confidenceLevels=90&confidenceLevels=99'
null

An alternative format for confidence levels is

curl -H 'Authorization: optional-apikey-here' 'https://api.blocknative.com/gasprices/blockprices?chainid=1&confidenceLevels=50,70,80,90,99'
```{% endcode %}

### Example Response Payload

```json
{
  "system": "ethereum",
  "network": "main",
  "unit": "gwei",
  "maxPrice": 25,
  "currentBlockNumber": 19420156,
  "msSinceLastBlock": 8303,
  "blockPrices": [
    {
      "blockNumber": 19420156,
      "estimatedTransactionCount": 58,
      "baseFeePerGas": 20.118985095,
      "blobBaseFeePerGas": 1e-9,
      "estimatedPrices": [
        {
          "confidence": 99,
          "price": 20,
          "maxPriorityFeePerGas": 0.1,
          "maxFeePerGas": 24.12
        },
        {
          "confidence": 95,
          "price": 20,
          "maxPriorityFeePerGas": 0.09,
          "maxFeePerGas": 24.11
        },
        {
          "confidence": 90,
          "price": 20,
          "maxPriorityFeePerGas": 0.09,
          "maxFeePerGas": 24.11
        },
        {
          "confidence": 80,
          "price": 20,
          "maxPriorityFeePerGas": 0.08,
          "maxFeePerGas": 24.1
        },
        {
          "confidence": 70,
          "price": 20,
          "maxPriorityFeePerGas": 0.07,
          "maxFeePerGas": 24.09
        }
      ]
    }
  ]
}
null

Header

NameTypeDescription
Authorizationstring

OPTIONAL

if used, must contain a valid apikey

{
    "system": "ethereum",
    "network": "main",
    "unit": "gwei",
    "maxPrice": Number, // Highest priced transaction in the mempool
    "currentBlockNumber": Number, // Block number at time of prediction
    "msSinceLastBlock": Number, // Milliseconds since the last block was mined relative to when this data was computed
    "blockPrices": [
        {
            "blockNumber": Number, // Block this prediction is for
            "estimatedTransactionCount": Number, // Number of items we estimate will be included in next block based on mempool snapshot
            "baseFeePerGas": 1, // Base fee per gas for current block in gwei
            "blobBaseFeePerGas": Number // Base fee per gas for blobs for current block in gwei.
            "estimatedPrices": [
                {
                    "confidence": Number, // 0-99 likelihood the next block will contain a transaction with a gas price >= to the listed price
                    "price": Number, // Price in gwei
                    "maxPriorityFeePerGas": Number, // Max priority fee per gas in gwei
                    "maxFeePerGas": Number, // Max fee per gas in gwei
                },
                ...,
            ]
        }
    ]
}
javascript
{
    "msg": "Optional authorization header must contain a valid apikey"
}
null
{ "msg":"Too Many Requests" }
null

Query Parameters

NameTypeDescription
confidenceLevelsinteger

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)

chainidintegerThe network chain ID. Default is 1 (Ethereum Mainnet).
systemstringThe chain ecosystem (e.g., "ethereum", "story", "polygon", etc.)
networkstringThe specific network within the system (e.g., "mainnet", "sepolia" etc.). To know which parameters to use, refer to the list under /chains .

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

TermDescription
maxPriceHighest priced transaction in the mempool.
currentBlockNumberBlock number at the time of prediction.
msSinceLastBlockMilliseconds since the last block was mined relative to when data was computed.
blockNumberBlock this prediction is for.
estimatedTransaction CountNumber of items we estimate will be included in next block based on mempool snapshot.
baseFeePerGasBase 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).
blobBaseFeePerGasBase 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 -> confidenceThe likelihood the next block will contain a transaction with a price >= to the listed price.
estimatedPrices -> pricePrice in Gwei (used for type0 transactions: Pre EIP-1559).
estimatedPrices -> maxPriorityFeePerGasMax priority fee per gas in gwei also known as the "tip" (used for type2 transactions: EIP-1559).
estimatedPrices -> maxFeePerGasMax 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.