eth_feeHistory - Celo
Example code for the eth_feeHistory JSON-RPC method. Complete guide on how to use eth_feeHistory JSON-RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Request Example
curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "eth_feeHistory",
"params": ["0x5", "latest", [25, 50, 75]]
}'const axios = require('axios');
const url = 'https://go.getblock.io/<ACCESS-TOKEN>/';
const payload = {
jsonrpc: '2.0',
id: 'getblock.io',
method: 'eth_feeHistory',
params: ['0x5', 'latest', [25, 50, 75]]
};
axios.post(url, payload, {
headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));Response Example
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"baseFeePerGas": ["0x5d21dba00", "0x5d21dba00", "0x5d21dba00"],
"gasUsedRatio": [0.021, 0.045, 0.032],
"oldestBlock": "0x1d9f2a4",
"reward": [["0x0", "0x0", "0x0"], ["0x0", "0x0", "0x0"]]
}
}Reponse Definition
Field
Type
Description
Use Cases
Error Handling
Error Code
Description
SDK Integration
Last updated
Was this helpful?