# OneSource ERC20 Token Balance

> OneSource ERC20 Token Balance is a paid API for AI agents from api.onesource.io, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-13).

Returns the ERC20 token balance for any Ethereum wallet address by calling balanceOf on-chain via live Ethereum RPC

## Facts

- Endpoint: GET https://api.onesource.io/api/chain/erc20-balance
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onesource-erc20-token-balance-ca8b3a79
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xIrnljJQNNW4Us85HI91e

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 onesource-erc20-token-balance-ca8b3a79
```

Example prompt: What's the USDC balance (contract 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) for wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Ethereum mainnet?

## When to prefer this

Use this endpoint when you need to check the on-chain ERC20 token balance for a specific wallet address on Ethereum mainnet or Sepolia testnet. Prefer this over the combined live wallet endpoint when you only need a single token's balance and want a lightweight, targeted eth_call rather than a multi-asset query.

## Known failure modes

- Invalid token address format (not a valid 0x hex address) — returns 400 or validation error
- Invalid account address format — returns 400 or validation error
- Token contract does not implement ERC20 balanceOf — may return zero or an RPC error
- Network value not in enum (ethereum, sepolia) — returns validation error
- RPC node temporarily unavailable — returns 5xx error
- Wallet has no balance — returns 0 (not an error)

## How this service works

ERC20 token balance for any Ethereum wallet - USDC, USDT, DAI, or any token - via balanceOf (eth_call) on OneSource live Ethereum RPC

## Output

Returns the raw on-chain ERC20 token balance for the specified wallet address, retrieved via a live eth_call (balanceOf) against the OneSource Ethereum RPC. The balance is typically in the token's smallest unit (e.g. wei or 6-decimal units for USDC/USDT).

## Example request

```json
{
 "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
 "account": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
 "network": "ethereum"
}
```

## 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",
     "required": [
      "address",
      "contract"
     ],
     "properties": {
      "address": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      },
      "network": {
       "enum": [
        "ethereum",
        "sepolia",
        "robinhood"
       ],
       "type": "string",
       "default": "ethereum"
      },
      "contract": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "data",
      "meta"
     ],
     "properties": {
      "data": {
       "type": "object",
       "properties": {
        "name": {
         "type": "string"
        },
        "symbol": {
         "type": "string"
        },
        "account": {
         "type": "string"
        },
        "balance": {
         "type": "string"
        },
        "decimals": {
         "type": "integer"
        },
        "contract_address": {
         "type": "string"
        }
       },
       "description": "Endpoint-specific response payload"
      },
      "meta": {
       "type": "object",
       "required": [
        "endpoint",
        "request_id"
       ],
       "properties": {
        "endpoint": {
         "type": "string"
        },
        "cost_usdc": {
         "type": "string"
        },
        "request_id": {
         "type": "string"
        },
        "payment_chain": {
         "type": "string"
        },
        "payment_token": {
         "type": "string"
        }
       }
      },
      "error": {
       "type": [
        "object",
        "null"
       ],
       "properties": {
        "code": {
         "type": "integer"
        },
        "message": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "name": "Tether USD",
   "symbol": "USDT",
   "account": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
   "balance": "1234567890",
   "decimals": 6,
   "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
  },
  "meta": {
   "endpoint": "/api/chain/erc20-balance",
   "cost_usdc": "0.001",
   "request_id": "00000000abcdef01",
   "payment_chain": "base",
   "payment_token": "USDC"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-erc20-token-balance-ca8b3a79/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.onesource.io](https://www.zero.xyz/host/api.onesource.io/llms.txt)
