Gas Prices
Real-time gas price data for Ethereum and L2s.
Try it Live
Open in Swagger UI โ to test these endpoints interactively.
Endpointsโ
| Endpoint | Description | Price |
|---|---|---|
GET /api/gas | Ethereum gas | FREE |
GET /api/gas/{chain} | Chain-specific | FREE |
GET /api/gas/all | All chains | $0.001 |
GET /api/gas/history/{chain} | Historical | $0.01 |
GET /api/gasโ
Current Ethereum gas prices.
Requestโ
curl https://api.web3identity.com/api/gas
Responseโ
{
"chain": "ethereum",
"baseFee": 25.5,
"fast": {
"gwei": 35,
"usd": 2.45,
"time": "15 seconds"
},
"standard": {
"gwei": 28,
"usd": 1.96,
"time": "30 seconds"
},
"slow": {
"gwei": 22,
"usd": 1.54,
"time": "2 minutes"
},
"estimatedCosts": {
"transfer": { "gwei": 21000, "usd": 0.58 },
"erc20Transfer": { "gwei": 65000, "usd": 1.82 },
"swap": { "gwei": 150000, "usd": 4.20 },
"nftMint": { "gwei": 85000, "usd": 2.38 }
},
"updatedAt": "2026-02-08T04:30:00Z"
}
SDKโ
const gas = await client.getGas();
console.log(`Fast: ${gas.fast.gwei} gwei ($${gas.fast.usd})`);
GET /api/gas/{chain}โ
Gas prices for a specific chain.
Supported Chainsโ
| Chain | Parameter |
|---|---|
| Ethereum | ethereum |
| Base | base |
| Arbitrum | arbitrum |
| Optimism | optimism |
| Polygon | polygon |
Requestโ
curl https://api.web3identity.com/api/gas/base
Responseโ
{
"chain": "base",
"baseFee": 0.001,
"fast": {
"gwei": 0.005,
"usd": 0.0001
},
"standard": {
"gwei": 0.003,
"usd": 0.00006
},
"l1DataFee": 0.15
}
GET /api/gas/allโ
Gas prices for all supported chains.
Responseโ
{
"chains": {
"ethereum": {
"baseFee": 25.5,
"fast": { "gwei": 35, "usd": 2.45 }
},
"base": {
"baseFee": 0.001,
"fast": { "gwei": 0.005, "usd": 0.0001 }
},
"arbitrum": {
"baseFee": 0.1,
"fast": { "gwei": 0.15, "usd": 0.001 }
}
},
"cheapest": "base",
"updatedAt": "2026-02-08T04:30:00Z"
}
GET /api/gas/history/{chain}โ
Historical gas prices.
Query Parametersโ
| Param | Type | Default | Description |
|---|---|---|---|
hours | number | 24 | Hours of history |
Responseโ
{
"chain": "ethereum",
"history": [
{ "timestamp": "2026-02-08T00:00:00Z", "baseFee": 22.3 },
{ "timestamp": "2026-02-08T01:00:00Z", "baseFee": 25.1 },
{ "timestamp": "2026-02-08T02:00:00Z", "baseFee": 28.7 }
],
"average": 25.4,
"min": 18.2,
"max": 45.6
}
Gas Savings Tipsโ
| Action | Ethereum | Base | Savings |
|---|---|---|---|
| ETH Transfer | $2.45 | $0.0001 | 99.99% |
| Swap | $4.20 | $0.001 | 99.98% |
| NFT Mint | $2.38 | $0.0005 | 99.98% |
Consider L2s for significant gas savings!