TriportRPC

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

eth_feeHistory return value
FieldType
resultobject

Examples

curl https://<your-endpoint>/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_feeHistory","params":[]}'
const res = await fetch("https://<your-endpoint>/", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "id": 1,
  "method": "eth_feeHistory",
  "params": [],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"eth_feeHistory","params":[],"jsonrpc":"2.0"})
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Networks: mainnet.
  3. 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.