Returns historical gas fee data for a range of blocks, including base fees and priority fees at specified percentiles.
eth_feeHistory
JSON-RPC method returns historical gas fee data for a range of blocks. This method provides essential information for gas price estimation, including base fees, gas usage ratios, and priority fee percentiles.
blockCount
(string, required) — Number of blocks in the requested range as a hexadecimal string (maximum 1024)newestBlock
(string, required) — Block identifier: "latest"
, "earliest"
, "pending"
, or a specific block number in hexadecimalrewardPercentiles
(array, optional) — Array of percentile values (0-100) for priority fee rewardsoldestBlock
— The oldest block number in the range as a hexadecimal stringbaseFeePerGas
— Array of base fees per gas for each block (including one extra for the next block)gasUsedRatio
— Array of gas used ratios for each block (0.0 to 1.0)reward
— Array of priority fee rewards at specified percentiles for each blocketh_maxPriorityFeePerGas
always returns zeroeth_feeHistory
method is essential for applications that need to:
eth_maxPriorityFeePerGas
always returns zero). Fee history data reflects past network conditions and may not predict future fees accurately during periods of high volatility. Focus on base fee analysis for gas price optimization.Successful response with historical fee data
The response is of type object
.