# 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-09-13).

Returns the current USD spot price, 24h change, and market cap for any crypto asset identified by ticker symbol, CoinGecko ID, or EVM token contract address.

## Facts

- Endpoint: GET https://chain.cyberwarex.com/price
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchain-query-api-spot-price-lookup-729cc975
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rNsE0Em3yf9Avkb-FPjAH

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-729cc975
```

Example prompt: What's the current USD price of ETH right now, including its 24-hour change and market cap?

## When to prefer this

Use this endpoint when you need a quick, pay-per-call USD spot price for any crypto asset — especially when you have a ticker symbol, CoinGecko ID, or an EVM token contract address on Base, Ethereum, Arbitrum, Optimism, or Polygon. It is ideal for agents that need lightweight, on-demand price checks without maintaining a WebSocket or subscription. Prefer this over full market data APIs when you only need spot price, 24h change, and market cap for a single asset per call.

## Known failure modes

- Unknown ticker or CoinGecko ID returns null price or 404
- Invalid contract address format returns an error
- Token has no liquidity or price data — price_usd returns null
- Unsupported chain enum value causes validation error
- Rate limiting or payment failure returns 402 Payment Required
- Stale cache (up to 60s) may not reflect very recent price movements

## How this service works

Spot USD price for any crypto asset. Accepts a ticker symbol (eth, btc, sol), a CoinGecko id (ethereum), or an EVM token contract address. Returns the USD price plus 24h change, with market cap for listed assets, or liquidity, 24h volume and the top DEX pair for contract addresses. Cached 60 seconds so repeated calls in one agent workflow stay consistent with each other.

## Output

A JSON object containing the queried asset identifier, USD spot price, 24h price change percentage, market cap in USD, data source (CoinGecko or DexScreener), and — for contract address queries — liquidity USD, volume 24h USD, and top trading pair details. Results are cached for 60 seconds.

## 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": [
      "query"
     ],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum",
        "arbitrum",
        "optimism",
        "polygon"
       ],
       "type": "string",
       "default": "base",
       "description": "EVM chain to query."
      },
      "query": {
       "type": "string",
       "description": "Ticker symbol, CoinGecko id, or 0x token contract address."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "query": {
       "type": "string"
      },
      "source": {
       "type": "string",
       "description": "coingecko or dexscreener."
      },
      "top_pair": {
       "type": "object",
       "description": "Only for contract-address queries."
      },
      "price_usd": {
       "type": [
        "number",
        "null"
       ]
      },
      "coingecko_id": {
       "type": "string"
      },
      "liquidity_usd": {
       "type": "number",
       "description": "Only for contract-address queries."
      },
      "change_24h_pct": {
       "type": [
        "number",
        "null"
       ]
      },
      "market_cap_usd": {
       "type": [
        "number",
        "null"
       ]
      },
      "volume_24h_usd": {
       "type": "number",
       "description": "Only for contract-address queries."
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchain-query-api-spot-price-lookup-729cc975/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)
