{"uid":"cap_G_KXO7ibXwwl6kHanv1De","slug":"l2-gas-price-comparison-ethereum-base-polygon-arbitrum-optimism-69f2d682","name":"L2 Gas Price Comparison (Ethereum + Base + Polygon + Arbitrum + Optimism)","description":"Current gas snapshot across Ethereum + supported L2s (Base, Polygon, Arbitrum, Optimism), sorted cheapest-first. Returns gas price in gwei, latest block number, chain id, and an isL2 flag per chain. Use to route a transaction to the cheapest viable L2 or to track L1→L2 gas spread.","url":"https://agent402.tools/api/l2-gas-comparison","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"networks":{"type":"array","description":"Subset of networks to query. Default = all 5. Supported: ethereum, base, polygon, arbitrum, optimism."}}},"responseSchema":{"type":"json","example":{"source":"alchemy","cheapest":"base","networks":[{"isL2":true,"chainId":8453,"network":"base","blockNumber":22000000,"gasPriceWei":"100000000","gasPriceGwei":0.1},{"isL2":true,"chainId":42161,"network":"arbitrum","blockNumber":300000000,"gasPriceWei":"100000000","gasPriceGwei":0.1},{"isL2":false,"chainId":1,"network":"ethereum","blockNumber":22000000,"gasPriceWei":"15000000000","gasPriceGwei":15}],"queriedAt":"2026-06-22T19:00:00.000Z"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_mpRviZNLbSUl8CsqnlOi4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a real-time gas price snapshot across Ethereum and major L2 networks, sorted cheapest-first, to help route transactions to the most cost-effective chain.","exampleAgentPrompt":"Before I send this transaction, check the current gas prices across Ethereum, Base, Arbitrum, Optimism, and Polygon and tell me which chain is cheapest right now.","exampleUseCases":null,"resultDescription":"A ranked list of networks (cheapest-first) each with: gas price in gwei, latest block number, chain ID, and an isL2 boolean flag. Covers up to 5 networks: Ethereum mainnet, Base, Polygon, Arbitrum, and Optimism.","failureModes":["Network RPC unreachable for one or more chains — partial results may be returned","Invalid network name in the 'networks' array — endpoint may ignore unknown values or return an error","All networks unavailable — empty results or timeout","Payment failure (x402) — call rejected before execution"],"whenToPreferThis":"Use this endpoint when an agent needs to dynamically route a transaction to the cheapest EVM-compatible chain, or when a user wants a real-time, cross-chain gas fee comparison before committing to a network. Prefer this over manually querying individual chain RPCs or static fee tables.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:04.385Z","isFirstParty":false}