Compare live gas prices across major EVM chains. $0.01 per request.
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.
| Method | POST |
|---|---|
| Path | /compare |
| Content-Type | application/json |
| field | required | description |
|---|---|---|
chains | no | Array of chain keys to limit results to. Omit for all: ethereum, base, polygon, arbitrum, optimism, bnb |
curl -X POST https://gas-price-comparator.pdfextractapi.workers.dev/compare \
-H "Content-Type: application/json" \
-d '{"chains": ["ethereum", "base"]}'
{
"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 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.
This endpoint is paid per-request via the x402 protocol (HTTP 402 + USDC). Unpaid requests receive a 402 response with payment instructions.