Blocknative Documentation
  • Overview
  • Gas Platform
    • Gas Price API
    • Chains API
    • Oracles API
    • Prediction API - Base Fee and Blob Fee
    • Gas Distribution API
  • Gas Fee Estimator
  • Data Archive
    • Mempool Archive
  • Gas Network
  • Discord
  • Github
Powered by GitBook
On this page
  • Authentication
  • Rate Limits
  • API Endpoint
  • Query Parameters
  • Headers
  • Example request
  • Example Response

Was this helpful?

  1. Gas Platform

Gas Distribution API

Analysis of public pending gas price distributions.

PreviousPrediction API - Base Fee and Blob FeeNextGas Fee Estimator

Last updated 2 months ago

Was this helpful?

The Blocknative Gas Distribution API gives you the distribution and breakdown of gas prices in the mempool at that moment in time.

Authentication

A valid Blocknative API key is required in the Authorization Header of every request. Request an API key .

Rate Limits

Each endpoint is limited to provide updated results each second for paid tier API keys, or every 5 seconds for free tier API keys. Polling faster than these rates may deliver stale data.

API Endpoint

GET https://api.blocknative.com/gasprices/distribution

Get the gas prices of the highest n transactions eligible for inclusion in the next block. If n is not specified, it defaults to number of expected transactions in the next block.

Query Parameters

Name
Type
Description

chainid

integer

The ID of the chain from which gas data is being requested. Currently only Ethereum mainnet (chaind=1 and the default) is supported.

Headers

Name
Type
Description

Authorization

string

Valid paid tier apikey

{
    "system": "ethereum",
    "network": "main",
    "unit": "gwei",
    "maxPrice": Number, // Highest priced transaction eligible for inclusion in next block
    "currentBlockNumber": Number, // Block number at moment in time
    "msSinceLastBlock": Number, // Milliseconds since last block at time of capture
    "topNDistribution": {
        "distribution": [ // List of tuples [(price,count), ...], ordered by price
            [
                Number, // Price in "unit"
                Number // Transaction count with this price
            ],
            ...,
        ],
        "n": Number // Top N priced pending transactions included in this distribution
    }
}
{
    "msg": "Authorization header must contain a valid apikey"
}
{ "msg": "Too Many Requests" }

Pending transactions unlikely to be included in the next block due to poor nonce ordering are not included in distribution data

Example request

curl -H "Authorization: your-apikey-here" https://api.blocknative.com/gasprices/distribution

Example Response

{
  "system": "ethereum",
  "network": "main",
  "unit": "gwei",
  "maxPrice": 26,
  "currentBlockNumber": 19720652,
  "msSinceLastBlock": 9775,
  "topNDistribution": {
    "distribution": [
      [15, 2],
      [14.162957017, 1],
      [11, 1],
      [7, 1],
      [5.162957017, 1],
      [5, 10],
      [4.162957017, 4],
      [4, 3],
      [3.162957017, 5],
      [3, 9],
      [2.162957017, 1],
      [2, 15],
      [1.162957017, 5],
      [1, 11],
      [0.194403241, 1],
      [0.162957017, 5]
    ],
    "n": 128
  }
}
here