# api2ls.com EVM Block Height & Latest Block Info

> api2ls.com EVM Block Height & Latest Block Info is a paid API for AI agents from api2ls.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns the current block number and latest block details (base fee, timestamp) for a specified EVM chain

## Facts

- Endpoint: GET https://api2ls.com/api/block
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api2ls-com-evm-block-height-latest-block-info-b2431ae2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Hm8cQ30K9SL3nqUq7tGDL

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 api2ls-com-evm-block-height-latest-block-info-b2431ae2
```

Example prompt: What's the current block height and base fee on Ethereum right now?

## When to prefer this

Use this endpoint when an agent needs to know the current block height or latest block metadata (e.g. base fee) for a specific EVM chain such as Base, Ethereum, Optimism, Arbitrum, or Polygon — especially in workflows that require chain-state awareness, gas estimation context, or timing relative to block production.

## Known failure modes

- Unsupported chain name returns an error or falls back to default (base)
- Network timeout if the target EVM RPC is slow or unavailable
- Missing or malformed chain query parameter may default to Base silently
- Rate limiting or payment failure (HTTP 402) if USDC payment is not attached

## How this service works

Get the current block height and latest-block details for an EVM chain

## Output

Returns a JSON object with success status, the current block number, the chain name, the base fee in Gwei, and an 'asOf' timestamp indicating when the data was fetched.

## 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": {
      "chain": {
       "type": "string",
       "description": "EVM network: base (default), ethereum, optimism, arbitrum, or polygon"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "success",
      "blockNumber"
     ],
     "properties": {
      "asOf": {
       "type": "string"
      },
      "chain": {
       "type": "string"
      },
      "success": {
       "type": "boolean"
      },
      "baseFeeGwei": {
       "type": "number"
      },
      "blockNumber": {
       "type": "number"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api2ls-com-evm-block-height-latest-block-info-b2431ae2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api2ls.com](https://www.zero.xyz/host/api2ls.com/llms.txt)
