Skip to main content
EVM

eth_gasPrice

Summary: Get current price per gas

This request returns the current price per gas in wei. The price reflects the percentile gas unit price for the most recent blocks. By default, the last 100 blocks are examined and the 50th percentile gas unit price (that's, the median value) is returned. If there are no blocks, the value for minGasPrice is returned.

Parameters

This method doesn't accept any parameters.

Returns

eth_gasPriceResponse

The current percentile gas unit price for the most recent blocks in wei, as a hexadecimal value.

Customize request
Parameter
Value
Request
curl https://linea-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}'
Example response
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x3938700"
}