L0vdL0vd

eth_gasPrice

Returns the node's current suggested gas price.

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_gasPrice","params":[]}'

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x7d182b9"
}
Params and your endpoint

Parameters

This method takes no parameters.

Returns

string Gas price in wei, hex.

When to use it

Get a quick legacy gas price suggestion in wei.

How to read the result

Hex wei. Divide by 10^9 for gwei.

Tips

  • For EIP-1559 transactions prefer eth_feeHistory and eth_maxPriorityFeePerGas to set maxFeePerGas and the tip.

Related methods