{"uid":"cap_rNsE0Em3yf9Avkb-FPjAH","slug":"onchain-query-api-spot-price-lookup-729cc975","name":"Onchain Query API – Spot Price Lookup","description":"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.","url":"https://chain.cyberwarex.com/price","method":"GET","headers":{},"bodySchema":{"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."}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Tz_GDqChGX4K65Rd7_4VP","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"What's the current USD price of ETH right now, including its 24-hour change and market cap?","exampleUseCases":[{"title":"DeFi portfolio valuation","prompt":"Can you look up the current USD price and 24h change for WBTC on Ethereum so I can update my portfolio tracker?"},{"title":"Token contract price check","prompt":"I have this Base token contract address 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 — what's its current USD price and liquidity?"},{"title":"Crypto price alert triage","prompt":"Check the current spot prices for ETH, SOL, and BTC including their 24-hour percent changes so I can see which one moved the most today."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:39:04.929Z","isFirstParty":false}