eth_feeHistory

Returns the number of transactions in a block from a block matching the given block hash.

Request

curl 'https://rpc.web3api.io?x-api-key=YOUR-API-KEY' \
    -X POST \
    -H 'x-amberdata-blockchain-id: ethereum-mainnet' \
    -d '{"jsonrpc":"2.0","id":1,"method":"eth_feeHistory","params":[100, "latest", []]}'
IndexDescription
0* - blockCountNumber of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query.
1* - newestBlockHighest number block of the requested range.
2* - rewardPercentilesA monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used.

*Required

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "oldestBlock": 12963083,
    "baseFeePerGas": [
      "0x0",
      "0x0",
      "0x0",
      ...,
      "0x0",
      "0x0",
      "0x0"
    ],
    "gasUsedRatio": [
      0.9999775341886522,
      0.9988783269428354,
      0.9991999008726745,
      ...,
      0.999581141552776,
      0.9994405317668222,
      0.9998926378682623
    ]
  }
}