CoinGecko spot price
POST /api/price-coingeckoLive 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.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ids | array | string | yes | CoinGecko coin IDs (e.g. bitcoin, ethereum, solana): an array, or one comma-separated string. 1-25 entries. |
vsCurrency | string | no | Quote currency (default usd). Supports any CoinGecko vs_currencies value. |
include24hChange | boolean | no | Include 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"
}
]
}
| Field | Type | Always present | In the example |
|---|---|---|---|
count | number | yes | 2 |
vsCurrency | string | yes | usd |
prices | array of objects | yes | 2 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
idsis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/price-coingecko returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
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)
POST /api/token-priceReturn the current USD spot price for an ERC-20 token, identified by its contract address and network. Sourced from Alch…
Chain info snapshot
GET /api/chain-infoOne-call chain state snapshot: chain id, latest block number, and current gas price (wei + gwei) for Ethereum, Base, Pol…
Coin snapshot on a date
GET /api/coin-historyPrice, 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
GET /api/coin-price-by-contractLive price, market cap, 24h volume and 24h change for ERC-20 / SPL / other chain tokens looked up by CONTRACT ADDRESS on…
Crypto technical indicators
POST /api/crypto-indicatorsTechnical indicators for one perpetual computed deterministically from Hyperliquid candles: RSI(14), MACD(12,26,9) with …
Crypto market pulse
POST /api/crypto-market-pulseOne-call market snapshot across every perpetual listed on Hyperliquid: breadth (advancers, decliners, unchanged, mean/me…