eth_gasPrice | Aurora

Aurora API method that returns the current gas base fee of the network. The gas price is the quantity of the native token the transaction's sender must pay per unit of gas consumed. The value returned is in Wei.


Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.


  • none


  • quantity — the integer value of the current gas base fee, returned in Wei

eth_gasPrice code examples

const { Web3 } = require("web3");
const web3 = new Web3(NODE_URL);

async function getGasPrice() {
    const baseFee = await web3.eth.getGasPrice();
    const feeInGwei = web3.utils.fromWei(baseFee, "gwei")
    console.log(`The base gas fee is: ${baseFee} Wei`);
    console.log(`The base gas fee is: ${feeInGwei} Gwei`);
const ethers = require('ethers');
const provider = new ethers.JsonRpcProvider(node_url);

async function getGasPrice() {
  const baseFee = await provider.send("eth_gasPrice");
  console.log(`The base gas fee is: ${baseFee} Wei`);

from web3 import Web3  

web3 = Web3(Web3.HTTPProvider(node_url)) 

Use case

You can use eth_gasPrice to calculate the total gas value to send with a transaction based on the base and priority fee system. Ethereum's London hard fork implemented This concept with EIP-1559.

EIP-1559 aimed to solve the problem of network congestion by implementing a dynamic fee market mechanism, which adjusts the fee required to process a transaction based on network demand. With the current system, the total gas price comprises a base fee determined by the network's load and a priority fee added by the user.



The eth_gasPrice method returns the base fee.

Try the eth_gasPrice RPC method yourself

Click Try It! to start a request and see the response here!