eth_feeHistory
Retrieves historical gas fee data for Ethereum transactions, aiding in better gas price estimation and transaction planning based on past network activity
Request
Examples
curl --request POST \
--url https://rpc.xone.org \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_feeHistory",
"params": [
4,
4,
4
]
}
Response
200 OK
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"oldestBlock": "0x130b1e6",
"reward": [
[
"0x5041e1e",
"0xdd221b80"
],
[
"0x5041e1e",
"0xb8346df0"
],
[
"0x55d4a80",
"0xb2d05e00"
],
[
"0x4dd9818",
"0x3b9aca00"
]
],
"baseFeePerGas": [
"0x52d80a82c",
"0x50f43f659",
"0x50012de8d",
"0x4e30357d6",
"0x57efff9e7"
],
"gasUsedRatio": [
0.40875283333333334,
0.45308523333333334,
0.4091907,
0.9987537
],
"baseFeePerBlobGas": [
"0x1",
"0x1",
"0x1",
"0x1",
"0x1"
],
"blobGasUsedRatio": [
0.5,
1,
0.6666666666666666,
1
]
}
}
Request params
Name | Type | Description |
---|---|---|
id | integer | Request identifier |
jsonrpc | string | JSON-RPC version |
method | string | API method name |
Parameters | array | |
blockCount | integer | The number of blocks for which to retrieve fee history. |
newestBlock | string | The highest block number (inclusive) to be used as the reference point. Can be a block number or a string ("latest", "pending"). |
rewardPercentiles | array_of_integers | (optional) A list of percentiles for which to return gas used and priority fees per block. |
Response
200
Name | Type | Description |
---|---|---|
Parameters | array | |
id | integer | |
jsonrpc | string | |
result | array_of_strings | A list of addresses owned by the client. |