# OneSource Total Supply Lookup

> OneSource Total Supply Lookup 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-15).

Returns the total supply of an ERC20 or ERC721 token contract by calling the totalSupply function on-chain via eth_call

## Facts

- Endpoint: GET https://api.onesource.io/api/chain/total-supply
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onesource-total-supply-lookup-b6fa30f8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TBgghv5JHBbiY8SNqrF8l

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-total-supply-lookup-b6fa30f8
```

Example prompt: What's the total token supply for the USDC contract at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum mainnet?

## When to prefer this

Use this endpoint when you need to programmatically query the on-chain totalSupply of any ERC20 or ERC721 token contract on Ethereum mainnet or Sepolia testnet without running your own node. Ideal for agents that need token supply data as part of DeFi analysis, NFT inventory checks, or on-chain data enrichment pipelines.

## Known failure modes

- Invalid contract address format (must be 0x followed by 40 hex characters) returns a validation error
- Contract at address does not implement totalSupply() returns a call error or empty result
- Unsupported network value (anything other than 'ethereum' or 'sepolia') returns an enum validation error
- Contract address is valid hex but not deployed returns an error or zero result
- Network RPC timeout causes a delayed or failed response

## How this service works

Total supply of an ERC20 or ERC721 token contract via totalSupply (eth_call)

## Output

Returns the total supply value for the specified token contract, representing the full on-chain count of minted tokens as returned by the contract's totalSupply() function.

## Example request

```json
{
 "network": "ethereum",
 "contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}
```

## 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": [
      "contract"
     ],
     "properties": {
      "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"
        },
        "decimals": {
         "type": "integer"
        },
        "is_erc721": {
         "type": "boolean"
        },
        "total_supply": {
         "type": "string"
        },
        "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",
   "decimals": 6,
   "is_erc721": false,
   "total_supply": "39283948340000000",
   "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
  },
  "meta": {
   "endpoint": "/api/chain/total-supply",
   "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-total-supply-lookup-b6fa30f8/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)
