eth_feeHistory

Returns the base fee for each type of gas and the gas priority fee for historical transactions within the specified block range.

Parameters

  • BLOCK-COUNT [required] The block range number in hexadecimal, the single query range is 1 ~ 1024 block numbers.

  • NEWEST-BLOCK [required] The latest block number.

  • REWARD-PERCENTILES [optional] A list of increasing percentage values to sample from each block's priority gas, sorted in ascending order and weighted.

Request

curl https://eth-mainnet.solarpath.io/v1/YOUR-API-KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_feeHistory", "params": ["0x5", "latest", []]}'

Response

  • oldestBlock Lowest number block of the returned range expressed as a hexidecimal number.

  • baseFeePerGas 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.

  • gasUsedRatio An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.

  • reward An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
      "oldestBlock": "0xf67cef",
      "baseFeePerGas": [
          "0x349556db2",
          "0x3306c5264",
          "0x2fe18441f",
          "0x328fb0791",
          "0x340b0abb0",
          "0x31458aa8d"
      ],
      "gasUsedRatio": [
          0.38156626666666665,
          0.2534203,
          0.723919,
          0.6172316666666666,
          0.2869855
       ]
  }
}

Last updated