ERC-1155 balance

$0.002 per call · USDC via x402 · GET /api/chain/erc1155-balance

How many of one ERC-1155 token id an account holds, read straight from the contract. Send GET /api/chain/erc1155-balance with the required fields contract, address and tokenId and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with contract, address, tokenId, network and balance.

ERC-1155 is the multi-token standard behind most game items, editions and passes, where a single contract holds many ids and a balance is a quantity rather than ownership of one thing. Returns the balance as a decimal string. EVM chains: ethereum, base, polygon, arbitrum, optimism.

Category: Crypto & onchain data · Tags: evm erc1155 nft balance rpc · Also found as: 1155-balance multi-token-balance edition-balance

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
contractstringyes0x ERC-1155 contract address Also accepted as contractAddress, token.
addressstringyes0x holder address Also accepted as addr, wallet, account.
tokenIdstringyesToken id, decimal or 0x hex Also accepted as id, token_id.
networkstringnoethereum | base | polygon | arbitrum | optimism (default base)

Example request

curl -i "https://agent402.tools/api/chain/erc1155-balance?contract=0x2953399124F0cBB46d2CbACD8A89cF0599974963&address=0xaBF4FAbd7c416fB67202E5f9002389Fc75e2a9D0&tokenId=1&network=polygon"

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

Example response

{
  "contract": "0x2953399124f0cbb46d2cbacd8a89cf0599974963",
  "address": "0xabf4fabd7c416fb67202e5f9002389fc75e2a9d0",
  "tokenId": "1",
  "network": "polygon",
  "balance": "0"
}
FieldTypeAlways presentIn the example
contractstringyes0x2953399124f0cbb46d2cbacd8a89cf0599974963
addressstringyes0xabf4fabd7c416fb67202e5f9002389fc75e2a9d0
tokenIdstringyes1
networkstringyespolygon
balancestringyes0

From an MCP client

catalog.call {
  "slug": "chain-erc1155-balance",
  "params": {
    "contract": "0x2953399124F0cBB46d2CbACD8A89cF0599974963",
    "address": "0xaBF4FAbd7c416fB67202E5f9002389Fc75e2a9D0",
    "tokenId": "1",
    "network": "polygon"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for chain-erc1155-balance; 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/chain/erc1155-balance?contract=0x2953399124F0cBB46d2CbACD8A89cF0599974963&address=0xaBF4FAbd7c416fB67202E5f9002389Fc75e2a9D0&tokenId=1&network=polygon");

Related tools

NFT owner lookup (ERC-721 ownerOf)

$0.002 · GET /api/erc721-owner

Who owns this NFT? Calls ownerOf(tokenId) on any ERC-721 contract on Ethereum, Base, Polygon, Arbitrum, or Optimism. Com…

NFT holdings for an address

$0.002 · POST /api/nft-holdings

Return the NFTs owned by a wallet address on a given network. Each row carries the collection name, contract address, to…

NFT metadata lookup

$0.001 · POST /api/nft-metadata

Resolve the metadata for a single NFT: title, description, image URLs (original + cached CDN), attributes/traits, and th…

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 info

$0.001 · GET /api/block-info

Header-level detail for one block on Ethereum, Base, Polygon, Arbitrum, or Optimism: hash, timestamp (unix + ISO), trans…

Latest block number

$0.001 · GET /api/block-number

The latest block number on Ethereum, Base, Polygon, Arbitrum, or Optimism: returns network, blockNumber (integer) and he…