Gas Price Comparator

Compare live gas prices across major EVM chains. $0.01 per request.

What it does

Fetches the current gas price directly from each chain's RPC and converts it to an estimated USD cost for a standard 21,000-gas transfer, using live native-token prices. Supported chains: Ethereum, Base, Polygon, Arbitrum One, Optimism, BNB Smart Chain.

Endpoint

MethodPOST
Path/compare
Content-Typeapplication/json

Fields

fieldrequireddescription
chainsnoArray of chain keys to limit results to. Omit for all: ethereum, base, polygon, arbitrum, optimism, bnb

Example

curl -X POST https://gas-price-comparator.pdfextractapi.workers.dev/compare \
  -H "Content-Type: application/json" \
  -d '{"chains": ["ethereum", "base"]}'

Example response

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

Errors

Errors return a non-200 status with { "error": { "code": "...", "message": "..." } }. Common codes: invalid_chains, unknown_chain, empty_chains. Per-chain RPC failures are reported in that chain's error field rather than failing the whole request.

Payment

This endpoint is paid per-request via the x402 protocol (HTTP 402 + USDC). Unpaid requests receive a 402 response with payment instructions.

Try it in your browser