eth_feeHistory RPC Method

Provides historical base fee and priority fee data for a specified range of recent blocks.

Parameters#

stringrequired

How many blocks to include in the lookback window, hex-encoded.

stringrequired

Upper bound block number (hex) or a tag: latest, safe, finalized, pending.

arrayrequired

List of reward percentile breakpoints (floats from 0 to 100), or null.

Result#

object - Fee history including gasUsedRatio, oldestBlock, and optional reward percentiles.

Code sample#

{
  "jsonrpc": "2.0",
  "method": "eth_feeHistory",
  "params": [
    "0x1",
    "latest",
    [25, 75]
  ],
  "id": 1
}

Response#

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "gasUsedRatio": [0.5],
    "oldestBlock": "0x4b7",
    "baseFeePerGas": ["0x3b9aca00", "0x3b9aca00"],
    "reward": [["0x77359400", "0xb2d05e00"]]
  }
}
Try It