# BaseLens ERC-20 Balance Lookup

> BaseLens ERC-20 Balance Lookup is a paid API for AI agents from baselens-api.vercel.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-31).

Returns the ERC-20 token balance for a given wallet address on the Base blockchain, including symbol, decimals, and raw balance.

## Facts

- Endpoint: GET https://baselens-api.vercel.app/v1/erc20-balance?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/baselens-erc-20-balance-lookup-1d4a1c3f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HG2nXfkG5Bepu8uJIUYKA

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 baselens-erc-20-balance-lookup-1d4a1c3f
```

Example prompt: What's the USDC balance for the Base wallet 0xAbC123...def on the USDC contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913?

## When to prefer this

Choose this endpoint when you need on-chain ERC-20 token balances on the Base network without setting up an API key, especially in agent workflows that support x402 micropayments. It is ideal for pay-per-query agent pipelines, DeFi automations, or balance verification steps where the $0.002 per-call cost is acceptable and real-time on-chain accuracy is required.

## Known failure modes

- Invalid or non-checksummed wallet address returns an error
- Token contract address that is not a valid ERC-20 on Base returns empty or error
- Address with zero balance returns balance of '0'
- Network downtime or RPC issues may produce 5xx errors
- Payment failure via x402 protocol causes 402 response blocking the call

## How this service works

Base address, ERC-20 balance, token price, recent transfers, Basename/ENS resolve, contract verification, tx summaries and gas over x402 and MCP. $0.001–$0.004 USDC per call, no API key.

## Output

Returns a JSON object containing the token contract address, token symbol (e.g. USDC), human-readable balance, decimal precision, and raw balance integer — sufficient to display or compare holdings without further transformation.

## 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",
     "required": [
      "token",
      "address"
     ],
     "properties": {
      "token": {
       "type": "string",
       "description": "ERC-20 token contract on Base"
      },
      "address": {
       "type": "string",
       "description": "0x-prefixed Base address"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "token": "0x8335…2913",
  "symbol": "USDC",
  "balance": "1",
  "decimals": 6,
  "balanceRaw": "1000000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/baselens-erc-20-balance-lookup-1d4a1c3f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from baselens-api.vercel.app](https://www.zero.xyz/host/baselens-api.vercel.app/llms.txt)
