CoinGecko spot price

$0.001 per call · USDC via x402 · POST /api/price-coingecko

Live spot price for up to 25 coins by CoinGecko id, one row per id in the order asked: prices[] of {id, price, change24h, lastUpdated}. Send POST /api/price-coingecko with the required field ids and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with count, vsCurrency and prices.

Identify coins by their CoinGecko ID slug (bitcoin, ethereum, solana, usd-coin, ...), as an array or a comma-separated string; for ticker symbols (BTC, ETH) plus volume and market cap use crypto-price. Defaults to USD; pass vsCurrency to denominate in EUR, JPY, ETH, BTC, etc. change24h is filled only when include24hChange is true. An id CoinGecko does not know comes back with a null price and is listed in unknown.

Category: Crypto & onchain data · Tags: crypto price coingecko spot market

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
idsarray | stringyesCoinGecko coin IDs (e.g. bitcoin, ethereum, solana): an array, or one comma-separated string. 1-25 entries.
vsCurrencystringnoQuote currency (default usd). Supports any CoinGecko vs_currencies value.
include24hChangebooleannoInclude 24h % change in the response (default false).

Example request

curl -i -X POST https://agent402.tools/api/price-coingecko \
  -H "Content-Type: application/json" \
  -d '{"ids":["bitcoin","ethereum"]}'

Without payment this returns HTTP 402 Payment Required with the exact price for price-coingecko; any x402 v2 or MPP client pays it and retries.

Example response

{
  "count": 2,
  "vsCurrency": "usd",
  "prices": [
    {
      "id": "bitcoin",
      "price": 67000.12,
      "change24h": null,
      "lastUpdated": "2026-09-24T14:50:20.000Z"
    },
    {
      "id": "ethereum",
      "price": 3500.05,
      "change24h": null,
      "lastUpdated": "2026-09-24T14:50:20.000Z"
    }
  ]
}
FieldTypeAlways presentIn the example
countnumberyes2
vsCurrencystringyesusd
pricesarray of objectsyes2 items in the example

From an MCP client

catalog.call {
  "slug": "price-coingecko",
  "params": {
    "ids": [
      "bitcoin",
      "ethereum"
    ]
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for price-coingecko; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

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

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/price-coingecko", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "ids": [
      "bitcoin",
      "ethereum"
    ]
  }),
});

Related tools

Token spot price (USD)

$0.001 · POST /api/token-price

Return the current USD spot price for an ERC-20 token, identified by its contract address and network. Sourced from Alch…

Chain info snapshot

$0.001 · GET /api/chain-info

One-call chain state snapshot: chain id, latest block number, and current gas price (wei + gwei) for Ethereum, Base, Pol…

Coin snapshot on a date

$0.005 · GET /api/coin-history

Price, market cap and 24h volume of a coin on ONE past date (00:00 UTC snapshot), in every currency at once plus your ch…

Token price by contract address

$0.005 · GET /api/coin-price-by-contract

Live price, market cap, 24h volume and 24h change for ERC-20 / SPL / other chain tokens looked up by CONTRACT ADDRESS on…

Crypto technical indicators

$0.002 · POST /api/crypto-indicators

Technical indicators for one perpetual computed deterministically from Hyperliquid candles: RSI(14), MACD(12,26,9) with …

Crypto market pulse

$0.004 · POST /api/crypto-market-pulse

One-call market snapshot across every perpetual listed on Hyperliquid: breadth (advancers, decliners, unchanged, mean/me…