eth_feeHistory

Returns historical gas information for a specified range of blocks. Useful for fee estimation and analyzing gas price trends.

Parameters

Returns


Request

{
  "jsonrpc": "2.0",
  "method": "eth_feeHistory",
  "params": ["0x5", "latest", [20, 30]],
  "id": 1
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "oldestBlock": "0x1b3",
    "reward": [["0x3b9aca00", "0x59682f00"], ["0x3b9aca00", "0x59682f00"]],
    "baseFeePerGas": ["0x3b9aca00", "0x3b9aca07", "0x3b9aca0e"],
    "gasUsedRatio": [0.5, 0.6]
  }
}

Last updated