Wallet balance (native + ERC-20) · Wallet Balance

by Wallet balance (native + ERC-20)

POSTBaseSolanaArbitrumPolygonMonadAvalancheeip155:1329OptimismFraxtaleip155:42220stellar:pubnetalgorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=

$0.002

per call · USD Coin on Base

Look up the native coin balance (ETH/MATIC) plus every ERC-20 holding for a wallet address on Ethereum, Base, Polygon, Arbitrum, or Optimism. Returns clean decimal balances (already scaled by token decimals) plus symbol and contract - ready to display in a UI or feed into a portfolio tool.

Endpoint

POST https://agent402.tools/api/wallet-balance

4

Calls / 30d

1

Unique payers / 30d

Aug 31

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://agent402.tools/api/wallet-balance", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "address": "0xaBF4FAbd7c416fB67202E5f9002389Fc75e2a9D0",
    "network": "base"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://agent402.tools/api/wallet-balance" \
  -H "Content-Type: application/json" \
  -d '{"address":"0xaBF4FAbd7c416fB67202E5f9002389Fc75e2a9D0","network":"base"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "address": "0xabf4fabd7c416fb67202e5f9002389fc75e2a9d0",
  "native": {
    "balance": "0.001234",
    "raw": "1234000000000000",
    "symbol": "ETH"
  },
  "network": "base",
  "tokens": [
    {
      "balance": "100",
      "contract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
      "decimals": 6,
      "raw": "100000000",
      "symbol": "USDC"
    }
  ]
}

Payment details

Pay to0xabf4fabd7c416fb67202e5f9002389fc75e2a9d0
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Solana, Arbitrum, Polygon, Monad, Avalanche, eip155:1329, Optimism, Fraxtal, eip155:42220, stellar:pubnet, algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=
Schemesexact, upto

Is this your API?

Pin it to the top of Onchain Data and the homepage with a featured placement.

Get featured →

More from Wallet balance (native + ERC-20) & similar services