TriportRPC

eth_feeHistory

BNB Smart Chain / https://triport.io/rpc/bsc

Minimum tier: Free

BNB Smart Chain method guide

Last updated:

eth_feeHistory returns recent fee-market observations ending at a selected BNB Smart Chain block.

The response contains the oldest block in the window, base-fee quantities, gas-used ratios, and optional reward rows for the requested percentiles. Quantities are hex encoded; gas-used ratios are numbers between zero and one.

Use it to build fee suggestions from a block window. For a single current gas-price estimate use eth_gasPrice; for a single priority-fee estimate use eth_maxPriorityFeePerGas.

Parameters

eth_feeHistory parameters
NameTypeRequiredDescription
blockCountQuantityYes
newestBlockBlockTagYes
rewardPercentilesarrayYes

Returns

eth_feeHistory return value
FieldType
historyFeeHistory

Examples

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

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Chain: BNB Smart Chain.
  3. Clusters: mainnet.
  4. Credit cost: 1 per call.

FAQ

What does eth_feeHistory do?
Return fee-market history.
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.