Token balances (named contracts)

$0.002 per call · USDC via x402 · POST /api/token-balances

ERC-20 balances of one wallet for a NAMED list of token contracts (1-20) - the targeted complement to the full-portfolio wallet-balance tool. Send POST /api/token-balances with the required fields address and contracts and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with network, chainId, address, tokens, source and 1 more.

One balance read for the whole list plus symbol/decimals per contract (cached an hour server-side), so 'how much USDC and WETH does this wallet hold on Base?' is a single cheap call with exact decimal strings, not a portfolio dump.

Category: Crypto & onchain data · Tags: crypto erc20 balance balances wallet usdc evm ethereum · Also found as: erc20-balance

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
addressstringyes0x-prefixed 40-char EVM wallet address. Also accepted as addr, wallet, account.
contractsarray of stringyes1-20 ERC-20 contract addresses to read.
networkstringnoethereum / base / polygon / arbitrum / optimism (default ethereum).

Example request

curl -i -X POST https://agent402.tools/api/token-balances \
  -H "Content-Type: application/json" \
  -d '{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","contracts":["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"],"network":"ethereum"}'

Without payment this returns HTTP 402 Payment Required with the exact price for token-balances; any x402 v2 or MPP client pays it and retries.

Example response

{
  "network": "ethereum",
  "chainId": 1,
  "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
  "tokens": [
    {
      "contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "symbol": "USDC",
      "name": "USDC",
      "decimals": 6,
      "balance": "37.192124",
      "raw": "37192124"
    },
    {
      "contract": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "symbol": "WETH",
      "name": "Wrapped Ether",
      "decimals": 18,
      "balance": "1.461",
      "raw": "1461000000000000000"
    }
  ],
  "source": "alchemy",
  "fetchedAt": "2026-08-22T12:00:00.000Z"
}
FieldTypeAlways presentIn the example
networkstringyesethereum
chainIdnumberyes1
addressstringyes0xd8da6bf26964af9d7eed9e03e53415d37aa96045
tokensarray of objectsyes2 items in the example
sourcestringyesalchemy
fetchedAtstringyes2026-08-22T12:00:00.000Z

From an MCP client

catalog.call {
  "slug": "token-balances",
  "params": {
    "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "contracts": [
      "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
    ],
    "network": "ethereum"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for token-balances; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/token-balances", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "contracts": [
      "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
    ],
    "network": "ethereum"
  }),
});

Related tools

Wallet balance (native + ERC-20)

$0.002 · POST /api/wallet-balance

Look up the native coin balance (ETH/MATIC) plus every ERC-20 holding for a wallet address on Ethereum, Base, Polygon, A…

Wallet token transfers (filtered)

$0.003 · POST /api/asset-transfers

Recent token transfers for a wallet on Base, Ethereum and other EVM chains, newest first. Filtered transfer log for an E…

Block receipts (one block, summarised)

$0.005 · POST /api/block-receipts

Every transaction receipt in one block, fetched as a single upstream read and summarised: tx count, succeeded vs failed,…

Multi-chain EVM RPC (read-only)

$0.004 · POST /api/evm-rpc

Read-only JSON-RPC against Ethereum, Base, Polygon, Arbitrum, or Optimism with built-in multi-endpoint failover - one pa…

ERC-20 allowance (owner to spender)

$0.002 · POST /api/token-allowance

How much of an ERC-20 token a spender contract is approved to move from an owner wallet - the approval check an agent ru…

Transaction receipt (decoded transfers)

$0.003 · POST /api/tx-receipt

Full receipt for a transaction hash in one call: status, block, from/to, value, gas used vs limit, effective gas price, …