TriportRPC

eth_feeHistory

Polygon / https://triport.io/polygon

Minimum tier: Free

Polygon method guide

Last updated:

eth_feeHistory returns fee-market data for a contiguous range of blocks ending at newestBlock on Polygon mainnet (chain id 0x89 / 137). 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.

This is the primary input for a bot fee strategy: 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. Since Polygon's post-Bhilai fee market keeps base fees higher and more volatile than Ethereum's, sampling a short recent window each block is usually preferable to a single spot price from eth_gasPrice.

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://triport.io/polygon \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_feeHistory","params":[]}'
const res = await fetch("https://triport.io/polygon", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_feeHistory",
  "params": []
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/polygon",
    headers={"Authorization": "Bearer <api-key>"},
    json={"jsonrpc":"2.0","id":1,"method":"eth_feeHistory","params":[]},
)
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Chain: Polygon.
  3. Clusters: mainnet.
  4. 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 for Polygon, 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.