eth_feeHistory
Last updated:
eth_feeHistory returns fee-market data for a contiguous range of blocks ending
at newestBlock. For each block in the window it reports the base fee per gas,
the gas-used ratio, and — when you pass rewardPercentiles — the effective
priority fee (tip) at each requested percentile. The response also includes the
projected base fee for the block immediately after the window, so the
baseFeePerGas array always has one more entry than the number of blocks
requested.
Use it to build EIP-1559 fee estimates: read recent base fees to anticipate the
next block's base fee, and read tip percentiles to pick a maxPriorityFeePerGas
that matches how aggressively you want a transaction included. A common pattern
is to request the last few blocks at the [10, 50, 90] percentiles and choose a
tip from the median or upper band depending on urgency.
All numeric values are returned as 0x-prefixed hexadecimal strings (wei),
including the entries inside the reward arrays. The gasUsedRatio field is the
exception — it is a JSON number between 0 and 1.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/eth \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"eth_feeHistory","params":[],"jsonrpc":"2.0"}'const res = await fetch("https://triport.io/eth", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"id": 1,
"method": "eth_feeHistory",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/eth",
headers={"Authorization": "Bearer <api-key>"},
json={"id":1,"method":"eth_feeHistory","params":[],"jsonrpc":"2.0"},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet.
- Credit cost: 1 per call.
FAQ
- What does eth_feeHistory do?
- Returns a window of historical base fees, gas-usage ratios, and priority-fee percentiles, used to estimate EIP-1559 fees.
- How many credits does eth_feeHistory cost?
- eth_feeHistory costs 1 credit(s) per call on Triport by default.
- Is eth_feeHistory available over WebSocket?
- eth_feeHistory is an HTTP JSON-RPC method.