# Ethereum ERC-20 Balance (balanceOf)

> Ethereum ERC-20 Balance (balanceOf) is a paid API for AI agents from api.arysphere.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-17).

Returns the raw ERC-20 token balance of a holder address on Ethereum mainnet by calling the contract's balanceOf function.

## Facts

- Endpoint: GET https://api.arysphere.com/v1/ventures/x402_eth_reads_v1/eth_mainnet_erc20_balanceof?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ethereum-erc-20-balance-balanceof-32307ed8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1Qhzw8Gyd_dWzlq-nh7Ta

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 ethereum-erc-20-balance-balanceof-32307ed8
```

Example prompt: What's the current ERC-20 token balance of wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 for the USDC contract at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum mainnet?

## When to prefer this

Use this endpoint when you need the live on-chain ERC-20 balanceOf value for any token/holder pair on Ethereum mainnet without running your own node. It is ideal for lightweight, single-address balance queries paid per-call via x402 micropayments. Prefer this over bundle endpoints when you need only the ERC-20 balance and want to minimize cost. Choose the ERC-20 Allowance sibling endpoint instead if you need to check how much a spender is permitted to spend on behalf of the holder.

## Known failure modes

- Invalid contract address format (not 0x + 40 hex) returns a 400 error
- Invalid holder address format returns a 400 error
- Contract address is not a valid ERC-20 contract — call may revert or return 0
- Payment not provided or insufficient — x402 payment required at $0.002 USDC
- Ethereum mainnet RPC unavailable — service may return 5xx error
- Address with zero balance returns result: '0' (not an error, but agents must handle this correctly

## How this service works

ARYSPHERE sells AI-written verdicts on Base token contracts (a grade, a one-liner, a roast and the contract's facts) and Base/Ethereum chain reads, paid per call in USDC on Base over x402 v2. No account and no API key.

## Output

A JSON object with fields: ok (boolean success flag), chain (always 'base' or 'ethereum' identifier), method ('balanceOf'), result (the raw integer token balance as a string, in the token's smallest unit), and service (the internal service identifier). The raw balance must be divided by 10^decimals to get a human-readable amount.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "token": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "ERC-20 contract, 0x + 40 hex"
      },
      "address": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "holder, 0x + 40 hex"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "chain": "ethereum",
  "method": "balanceOf",
  "result": "291368219",
  "service": "x402_eth_reads_v1.eth_mainnet_erc20_balanceof"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ethereum-erc-20-balance-balanceof-32307ed8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.arysphere.com](https://www.zero.xyz/host/api.arysphere.com/llms.txt)
