agentsvc.io

services / crypto-prices

financeoperational · 376 ms

Crypto Price Lookup

Crypto prices in USD and other currencies. Three modes: (1) coins as CoinGecko IDs or tickers (up to 50) for live price, 24h change and market cap in the requested currencies; (2) tokens as chain:address (e.g. base:0x833589fC…, ethereum:0x6982…) for any DEX-traded token; (3) at (past ISO date or unix seconds) for historical USD prices of coins and tokens. Params: coins, tokens, currencies (default ['usd']), at.

Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/crypto-prices", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"coins":["bitcoin","ethereum"],"currencies":["usd"]}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
tokensarrayTokens as chain:address, e.g. base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
atstringPast ISO date or unix seconds for historical USD prices
coinsarrayList of coin IDs or ticker symbols. Accepts CoinGecko IDs (e.g. 'bitcoin', 'ethereum') or common tickers (e.g. 'BTC', 'ETH', 'SOL'). Max 25 coins per call.
currenciesarray = ["usd"]Target fiat currencies. Default: ['usd']. Supported: usd, eur, gbp, jpy, chf, aud, cad, btc, eth.

Output

FieldTypeDescription
pricesobjectMap of coin_id → price data. Each entry contains price(s) in requested currencies, 24h change, and market cap.
fetched_atstringISO 8601 timestamp of the data
sourcestringAlways: 'CoinGecko'
not_foundarrayCoin IDs or tickers that could not be resolved

Example response (data)

{
  "prices": {
    "bitcoin": {
      "name": "Bitcoin",
      "symbol": "BTC",
      "usd": 71923,
      "usd_24h_change": 1.42,
      "usd_market_cap": 1419000000000
    },
    "ethereum": {
      "name": "Ethereum",
      "symbol": "ETH",
      "usd": 2188,
      "usd_24h_change": 0.41,
      "usd_market_cap": 263000000000
    }
  },
  "fetched_at": "2026-04-10T14:00:00.000Z",
  "source": "CoinGecko",
  "not_found": []
}