# Token Price Lookup (Base ERC-20)

> Token Price Lookup (Base ERC-20) is a paid API for AI agents from x402-micro-pay.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-20).

Returns the current USD spot price of any ERC-20 token on Base, aggregated from on-chain Uniswap V3 pools and DeFiLlama, with spread and confidence metrics.

## Facts

- Endpoint: POST https://x402-micro-pay.com/api/skills/token-price?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/token-price-lookup-base-erc-20-6f17ef58
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aVYZiyrDmGAoWJgz992Nj

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 token-price-lookup-base-erc-20-6f17ef58 -d '<json body>'
```

Example prompt: What's the current USD spot price of WETH on Base — the contract is 0x4200000000000000000000000000000000000006 — and do the on-chain and DeFiLlama sources agree?

## When to prefer this

Choose this endpoint when you need a dual-source (on-chain + DeFiLlama) USD price for any ERC-20 token on Base, with explicit spread and confidence signals. Prefer it over raw oracle calls when you want built-in source agreement validation, no API key setup, and pay-per-call pricing at $0.002 USDC. Ideal for agents that need trustworthy spot prices without maintaining API credentials or subscriptions.

## Known failure modes

- Invalid or non-ERC-20 contract address returns an error or empty data
- Token with no Uniswap V3 pool on Base may return only one source or fail
- Very thin pools can return manipulated or unreliable prices (flagged in warnings)
- Stale DeFiLlama data if the token is infrequently priced (staleness_s will be high)
- Payment not sent results in HTTP 402 response requiring x402 USDC payment on Base
- Mismatched request_id with different body may cause unexpected deduplication behavior

## How this service works

41 pay-per-call JSON APIs for AI agents. No account or API key: an unpaid POST returns HTTP 402, pay in USDC on Base with x402 v2, retry. Prices from $0.001 per call.

## Output

A JSON object containing the token's symbol, decimals, aggregated USD spot price, a per-source breakdown (on-chain Uniswap V3 pool details including DEX, quote token, pool address, block number, and price; DeFiLlama price with confidence and staleness), spread percentage between sources, an overall confidence score, data freshness timestamps, any warnings, a disclaimer, and a suggested next skill ('token_risk').

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "enum": [
    "base"
   ],
   "type": "string",
   "default": "base"
  },
  "token": {
   "type": "string",
   "pattern": "^0x[0-9a-fA-F]{40}$",
   "description": "Base ERC-20 contract address"
  },
  "request_id": {
   "type": "string",
   "pattern": "^[A-Za-z0-9._:-]+$",
   "maxLength": 64,
   "minLength": 1,
   "description": "Optional idempotency key. Echoed back; a credit-pack redemption with the same request_id and body is charged once."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "agree": true,
   "chain": "base",
   "token": "0x4200000000000000000000000000000000000006",
   "symbol": "WETH",
   "decimals": 18,
   "by_source": {
    "onchain": {
     "pool": {
      "dex": "uniswap_v3",
      "quote": "USDC",
      "address": "0x6c561b446416e1a00e8e93e221854d6ea4171372",
      "variant": "fee 3000",
      "quote_side_usd": 60045166.09
     },
     "block": 52723111,
     "price_usd": "2431.203",
     "weth_usd_onchain": 2431.202812620857
    },
    "defillama": {
     "as_of": "2026-10-17T11:11:51Z",
     "price_usd": "2434.91",
     "confidence": 0.99,
     "staleness_s": 58
    }
   },
   "price_usd": "2433.056",
   "disclaimer": "Data only, not investment advice. Spot prices from public sources at one point in time; they can be stale, manipulated in thin pools, or wrong. No buy/sell signal is given or implied.",
   "spread_pct": 0.1524,
   "sources_agree_within_pct": 2.5
  },
  "next": [
   "token_risk"
  ],
  "skill": "token_price",
  "charged": true,
  "service": "token_price",
  "sources": [
   {
    "url": "https://coins.llama.fi/prices/current/base:0x4200000000000000000000000000000000000006",
    "name": "DeFiLlama coins API",
    "fetched_at": "2026-10-17T11:12:48Z"
   },
   {
    "url": "https://basescan.org/address/0x6c561b446416e1a00e8e93e221854d6ea4171372",
    "name": "Base on-chain pool (public RPC)",
    "block": 52723111,
    "fetched_at": "2026-10-17T11:12:48Z"
   }
  ],
  "summary": "WETH $2433.056 (2 sources, spread 0.15%) - data only, not advice",
  "version": "1.0.0",
  "warnings": [],
  "confidence": 0.975,
  "data_as_of": "2026-10-17T11:11:51Z",
  "disclaimer": "Data only, not investment advice. Spot prices from public sources at one point in time; they can be stale, manipulated in thin pools, or wrong. No buy/sell signal is given or implied.",
  "generated_at": "2026-10-17T11:12:49Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/token-price-lookup-base-erc-20-6f17ef58/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-micro-pay.com](https://www.zero.xyz/host/x402-micro-pay.com/llms.txt)
