# Agent402 Coin Price by Contract

> Agent402 Coin Price by Contract is a paid API for AI agents from agent402.tools, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns real-time token prices, market cap, 24h volume, and 24h price change for up to 25 ERC-20/SPL token contracts on a specified blockchain platform.

## Facts

- Endpoint: GET https://agent402.tools/api/coin-price-by-contract
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-coin-price-by-contract-0d7f6af1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ofAbww0GF8DfvZg4tiRsD

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 agent402-coin-price-by-contract-0d7f6af1
```

Example prompt: What's the current price, market cap, and 24h volume for USDC at contract 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 on the Ethereum platform, in USD?

## When to prefer this

Use this endpoint when you have one or more specific token contract addresses and need real-time price, market cap, or volume data for tokens on a supported EVM or Solana-compatible chain. It is ideal for DeFi agents, portfolio trackers, and arbitrage monitors that work directly with contract addresses rather than ticker symbols. Prefer this over ticker-based price APIs when you need multi-chain contract-level precision or when the token lacks a widely-recognized symbol.

## Known failure modes

- Invalid or unrecognized contract address returns empty tokens array
- Unsupported platform ID causes validation error
- More than 25 contracts in a single request may be rejected
- Invalid currency code returns error or defaults to USD
- Network timeout from upstream CoinGecko data source
- Payment failure (insufficient USDC balance) blocks the call

## How this service works

Live price, market cap, 24h volume and 24h change for ERC-20 / SPL / other chain tokens looked up by CONTRACT ADDRESS on a named platform (ethereum, base, polygon-pos, arbitrum-one, optimistic-ethereum, binance-smart-chain, solana, avalanche, ...). Up to 25 contracts per call, any vs currency (default usd). The address-first sibling of crypto-price: use it when an agent holds a token address from a wallet, a DEX pair or a contract scan and has no coin id.

## Output

Returns a JSON object with an array of token records, each containing: contract address, price in the requested currency, market cap, 24h trading volume, 24h price change percentage, and last-updated timestamp. Also includes metadata such as the data source (CoinGecko), platform, currency, fetch time, and whether the result was served from cache.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "platform",
      "contracts"
     ],
     "properties": {
      "currency": {
       "type": "string",
       "description": "vs currency (default usd): fiat (usd, eur) or crypto (btc, eth)."
      },
      "platform": {
       "type": "string",
       "description": "Asset platform id: ethereum, base, polygon-pos, arbitrum-one, optimistic-ethereum, binance-smart-chain, solana, avalanche, ... "
      },
      "contracts": {
       "type": "string",
       "description": "Comma-separated contract addresses (max 25). Also accepts an array."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "source",
      "fetchedAt",
      "cached",
      "platform",
      "currency",
      "count",
      "tokens"
     ],
     "properties": {
      "count": {
       "type": "integer"
      },
      "cached": {
       "type": "boolean"
      },
      "source": {
       "type": "string"
      },
      "tokens": {
       "type": "array",
       "items": {
        "type": "object"
       }
      },
      "currency": {
       "type": "string"
      },
      "platform": {
       "type": "string"
      },
      "fetchedAt": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "cached": false,
  "source": "coingecko",
  "tokens": [
   {
    "price": 0.999916,
    "contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "marketCap": 73514026487.98,
    "volume24h": 26092767405.46,
    "lastUpdated": "2026-08-22T13:15:40.000Z",
    "change24hPct": 0.0212
   }
  ],
  "currency": "usd",
  "platform": "ethereum",
  "fetchedAt": "2026-08-22T13:20:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-coin-price-by-contract-0d7f6af1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
