# Onchain Query API – Spot Price Lookup

> Onchain Query API – Spot Price Lookup is a paid API for AI agents from chain.cyberwarex.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-01).

Returns current USD spot prices, 24h change, and market cap for one or more crypto assets identified by ticker, CoinGecko ID, or contract address.

## Facts

- Endpoint: GET https://chain.cyberwarex.com/prices?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchain-query-api-spot-price-lookup-25fb034a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vnAvQi-MroOZWb5xygNnq

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 onchain-query-api-spot-price-lookup-25fb034a
```

Example prompt: What are the current USD prices, 24h change, and market caps for ETH, BTC, and UNI right now?

## When to prefer this

Choose this endpoint when you need a fast, keyless, pay-per-call USD spot price for one or more crypto assets without managing RPC nodes or API keys. It accepts tickers, CoinGecko IDs, and 0x contract addresses interchangeably and returns market cap and 24h change alongside the price — making it ideal for portfolio snapshots, DeFi agent decision loops, and token enrichment flows. Prefer alternatives if you need historical OHLCV data, order book depth, or non-EVM chain prices.

## Known failure modes

- Symbol not found or unresolvable — returns an error field on that item rather than price data
- More than 20 symbols requested at once — likely returns an error or partial result
- Invalid ticker or malformed contract address — may return null price or error
- CoinGecko upstream outage — price_usd may be null
- Payment not completed (x402) — 402 Payment Required response before data is returned

## How this service works

Pay-per-call EVM chain data for agents: wallet snapshots, ERC-20 token profiles, spot prices, gas markets, transaction decode, and ENS resolution across major EVM chains (base, ethereum, arbitrum, optimism, polygon). Deterministic JSON, no RPC keys or node infra needed.

## Output

A JSON object containing a count of queried symbols, the number successfully resolved, and an array of price records — each with the original query string, source (e.g. coingecko), price_usd, change_24h_pct, market_cap_usd, and coingecko_id. Unresolvable symbols include an error field instead of price data.

## 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": [
      "symbols"
     ],
     "properties": {
      "symbols": {
       "type": "string",
       "description": "Comma-separated tickers / CoinGecko ids / 0x addresses (max 20)."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "count": {
       "type": "integer"
      },
      "prices": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "error": {
          "type": "string"
         },
         "query": {
          "type": "string"
         },
         "source": {
          "type": "string"
         },
         "price_usd": {
          "type": [
           "number",
           "null"
          ]
         },
         "coingecko_id": {
          "type": "string"
         },
         "change_24h_pct": {
          "type": [
           "number",
           "null"
          ]
         },
         "market_cap_usd": {
          "type": [
           "number",
           "null"
          ]
         }
        }
       }
      },
      "resolved": {
       "type": "integer",
       "description": "How many symbols got a price."
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 2,
  "prices": [
   {
    "query": "eth",
    "source": "coingecko",
    "price_usd": 2456.1,
    "coingecko_id": "ethereum",
    "change_24h_pct": -1.2,
    "market_cap_usd": 296000000000
   },
   {
    "query": "btc",
    "source": "coingecko",
    "price_usd": 61230.5,
    "coingecko_id": "bitcoin",
    "change_24h_pct": 0.4,
    "market_cap_usd": 1210000000000
   }
  ],
  "resolved": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchain-query-api-spot-price-lookup-25fb034a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chain.cyberwarex.com](https://www.zero.xyz/host/chain.cyberwarex.com/llms.txt)
