Current Gas Price

GET/gateway/v1/onchain/gas-price

Look up the current gas price for one EVM chain. Example: `chain=ethereum`.

This endpoint uses `eth_gasPrice` JSON-RPC and returns gas price in both wei and Gwei.

Supported chains: `ethereum`, `polygon`, `bsc`, `arbitrum`, `optimism`, `base`, `avalanche`, `fantom`, `linea`, `cyber`.

Query Parameters

chainenum<string>required

Chain. Can be `ethereum`, `polygon`, `bsc`, `arbitrum`, `optimism`, `base`, `avalanche`, `fantom`, `linea`, or `cyber`.

Available options:ethereumpolygonbscarbitrumoptimismbaseavalanchefantomlineacyber
Example: ethereum
Current Gas Price
const options = {method: 'GET'};

fetch('https://api.asksurf.ai/gateway/v1/onchain/gas-price?chain=ethereum', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
OK
{
  "$schema": "https://example.com/schemas/DataObjectResponseOnchainGasPriceItem.json",
  "data": {
    "chain": "<string>",
    "gas_price": "<string>",
    "gas_price_gwei": 123
  },
  "meta": {
    "cached": true,
    "credits_used": 123,
    "empty_reason": "<string>"
  }
}