Appearance
eth_feeHistory
served · same as reth
Returns the base fees, the gas use and the tips of a range of recent blocks.
When to use
Use it to choose fees for an EIP-1559 transaction from recent blocks, or to chart fees.
Example
bash
curl -s -X POST -H 'Content-Type: application/json' \
--data '{"jsonrpc": "2.0", "id": 1, "method": "eth_feeHistory", "params": ["0x4", "0x18facad", [25, 75]]}' \
http://127.0.0.1:8547json
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_feeHistory",
"params": [
"0x4",
"0x18facad",
[
25,
75
]
]
}Response
Live mainnet, block 26193069, 2026-10-14. Checked against reth 2.7: equal.
json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"oldestBlock": "0x18facaa",
"baseFeePerGas": [
"0xacf6fbc",
"0x9a8a5d0",
"0xaa059a2",
"... 2 more items"
],
"gasUsedRatio": [
0.07391793333333334,
0.900708,
0.5795100333333333,
"... 1 more items"
],
"baseFeePerBlobGas": [
"0x98fbf8",
"0x98fbf8",
"0x9a21f2",
"... 2 more items"
],
"blobGasUsedRatio": [
0.0,
0.09523809523809523,
0.2857142857142857,
"... 1 more items"
],
"reward": [
[
"0x55ea",
"0x145d1fa3"
],
[
"0x4f74bf2",
"0x23c34600"
],
[
"0x8f8e25",
"0xa9cf568"
],
"... 1 more items"
]
}
}The answer changes with time, so it is compared by shape (keys and types; for a list, its first item), not by value.
Parameters
| Name | Type | Required | Meaning |
|---|---|---|---|
blockCount | number, hex or decimal | yes | How many blocks. More than 1 024 counts as 1 024. |
newestBlock | block number in hex, or a tag, see Block parameter | yes | The last block of the range. |
rewardPercentiles | list of numbers from 0 to 100 | no | For each block, the tip at each of these percentiles of gas use. The list must increase. At most 100 values. |
Returns
An object. oldestBlock is the first block. baseFeePerGas and baseFeePerBlobGas have one item per block plus one for the next block. gasUsedRatio and blobGasUsedRatio have one item per block. reward has one list of tips per block, when you ask for percentiles.
Notes and limits
- The tips need the transactions and receipts of each block. The node keeps them from its first block (the
earliesttag). The base fees and the gas use come from the headers, which the node can keep for a few more blocks before that. - Without percentiles,
rewardhas one empty list per block for the last 1 123 blocks. For an older range it has no item, as in reth. - A
blockCountof 0 returnsgasUsedRatioas an empty list andoldestBlockas0x0, before any other check, as in reth.
Errors
| Code | Message | When |
|---|---|---|
| -32602 | request beyond head block: requested N, head M | newestBlock is above the head. |
| -32602 | invalid reward percentiles | A percentile is outside 0 to 100, or the list does not increase, or there are more than 100 values. |
| -32602 | Invalid params | A parameter is missing or does not parse. data has the text of reth, with the position. |
| 4444 | pruned history unavailable: requested N, earliest available M | The range has blocks below the first block of the node (with percentiles) or below its first header (without). N is the first block of the range. |
Compared with reth
The live example above gives the same answer on Cinder and on reth 2.7.
Related methods
eth_gasPrice, eth_maxPriorityFeePerGas, eth_blobBaseFee.
Schema (OpenRPC)
The official specification: eth_feeHistory in ethereum/execution-apis.
Parameter blockCount: string
json
{
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "hex encoded unsigned integer",
"type": "string"
}Parameter newestBlock: Block number or Block tag
json
{
"oneOf": [
{
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "Block number",
"type": "string"
},
{
"description": "`earliest`: The lowest numbered block the client has available; `finalized`: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; `safe`: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; `latest`: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; `pending`: A sample next block built by the client on top of `latest` and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for `finalized` or `safe` block MUST be responded to with `-39001: Unknown block` error",
"enum": [
"earliest",
"finalized",
"safe",
"latest",
"pending"
],
"title": "Block tag",
"type": "string"
}
],
"title": "Block number or tag"
}Parameter rewardPercentiles: number[]
json
{
"items": {
"description": "Floating point value between 0 and 100.",
"title": "rewardPercentile",
"type": "number"
},
"title": "rewardPercentiles",
"type": "array"
}Result: object
json
{
"additionalProperties": false,
"description": "Fee history results.",
"properties": {
"baseFeePerBlobGas": {
"description": "An array of block base fees per blob gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-4844 blocks.",
"items": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "hex encoded unsigned integer",
"type": "string"
},
"title": "baseFeePerBlobGasArray",
"type": "array"
},
"baseFeePerGas": {
"description": "An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.",
"items": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "hex encoded unsigned integer",
"type": "string"
},
"title": "baseFeePerGasArray",
"type": "array"
},
"blobGasUsedRatio": {
"description": "An array of block blob gas used ratios. These are calculated as the ratio of blobGasUsed and the max blob gas per block.",
"items": {
"maximum": 1,
"minimum": 0,
"title": "normalized ratio",
"type": "number"
},
"title": "blobGasUsedRatio",
"type": "array"
},
"gasUsedRatio": {
"description": "An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.",
"items": {
"maximum": 1,
"minimum": 0,
"title": "normalized ratio",
"type": "number"
},
"title": "gasUsedRatio",
"type": "array"
},
"oldestBlock": {
"description": "Lowest number block of returned range.",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "oldestBlock",
"type": "string"
},
"reward": {
"description": "A two-dimensional array of effective priority fees per gas at the requested block percentiles.",
"items": {
"description": "An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.",
"items": {
"description": "A given percentile sample of effective priority fees per gas from a single block in ascending order, weighted by gas used. Zeroes are returned if the block is empty.",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "rewardPercentile",
"type": "string"
},
"title": "rewardPercentile",
"type": "array"
},
"title": "rewardArray",
"type": "array"
}
},
"required": [
"oldestBlock",
"baseFeePerGas",
"gasUsedRatio"
],
"title": "feeHistoryResults",
"type": "object"
}