B

Booaip · GAS

by Booaip

GETBase

$0.005

per call · USD Coin on Base

Current gas price (gwei) on an EVM chain via on-chain read. Body: { chain }.

Endpoint

GET https://booaip.vercel.app/api/gas

1

Calls / 30d

1

Unique payers / 30d

Aug 17

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://booaip.vercel.app/api/gas", {
  method: "GET",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "chain": "base"
  }),
});
const data = await res.json();
cURL
curl -X GET \
  "https://booaip.vercel.app/api/gas" \
  -H "Content-Type: application/json" \
  -d '{"chain":"base"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "chain": "base",
  "gasPriceGwei": 0.05
}

Payment details

Pay to0xcd6b6d99b7751ff30b68fa1365488eb73fa7cefa
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Onchain Data and the homepage with a featured placement.

Get featured →

More from Booaip & similar services