eth_feeHistory-polygon

Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range.

Parameters

  • blockCount - Requested range of blocks. Clients will return less than the requested range if not all blocks are available.
  • newestBlock - Highest block of the requested range.
  • rewardPercentiles - A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the coresponding effective tip for the percentile will be determined, accounting for gas consumed.
curl --request POST \
     --url https://polygon-mainnet-archive.allthatnode.com/8U3JLUhzIDg3GShvy9hkCCSYkLGc11kj \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_feeHistory",
  "params": [
  	2,
  	"latest",
  	[0, 100]
  ]
}
'

Returns

  • feeHIstoryResult - Fee history for the returned block range. This can be a subsection of the requested range if not all blocks are available.
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "oldestBlock": "0x10e9755",
        "reward": [
            [
                "0x0",
                "0x98507d22e3"
            ],
            [
                "0x0",
                "0x43372b07d8"
            ]
        ],
        "baseFeePerGas": [
            "0x3a959b558",
            "0x3b1b8d7a6",
            "0x3a6daff4a"
        ],
        "gasUsedRatio": [
            0.5357246,
            0.454039
        ]
    }
}

Try yourself

Language
Click Try It! to start a request and see the response here!