Ethereum Gas API
This API provides latest and historical gas prices for the Ethereum network and various layer 2 solutions, like Arbitrum, Optimism and Base.
API Access Unlock all features in a simple, transparent package.
- 1 API Key for full access
- All endpoints
- Unlimited requests (fair use)
- All networks
Supported networks
- Ethereum Mainnet (default)
- Arbitrum
- Optimism
- Base
All endpoints can be appended with any of the supported networks (lower case) e.g.
- https://www.ethgastracker.com/api/gas/latest/base
Endpoints
The base uri for the API is https://www.ethgastracker.com/api
.
/gas/latest
or/gas/latest/[network]
- Get the latest gas prices and block utilization.Response
{ "data": { "network": "mainnet", "blockNr": "20511000", "timestamp": 1723447187, "ethPrice": 2572, "baseFee": 1496748429, "nextFee": 1503379486, "difference": 0, "block": { "gasLimit": 30000000, "gasUsed": 15531637, "utilization": 52, "transactionCount": 150 }, "oracle": { "slow": { "gasFee": 1503734329, "priorityFee": 354843, "gwei": 1.5 }, "normal": { "gasFee": 2322253240, "priorityFee": 818873754, "gwei": 2.32 }, "fast": { "gasFee": 3403588273, "priorityFee": 1900208787, "gwei": 3.4 } }, "lastUpdate": 1723453159371 } }
/gas/[blockNr]
or/gas/[blockNr]/[network]
- Get the gas prices for a specific block. Only supports blocks since EIP-1559.Response same as /latest
{ "data": { "network": "mainnet", "blockNr": "20511000", "timestamp": 1723447187, "ethPrice": 2572, "baseFee": 1496748429, "nextFee": 1503379486, "difference": 0, "block": { "gasLimit": 30000000, "gasUsed": 15531637, "utilization": 52, "transactionCount": 150 }, "oracle": { "slow": { "gasFee": 1503734329, "priorityFee": 354843, "gwei": 1.5 }, "normal": { "gasFee": 2322253240, "priorityFee": 818873754, "gwei": 2.32 }, "fast": { "gasFee": 3403588273, "priorityFee": 1900208787, "gwei": 3.4 } }, "lastUpdate": 1723453159371 } }
/gas/history
or/gas/history/[network]
- Get the gas prices of the latest x number of blocks (50 by default).Response
{ "data": { "network": "mainnet", "blocks": [ { "blockNr": 20504260, "baseFee": 0.8, "txCount": 59, "min": 0.8, "max": 502, "avg": 32.7, "median": 2.0549999999999997, "ethPrice": 2681.275, "gasLimit": 30000000, "gasUsed": 29982569, "date": "2024-08-11T08:44:35.000Z", "timestamp": 1723365875 }, { "blockNr": 20504259, "baseFee": 0.87, "txCount": 58, "min": 0.87, "max": 502, "avg": 33.88, "median": 2.05, "ethPrice": 2681.275, "gasLimit": 30000000, "gasUsed": 5120176, "date": "2024-08-11T08:44:23.000Z", "timestamp": 1723365863 }, ], "lastUpdate": 1723369133230 } }
/gas/average
or/gas/average/[network]
- Gets the hourly average gas prices of the past week.Response
{ "data": { "network": "mainnet", "data": [ { "period": "2024-08-11T08:00:00+00:00", "baseFee": 0.9648648648648648, "gasLimit": 30000263.91891892, "gasUsed": 15137036.274774775, "txCount": 93.79, "min": 0.9805855855855856, "max": 1.9805855855855856, "median": 2.070743243243243, "ethPrice": 2679.635518018018 }, { "period": "2024-08-11T07:00:00+00:00", "baseFee": 0.9125838926174497, "gasLimit": 30000000, "gasUsed": 15264319.5, "txCount": 90.35833333333333, "min": 0.9273154362416106, "max": 1.9273154362416106, "median": 1.7994295302013423, "ethPrice": 2672.2797483221475 }, ], "lastUpdate": 1723369158692 } }
ETH Gas Tracker helps you discover how gas works, why it matters and help you set optimal gas fees to use the Ethereum network more efficiently. Get real-time gas prices, historical data, and average fees to time your transactions and save money. Ethereum Gas Tracker is the best way to track gas prices and provides an API for developers to integrate gas data into their applications. Learn more about Ethereum Gas.