W

Workers · Compare

by Workers

POSTBase

$0.01

per call · USD Coin on Base

Compare live gas prices and estimated transfer cost across major EVM chains.

Endpoint

POST https://gas-price-comparator.pdfextractapi.workers.dev/compare

2

Calls / 30d

2

Unique payers / 30d

Aug 30

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://gas-price-comparator.pdfextractapi.workers.dev/compare", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "chains": [
      "ethereum",
      "base",
      "polygon"
    ]
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://gas-price-comparator.pdfextractapi.workers.dev/compare" \
  -H "Content-Type: application/json" \
  -d '{"chains":["ethereum","base","polygon"]}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "chains": [
    {
      "chain": "ethereum",
      "error": null,
      "gas_price_gwei": 1.2,
      "name": "Ethereum",
      "native_symbol": "ETH",
      "standard_transfer_cost_usd": 0.06
    },
    {
      "chain": "base",
      "error": null,
      "gas_price_gwei": 0.01,
      "name": "Base",
      "native_symbol": "ETH",
      "standard_transfer_cost_usd": 0.0005
    }
  ],
  "cheapest_chain": "base"
}

Payment details

Pay to0xa0ac44becc6302298f01ed255b175ca1060c189e
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

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

Get featured →

More from Workers & similar services