Skip to main content

Get the base fee percentile

Returns the base fee percentile (50th percentile) of the specified blockchain network.

For example, if the API returns a value of 20 Gwei, it means that 50% of the historical base fees are less than or equal to 20 Gwei.

This can be useful for users or applications to estimate the optimal gas price for transactions based on historical data.

GET https://gas.api.infura.io/networks/${chainId}/baseFeePercentile

Parameters

Path:

  • chainId: string - ID of the chain to query.

Returns

baseFeePercentile: string - The base fee in Gwei at the 50th percentile, meaning that 50% of the base fees are less than or equal to the provided amount.

Example

Request

Include your API key and optional API key secret to authorize your account to use the APIs.

tip

You can call the API with only an API key, and include it as a path parameter instead of using the cURL authentication option (-u).

curl -X 'GET' \
-u <API_KEY>:<API_KEY_SECRET> \
"https://gas.api.infura.io/networks/1/baseFeeHistory"

Response

{
"baseFeePercentile": "23.227829059"
}