# Loyal Spark Get Token Balance

> Loyal Spark Get Token Balance is a paid API for AI agents from api.loyalspark.online, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Retrieves the ERC-20 loyalty token balance for a given wallet address on the Base L2 blockchain

## Facts

- Endpoint: POST https://api.loyalspark.online/x402-gateway/mcp-tools/get_token_balance
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/loyal-spark-get-token-balance-504eb942
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YpdhEIAreIBJqooPnz27i

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 loyal-spark-get-token-balance-504eb942 -d '<json body>'
```

Example prompt: Check my Loyal Spark loyalty token balance on Base for wallet address 0xAbc123...def456 — I want to know how many reward tokens I currently hold.

## When to prefer this

Use this endpoint when you need to programmatically query a user's onchain ERC-20 loyalty token balance on Base L2, especially within the Loyal Spark ecosystem. Prefer this over general blockchain explorers when you need a clean, structured JSON response ready for agent workflows or loyalty program automation.

## Known failure modes

- Invalid or malformed wallet address returns an error response
- Contract address not found on Base L2 returns empty or error
- Network congestion or RPC timeout causes delayed or failed response
- Wallet with zero balance returns 0 rather than an error
- Payment of $0.01 USDC via x402 fails due to insufficient funds

## How this service works

Onchain loyalty protocol on Base L2. Launch B20 rewards, earn and redeem tokens, trade P2P, automate with AI agents via REST and MCP.

## Output

Returns a JSON object containing the ERC-20 token balance for the specified wallet address on the Base L2 network, expressed as a numeric token amount (likely including raw and formatted values).

## Example request

```json
{
 "id": 1,
 "method": "tools/call",
 "params": {
  "name": "get_platform_info",
  "arguments": {}
 },
 "jsonrpc": "2.0"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "toolName",
    "inputSchema"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "mcp"
    },
    "example": {
     "type": "object"
    },
    "toolName": {
     "type": "string"
    },
    "transport": {
     "enum": [
      "streamable-http",
      "sse"
     ],
     "type": "string"
    },
    "description": {
     "type": "string"
    },
    "inputSchema": {
     "type": "object"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {}
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/loyal-spark-get-token-balance-504eb942/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.loyalspark.online](https://www.zero.xyz/host/api.loyalspark.online/llms.txt)
