Skip to main content
Ethereum API
Multichain API

eth_gasPrice

Summary: Returns the current price per gas in wei.

Parameters

This method doesn't accept any parameters.

Returns

Gas price
string

hex encoded unsigned integer

Pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$

Customize request
Parameter
Value

Connect your MetaMask wallet to run requests successfully.

Request

await window.ethereum.request({
"method": "eth_gasPrice",
"params": [],
});

Example response

"0x3e8"