# Base Gas Price History

> Base Gas Price History is a paid API for AI agents from scanpay-edge.alextaghiashvili.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-02).

Returns per-block base fee, gas usage, utilization, and transaction counts for the last N Base (EVM chain 8453) blocks, plus summary statistics and a suggested max fee.

## Facts

- Endpoint: GET https://scanpay-edge.alextaghiashvili.workers.dev/api/v1/base-gas-history?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-gas-price-history-5e652aa4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1ZfYfzwyl7fYUyhfOPtll

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability base-gas-price-history-5e652aa4
```

Example prompt: Pull the Base gas price history for the last 30 blocks and tell me the average base fee, current trend, and what max fee I should set for my next transaction.

## When to prefer this

Choose this endpoint when you need real-time, per-block gas analytics specifically for the Base L2 network (chain 8453), including trend analysis and actionable fee suggestions. It is preferable over raw RPC calls because it aggregates multi-block statistics and computes a suggested max fee automatically. Use it over generic multi-chain gas APIs when Base-specific granularity and trend data matter.

## Known failure modes

- blocks parameter below 5 or above 50 returns a validation error
- RPC or indexer connectivity issues may return a cached or partial result (cached flag = true)
- If the Base node is unavailable, the endpoint may return an error or stale data
- Requesting blocks near genesis or during a chain fork may yield incomplete history

## How this service works

Base gas price history: base fee, gas used/limit, utilization and transaction counts for the last N Base blocks, plus average/min/max, trend and suggested max fee

## Output

Returns a JSON object with a per-block history array (block number, timestamp, gas used, gas limit, utilization %, base fee in gwei, tx count) for the requested number of blocks, plus a summary object containing average/min/max base fee, average utilization, trend percentage, suggested max fee, and suggested priority fee — all scoped to the Base network (EIP-155 chain 8453).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "blocks": {
       "type": "integer",
       "default": 20,
       "maximum": 50,
       "minimum": 5
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "cached": false,
  "history": [
   {
    "number": 20000000,
    "gas_used": 10000000,
    "tx_count": 100,
    "gas_limit": 30000000,
    "timestamp": 1720000000,
    "base_fee_gwei": 0.001,
    "utilization_pct": 33.33
   },
   {
    "number": 20000001,
    "gas_used": 10000000,
    "tx_count": 100,
    "gas_limit": 30000000,
    "timestamp": 1720000002,
    "base_fee_gwei": 0.001,
    "utilization_pct": 33.33
   },
   {
    "number": 20000002,
    "gas_used": 10000000,
    "tx_count": 100,
    "gas_limit": 30000000,
    "timestamp": 1720000004,
    "base_fee_gwei": 0.001,
    "utilization_pct": 33.33
   },
   {
    "number": 20000003,
    "gas_used": 10000000,
    "tx_count": 100,
    "gas_limit": 30000000,
    "timestamp": 1720000006,
    "base_fee_gwei": 0.001,
    "utilization_pct": 33.33
   },
   {
    "number": 20000004,
    "gas_used": 10000000,
    "tx_count": 100,
    "gas_limit": 30000000,
    "timestamp": 1720000008,
    "base_fee_gwei": 0.001,
    "utilization_pct": 33.33
   }
  ],
  "network": "eip155:8453",
  "product": "scanpay.base_gas_history",
  "summary": {
   "trend_pct": 0,
   "avg_base_fee_gwei": 0.001,
   "max_base_fee_gwei": 0.001,
   "min_base_fee_gwei": 0.001,
   "avg_utilization_pct": 33.33,
   "suggested_max_fee_gwei": 0.00125,
   "suggested_priority_fee_gwei": 0.001
  },
  "as_of_ms": 1720000000000,
  "to_block": 20000004,
  "price_usd": 0.002,
  "from_block": 20000000,
  "blocks_returned": 5,
  "blocks_requested": 5
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-gas-price-history-5e652aa4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from scanpay-edge.alextaghiashvili.workers.dev](https://www.zero.xyz/host/scanpay-edge.alextaghiashvili.workers.dev/llms.txt)
