# Table of Contents - [Overview | Blocknative Documentation](#overview-blocknative-documentation) - [Overview | Blocknative Documentation](#overview-blocknative-documentation) - [Gas Platform | Blocknative Documentation](#gas-platform-blocknative-documentation) - [Gas Price API | Blocknative Documentation](#gas-price-api-blocknative-documentation) - [Prediction API - Base Fee and Blob Fee | Blocknative Documentation](#prediction-api-base-fee-and-blob-fee-blocknative-documentation) - [Gas Distribution API | Blocknative Documentation](#gas-distribution-api-blocknative-documentation) --- # Overview | Blocknative Documentation Blocknative delivers over 600 gas estimates per second. Our gas platform is trusted by leading protocols, wallets, L1s and L2s, and more to help estimate, predict, optimize, and decision. We are bringing gas markets onchain with [Gas Network.](https://gas.network/) For Gas, Blocknative offers: * **Gas Fee Estimation:** [Estimate Gas Prices](https://docs.blocknative.com/gas-prediction) needed for your transactions to get on-chain with real-time precision. Available for over 40 chains, including Ethereum, Bitcoin, Optimism, Arbitrum, Base, Polygon, and [Sei](https://seigas.com/) . More chains coming soon. * **Gas Prediction:** Predict the Base fee and Blob Fee * **Gas Estimator:** Available as a [webpage](https://gas.blocknative.com/) or [browser extension](https://www.blocknative.com/gas-extension) to help price your transactions. * **On Chain Oracles:** Coming soon via [Gas Network](https://gas.network/) . We strive to create a world-class developer experience, so [join our Discord](https://discord.gg/KZaBVME) to ask any questions, provide feedback, and tell us what else you want from Blocknative. Last updated 10 days ago Was this helpful? Was this helpful? --- # Overview | Blocknative Documentation Blocknative delivers over 600 gas estimates per second. Our gas platform is trusted by leading protocols, wallets, L1s and L2s, and more to help estimate, predict, optimize, and decision. We are bringing gas markets onchain with [Gas Network.](https://gas.network/) For Gas, Blocknative offers: * **Gas Fee Estimation:** [Estimate Gas Prices](https://docs.blocknative.com/gas-prediction) needed for your transactions to get on-chain with real-time precision. Available for over 40 chains, including Ethereum, Bitcoin, Optimism, Arbitrum, Base, Polygon, and [Sei](https://seigas.com/) . More chains coming soon. * **Gas Prediction:** Predict the Base fee and Blob Fee * **Gas Estimator:** Available as a [webpage](https://gas.blocknative.com/) or [browser extension](https://www.blocknative.com/gas-extension) to help price your transactions. * **On Chain Oracles:** Coming soon via [Gas Network](https://gas.network/) . We strive to create a world-class developer experience, so [join our Discord](https://discord.gg/KZaBVME) to ask any questions, provide feedback, and tell us what else you want from Blocknative. Last updated 10 days ago Was this helpful? Was this helpful? --- # Gas Platform | Blocknative Documentation The Blocknative Gas Platform is a set of APIs that accurately price transactions to get them on-chain faster, for less. Simply integrate the API into your protocol, dapp, wallet, or bot to get started. [](https://docs.blocknative.com/gas-prediction#the-blocknative-difference) The Blocknative Difference ---------------------------------------------------------------------------------------------------------- The Gas Platform is the industry's most precise tool for predicting gas prices. Unlike other solutions relying solely on on-chain data, Blocknative leverages real-time mempool data when accessible and predictive modeling to forecast gas price distribution and the gas price required for inclusion in the next block or next ∼10 seconds, depending on the chain. Blocknative confidently prices your user's transactions for the transaction execution speed desired based on the current pressure in the mempool: * **Based on** [**quantile regression model**](https://www.blocknative.com/blog/base-fee-prediction-and-intelligent-max-fee) : optimized for accurate and consistent prediction of the minimum marketable gas price for either the next block or the next ∼10 seconds, depending on the chain. * **Accurately predicting** _**minimum**_ **gas price:** Prediction models must measure the validity of their results against the ground truth of confirmed blocks. * **Avoiding over paying:** Confidence in predicting sufficient gas price to be included in the next block must be balanced against over paying. _Our goal is to be as close as possible, but not below, the minimum gas price of the next block_. * **User control:** Since different users have different degrees of urgency for getting transactions into the next block, we provide a range of confidence levels for next-block inclusion. [](https://docs.blocknative.com/gas-prediction#apis-available) APIs Available ---------------------------------------------------------------------------------- Three gas APIs are available to integrate into your protocol, dapp, or bot: * The [Gas Price API](https://docs.blocknative.com/gas-prediction/gas-platform) provides precise, real-time calculations required for next-block or next ∼10 seconds confirmation, depending on the chain. Available for Ethereum, Polygon, Bitcoin, SEI, Optimism, Arbitrum, Base and others. * The [Base Fee Prediction API](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee) provides both type-2 base fee and type-3 blob base fee prediction 5 blocks into the future. Available for Ethereum. * The [Gas Distribution API](https://docs.blocknative.com/gas-prediction/gas-distribution-api) provides the distribution of gas prices in the mempool at that moment in time. Available for Ethereum. The use of these endpoints requires an API key. Request an API key [here](https://www.blocknative.com/request-api-key) . Last updated 10 months ago Was this helpful? * [The Blocknative Difference](https://docs.blocknative.com/gas-prediction#the-blocknative-difference) * [APIs Available](https://docs.blocknative.com/gas-prediction#apis-available) Was this helpful? --- # Gas Price API | Blocknative Documentation 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. [](https://docs.blocknative.com/gas-prediction/gas-platform#gas-platform-currently-supports-the-following-networks) Gas Platform currently supports the following networks ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Click on any `chainID` in the table below to access the corresponding API. **43 chains** currently supported. Name Network Chain ID Arbitrum One main [42161](https://api.blocknative.com/gasprices/blockprices?chainid=42161) Avalanche main [43114](https://api.blocknative.com/gasprices/blockprices?chainid=43114) Base main [8453](https://api.blocknative.com/gasprices/blockprices?chainid=8453) Berachain main [80094](https://api.blocknative.com/gasprices/blockprices?chainid=80094) Bitcoin main [0](https://api.blocknative.com/gasprices/blockprices?chainid=0) Blast main [81457](https://api.blocknative.com/gasprices/blockprices?chainid=81457) Bob main [60808](https://api.blocknative.com/gasprices/blockprices?chainid=60808) BSC (BNB Smart Chain) main [56](https://api.blocknative.com/gasprices/blockprices?chainid=56) Chiliz main [88888](https://api.blocknative.com/gasprices/blockprices?chainid=88888) Cronos main [25](https://api.blocknative.com/gasprices/blockprices?chainid=25) Ethereum main [1](https://api.blocknative.com/gasprices/blockprices?chainid=1) Fraxtal main [252](https://api.blocknative.com/gasprices/blockprices?chainid=252) Gnosis main [100](https://api.blocknative.com/gasprices/blockprices?chainid=100) HyperEVM main [999](https://api.blocknative.com/gasprices/blockprices?chainid=999) Immutable zkEVM main [13371](https://api.blocknative.com/gasprices/blockprices?chainid=13371) Ink main [57073](https://api.blocknative.com/gasprices/blockprices?chainid=57073) Lens main [232](https://api.blocknative.com/gasprices/blockprices?chainid=232) Linea main [59144](https://api.blocknative.com/gasprices/blockprices?chainid=59144) Lisk main [1135](https://api.blocknative.com/gasprices/blockprices?chainid=1135) Mantle main [5000](https://api.blocknative.com/gasprices/blockprices?chainid=5000) Metis main [1088](https://api.blocknative.com/gasprices/blockprices?chainid=1088) Mode main [34443](https://api.blocknative.com/gasprices/blockprices?chainid=34443) Moonbeam main [1284](https://api.blocknative.com/gasprices/blockprices?chainid=1284) opBNB main [204](https://api.blocknative.com/gasprices/blockprices?chainid=204) Optimism main [10](https://api.blocknative.com/gasprices/blockprices?chainid=10) Palm main [11297108109](https://api.blocknative.com/gasprices/blockprices?chainid=11297108109) Polygon main [137](https://api.blocknative.com/gasprices/blockprices?chainid=137) Polygon zkEVM main [1101](https://api.blocknative.com/gasprices/blockprices?chainid=1101) Ronin main [2020](https://api.blocknative.com/gasprices/blockprices?chainid=2020) Rootstock main [30](https://api.blocknative.com/gasprices/blockprices?chainid=30) Scroll main [534352](https://api.blocknative.com/gasprices/blockprices?chainid=534352) SEI pacific-1 [1329](https://api.blocknative.com/gasprices/blockprices?chainid=1329) Snax Chain main [2192](https://api.blocknative.com/gasprices/blockprices?chainid=2192) Soneium main [1868](https://api.blocknative.com/gasprices/blockprices?chainid=1868) Sonic main [146](https://api.blocknative.com/gasprices/blockprices?chainid=146) Story main [1514](https://api.blocknative.com/gasprices/blockprices?chainid=1514) Swell main [1923](https://api.blocknative.com/gasprices/blockprices?chainid=1923) Taiko main [167000](https://api.blocknative.com/gasprices/blockprices?chainid=167000) Unichain main [130](https://api.blocknative.com/gasprices/blockprices?chainid=130) World Chain main [480](https://api.blocknative.com/gasprices/blockprices?chainid=480) ZetaChain main [7000](https://api.blocknative.com/gasprices/blockprices?chainid=7000) Zircuit main [48900](https://api.blocknative.com/gasprices/blockprices?chainid=48900) ZKsync main [324](https://api.blocknative.com/gasprices/blockprices?chainid=324) Zora main [7777777](https://api.blocknative.com/gasprices/blockprices?chainid=7777777) You can view [an introductory video on Gas Platform here](https://youtu.be/_Szpb1GTQ6k) . Looking for a network that's not currently supported? Let us know by using our contact form [here](https://www.blocknative.com/contact-us) . [](https://docs.blocknative.com/gas-prediction/gas-platform#authentication) Authentication ----------------------------------------------------------------------------------------------- A valid Blocknative API key is OPTIONAL in the `Authorization` Header of every request. Request an API key [here](https://www.blocknative.com/request-api-key) . A free API key is recommended for more generous rate limits and future features. [](https://docs.blocknative.com/gas-prediction/gas-platform#api-endpoint) 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. [](https://docs.blocknative.com/gas-prediction/gas-platform#rate-limits) 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. [](https://docs.blocknative.com/gas-prediction/gas-platform#request) Request --------------------------------------------------------------------------------- ### [](https://docs.blocknative.com/gas-prediction/gas-platform#example-request) Example request _This will provide Ethereum Mainnet estimates across all confidence levels by_ _**default**__._ Or without the optional apikey ### [](https://docs.blocknative.com/gas-prediction/gas-platform#example-using-chainid) Example using `ChainID` ### [](https://docs.blocknative.com/gas-prediction/gas-platform#example-using-system-and-network-parameters) Example using `System` and `Network` parameters _To know which parameters to use, refer to the list under_ [`_/chains_`](https://api.blocknative.com/chains) _._ ### [](https://docs.blocknative.com/gas-prediction/gas-platform#example-using-custom-confidence-level-request) Example using custom `confidence` level request An alternative format for confidence levels is ### [](https://docs.blocknative.com/gas-prediction/gas-platform#example-response-payload) Example Response Payload Name Type Description Authorization string OPTIONAL if used, must contain a valid apikey 200 Success 401 Key invalid or not provided 429 Rate limit exceeded. Refer to the headers for when to retry the request. ### [](https://docs.blocknative.com/gas-prediction/gas-platform#query-parameters) Query Parameters Name Type Description 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). system string The chain ecosystem (e.g., `"ethereum"`, `"story"`, `"polygon"`, etc.) network string The specific network within the system (e.g., `"mainnet"`, `"sepolia"` etc.). To know which parameters to use, refer to the list under [`/chains`](https://api.blocknative.com/chains) . ### [](https://docs.blocknative.com/gas-prediction/gas-platform#type0-and-type2-transactions) 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` . [](https://docs.blocknative.com/gas-prediction/gas-platform#description-of-terms) Description of Terms ----------------------------------------------------------------------------------------------------------- Term Description 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 4 months ago Was this helpful? * [Gas Platform currently supports the following networks](https://docs.blocknative.com/gas-prediction/gas-platform#gas-platform-currently-supports-the-following-networks) * [Authentication](https://docs.blocknative.com/gas-prediction/gas-platform#authentication) * [API Endpoint](https://docs.blocknative.com/gas-prediction/gas-platform#api-endpoint) * [Rate Limits](https://docs.blocknative.com/gas-prediction/gas-platform#rate-limits) * [Request](https://docs.blocknative.com/gas-prediction/gas-platform#request) * [Example request](https://docs.blocknative.com/gas-prediction/gas-platform#example-request) * [Example using ChainID](https://docs.blocknative.com/gas-prediction/gas-platform#example-using-chainid) * [Example using System and Network parameters](https://docs.blocknative.com/gas-prediction/gas-platform#example-using-system-and-network-parameters) * [Example using custom confidence level request](https://docs.blocknative.com/gas-prediction/gas-platform#example-using-custom-confidence-level-request) * [Example Response Payload](https://docs.blocknative.com/gas-prediction/gas-platform#example-response-payload) * [Header](https://docs.blocknative.com/gas-prediction/gas-platform#header) * [Query Parameters](https://docs.blocknative.com/gas-prediction/gas-platform#query-parameters) * [Type0 and Type2 Transactions](https://docs.blocknative.com/gas-prediction/gas-platform#type0-and-type2-transactions) * [Description of Terms](https://docs.blocknative.com/gas-prediction/gas-platform#description-of-terms) Was this helpful? Copy curl -H 'Authorization: optional-apikey-here' 'https://api.blocknative.com/gasprices/blockprices' Copy curl 'https://api.blocknative.com/gasprices/blockprices' Copy curl 'https://api.blocknative.com/gasprices/blockprices?chainid=1514' Copy curl 'https://api.blocknative.com/gasprices/blockprices?system=story&network=mainnet' Copy curl -H 'Authorization: optional-apikey-here' 'https://api.blocknative.com/gasprices/blockprices?chainid=1&confidenceLevels=50&confidenceLevels=70&confidenceLevels=80&confidenceLevels=90&confidenceLevels=99' Copy curl -H 'Authorization: optional-apikey-here' 'https://api.blocknative.com/gasprices/blockprices?chainid=1&confidenceLevels=50,70,80,90,99' Copy { "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\ }\ ]\ }\ ] } Copy { "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\ },\ ...,\ ]\ }\ ] } Copy { "msg": "Optional authorization header must contain a valid apikey" } Copy { "msg":"Too Many Requests" } --- # Prediction API - Base Fee and Blob Fee | Blocknative Documentation The Blocknative API provides real-time predictions for both the **base fee** and the **blob base fee** on the Ethereum network. These predictions assist users in setting optimal gas fees for transactions, ensuring timely confirmations without overpaying. Predictions are made for the next 5 blocks at a 99% confidence level (highest inclusion guarantee at the expense of some overpayment) and 50% confidence level (likely inclusion with reduced overpayment). [](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#authentication) Authentication ----------------------------------------------------------------------------------------------------------------------- Use of this endpoint requires an API key for proper authorization. Request an API key [here](https://www.blocknative.com/request-api-key) . [](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#api-endpoint) API Endpoint ------------------------------------------------------------------------------------------------------------------- `GET` `https://api.blocknative.com/gasprices/basefee-estimates` Returns a range of confidence intervals for gas prices needed to qualify a transaction for inclusion in the next block. Order of confidence intervals is subject to change. [](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#fields) Fields ------------------------------------------------------------------------------------------------------- Each payload contains header fields followed by base fee predictions for the next 5 blocks after the current pending block. ### [](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#header-fields) Header Fields Field Name Description system Type of chain (EVM = “ethereum”) network Name of network (chain id 1 = “main”) unit Type of unit for fee values (currently all fee values are in gwei) currentBlockNumber Block number at time of prediction msSinceLastBlock Time, in milliseconds, since last block (i.e. how far into slot time) baseFeePerGas **Base fee** for current pending block blobBaseFeePerGas **Blob base fee** for current pending block estimatedBaseFees Future pending block estimates (see below) ### [](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#estimate-fields) Estimate Fields Field Name Description **pending+n** Future pending block for the estimate (current n = 1…5). This is the pending block after the current pending block. The base fee and blob base fee for the current pending block is already fixed and included in the header. **confidence** Indicates how likely predictions are to being greater than or equal to the actual **base fee or blob base fee** for that future block number. For example the 99% confidence level attempts to make a prediction that is greater than or equal to the actual base fees 99% of the time, while minimizing the gap between the prediction and actual fee. And the 70% confidence level attempts to make a prediction that is greater than or equal to the actual base fees 70% of the time, while minimizing the gap between the prediction and actual fee. Therefore, the 99% confidence level will always make a prediction that is higher than the 70% confidence level in order to achieve its 99% confidence. **baseFee** The estimated base fee at the specified confidence level for the specified future pending block. **blobBaseFee** The estimated blob base fee at the specified confidence level for the specified future pending block. ### [](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#example-request) Example Request ### [](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#example-response) Example Response The response payload contains the predictions for the **base fee** and **blob base fee** for the current pending block + X where X can be 1 through 5. [](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#questions) Questions ------------------------------------------------------------------------------------------------------------- If you have any questions, please [reach out to Blocknative](https://www.blocknative.com/contact-us-l2-l1) . Last updated 1 year ago Was this helpful? * [Authentication](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#authentication) * [API Endpoint](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#api-endpoint) * [Fields](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#fields) * [Header Fields](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#header-fields) * [Estimate Fields](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#estimate-fields) * [Example Request](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#example-request) * [Example Response](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#example-response) * [Questions](https://docs.blocknative.com/gas-prediction/prediction-api-base-fee-and-blob-fee#questions) Was this helpful? Copy curl -H "X-Api-Key: " "" Copy { "system": "ethereum", "network": "main", "unit": "gwei", "currentBlockNumber": 19577777, "msSinceLastBlock": 6672, "baseFeePerGas": 31.004192998, "blobBaseFeePerGas": 0.028263001, "estimatedBaseFees": [\ {\ "pending+1": [\ {\ "confidence": 99,\ "baseFee": 34.75,\ "blobBaseFee": 0.031795876\ },\ {\ "confidence": 70,\ "baseFee": 30.74,\ "blobBaseFee": 0.031795876\ }\ ]\ },\ {\ "pending+2": [\ {\ "confidence": 99,\ "baseFee": 34.7,\ "blobBaseFee": 0.035770362\ },\ {\ "confidence": 70,\ "baseFee": 30.36,\ "blobBaseFee": 0.035770362\ }\ ]\ },\ {\ "pending+3": [\ {\ "confidence": 99,\ "baseFee": 35.28,\ "blobBaseFee": 0.040241657\ },\ {\ "confidence": 70,\ "baseFee": 30.35,\ "blobBaseFee": 0.040241657\ }\ ]\ },\ {\ "pending+4": [\ {\ "confidence": 99,\ "baseFee": 36.25,\ "blobBaseFee": 0.045271865\ },\ {\ "confidence": 70,\ "baseFee": 30.55,\ "blobBaseFee": 0.045271865\ }\ ]\ },\ {\ "pending+5": [\ {\ "confidence": 99,\ "baseFee": 37.09,\ "blobBaseFee": 0.050930849\ },\ {\ "confidence": 70,\ "baseFee": 30.48,\ "blobBaseFee": 0.050930849\ }\ ]\ }\ ] } --- # Gas Distribution API | Blocknative Documentation The Blocknative Gas Distribution API gives you the distribution and breakdown of gas prices in the mempool at that moment in time. [](https://docs.blocknative.com/gas-prediction/gas-distribution-api#authentication) Authentication ------------------------------------------------------------------------------------------------------- A valid Blocknative API key is required in the `Authorization` Header of every request. Request an API key [here](https://www.blocknative.com/request-api-key) . [](https://docs.blocknative.com/gas-prediction/gas-distribution-api#rate-limits) 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. [](https://docs.blocknative.com/gas-prediction/gas-distribution-api#api-endpoint) 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. ### [](https://docs.blocknative.com/gas-prediction/gas-distribution-api#query-parameters) 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. ### [](https://docs.blocknative.com/gas-prediction/gas-distribution-api#headers) Headers Name Type Description Authorization string Valid paid tier apikey 200 Success 401 Key invalid or not provided 429 Rate limit exceeded. Refer to the headers for when to retry the request. Copy { "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 } } Copy { "msg": "Authorization header must contain a valid apikey" } Pending transactions unlikely to be included in the next block due to poor nonce ordering are not included in distribution data ### [](https://docs.blocknative.com/gas-prediction/gas-distribution-api#example-request) Example request ### [](https://docs.blocknative.com/gas-prediction/gas-distribution-api#example-response) Example Response Last updated 9 months ago Was this helpful? * [Authentication](https://docs.blocknative.com/gas-prediction/gas-distribution-api#authentication) * [Rate Limits](https://docs.blocknative.com/gas-prediction/gas-distribution-api#rate-limits) * [API Endpoint](https://docs.blocknative.com/gas-prediction/gas-distribution-api#api-endpoint) * [Query Parameters](https://docs.blocknative.com/gas-prediction/gas-distribution-api#query-parameters) * [Headers](https://docs.blocknative.com/gas-prediction/gas-distribution-api#headers) * [Example request](https://docs.blocknative.com/gas-prediction/gas-distribution-api#example-request) * [Example Response](https://docs.blocknative.com/gas-prediction/gas-distribution-api#example-response) Was this helpful? Copy { "msg": "Too Many Requests" } Copy curl -H "Authorization: your-apikey-here" https://api.blocknative.com/gasprices/distribution Copy { "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 } } ---