Skip to main content
POST
eth_gasPrice
curl --request POST \
  --url https://tempo-moderato.core.chainstack.com/a25a421add2280d53fdbc23417055501/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "eth_gasPrice",
  "params": [],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}
Tempo API method that returns the current gas price in wei. On Tempo, transaction fees are paid in TIP-20 stablecoins, not a native token. The gas price returned is used to calculate the USD-denominated fee.
Get you own node endpoint todayStart 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.

Parameters

  • none

Response

  • result — the current gas price in wei encoded as hexadecimal

eth_gasPrice code examples

const Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);

async function getGasPrice() {
  const gasPrice = await web3.eth.getGasPrice();
  console.log(`Gas price: ${gasPrice} wei`);
}

getGasPrice()

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_gasPrice
params
any[]
id
integer
default:1

Response

200 - application/json

The current gas price

jsonrpc
string
id
integer
result
string

The current gas price in wei encoded as hexadecimal

Last modified on January 23, 2026