eth_feeHistory
Summary: Get transaction fee history
Parameters
blockCount
stringHexadecimal or decimal integer of the number of blocks for which historical fee data is required; up to maximum of 1024 blocks. Clients will return less than the requested range if not all blocks are available.
newestBlock
oneOfBlock number or string tag.
rewardPercentiles
arrayPass empty array if this request is not required. An ordered array of integers of reward percentile values; from smallest to largest as floating point value between 0 and 100. For each block in the requested range, the transactions are sorted in ascending order by effective tip per gas and the corresponding effective tip for the percentile then determined, accounting for gas consumed.
Returns
eth_feeHistoryResponse
objectFee history for the returned block range. If not all blocks are available, this will be a subsection of the requested range.
RequestCURL
curl https://linea-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_feeHistory",
"params": ["0x5","latest",[20,30]],
"id": 1
}'
Example response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"type": "object",
"schema": null,
"properties": {
"oldestBlock": "0x10b52f",
"baseFeePerGas": [
"0x1a4b2c9",
"0x16f3d2c",
"0x1b2d8a0",
"0x1d3e5f2",
"0x20c1234"
],
"gasUsedRatio": [
0.017712333333333333,
0.7458865666666668,
0.5534561,
0.5517375666666667,
0.6347769666666667
],
"reward": [
[
"0x737be7600",
"0x826299e00"
],
[
"0x773594000",
"0x861c46800"
],
[
"0x7aef40a00",
"0x89d5f3200"
],
[
"0x6fc23ac00",
"0x826299e00"
],
[
"0x737be7600",
"0x7aef40a00"
]
]
}
}
}