eth_feeHistory RPC Method
The eth_feeHistory
method provides historical gas fee stats over a range of recent blocks on the Base Mainnet.
It’s especially useful for fee estimation and analyzing how the network’s base fee and priority fees change over time.
✅ Great for building gas estimators
✅ Helps track congestion and baseFee trends
Need RPC API keys?
Get 12.5M archival requests for free today.
🔧 Parameters
blockCount
(required)
Number of blocks in the requested range — can be a string or integer.
🔹 Must be between 1 and 1024.
newestBlock
(required)
The highest block in the range.
Use a block number or one of the tags: "latest"
, "pending"
, "earliest"
.
View block tag documentation (opens in a new tab)
rewardPercentiles
(optional)
A list of percentiles (e.g. [20, 50, 95]
) used to sample effective priority fees per gas from each block.
Percentiles must be:
- Monotonically increasing
- Integers between 0 and 100
📥 Returns
oldestBlock
— The block number at the start of the range (hex)baseFeePerGas
— Array of base fees for each block + 1 future blockgasUsedRatio
— Ratio of gas used per block (0–1 float)reward
(ifrewardPercentiles
provided) — Arrays of effective priority fees per block. Empty blocks return zeroes.
📤 Request
POST https://base-mainnet.chainnodes.org/YOUR-API-KEY
✅ Replace YOUR-API-KEY
with your API key from the CHAINNODES Dashboard (opens in a new tab).
✅ You can substitute base-mainnet
with another supported network if needed.
📦 Example
💡 Confusing?
Ask our experienced blockchain developers in Telegram
curl https://base-mainnet.chainnodes.org/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_feeHistory",
"params": ["0x8", "earliest", [20,25]],
"id":1
}'
📘 Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"oldestBlock": "0x0",
"reward": [
[
"0x0",
"0x0"
]
],
"baseFeePerGas": [
"0x0",
"0x0"
],
"gasUsedRatio": [
0
]
}
}