Crypto market overview
GET /api/crypto-marketTop N coins by market capitalization with full market snapshot per coin: rank, price, 24h change, 7d change, 24h volume, market cap, circulating supply, and all-time high. Send GET /api/crypto-market with no required fields (2 optional) and pay $0.015 per call over x402 or MPP (there is no free tier). It returns a JSON object with currency, count and coins.
Default 10, max 100 per call. Backed by CoinGecko's public API.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | number | no | Number of coins to return (1-100, default 10) |
currency | string | no | vs_currency (default: usd) |
Example request
curl -i "https://agent402.tools/api/crypto-market?limit=10¤cy=usd"
Without payment this returns HTTP 402 Payment Required with the exact price for crypto-market; any x402 v2 or MPP client pays it and retries.
Example response
{
"currency": "usd",
"count": 2,
"coins": [
{
"rank": 1,
"id": "bitcoin",
"symbol": "btc",
"name": "Bitcoin",
"price": 67234.12,
"change24hPct": 1.42,
"change7dPct": 4.81,
"volume24h": 28100000000,
"marketCap": 1320000000000,
"circulatingSupply": 19700000,
"ath": 73750,
"athDate": "2024-03-14T07:10:36Z"
},
{
"rank": 2,
"id": "ethereum",
"symbol": "eth",
"name": "Ethereum",
"price": 3520.45,
"change24hPct": 2.18,
"change7dPct": 1.92,
"volume24h": 14200000000,
"marketCap": 423000000000,
"circulatingSupply": 120300000,
"ath": 4878.26,
"athDate": "2021-11-10T14:24:11Z"
}
]
}
| Field | Type | Always present | In the example |
|---|---|---|---|
currency | string | yes | usd |
count | number | yes | 2 |
coins | array of objects | yes | 2 items in the example |
From an MCP client
catalog.call {
"slug": "crypto-market",
"params": {
"limit": 10,
"currency": "usd"
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for crypto-market; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
- Every field is optional. An input the tool rejects returns an HTTP 4xx whose body carries
error,tool,expected,requiredandexample. - 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
POSTwith a JSON body to /api/crypto-market is served as this GET, with the body as the input. - 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/crypto-market?limit=10¤cy=usd");
Part of these workflows
Crypto market overview is one step in these 3 skill packs, each sold as a single call:
- DeFi protocol scanner - Due-diligence a DeFi protocol in one workflow: live token price, market context, protocol TVL across chains, and recent news - the on-chain and off-chain picture together.
- Macro dashboard refresh - The full macro + crypto dashboard in one call: 5 FRED series, 5 Treasury reads, yield-curve spread, crypto market/trending/global, and live gas - the 14-tool basket recurring buyers refresh every cycle, bundled below its a la carte price.
- Crypto research - Pull live price, market structure, OHLC history, trending status, global market context, and recent news for a single coin in one pass.
Related tools
Crypto global market
GET /api/crypto-globalGlobal crypto market snapshot: total market cap, total 24h volume, BTC dominance, ETH dominance, active coin count, acti…
Crypto price history
GET /api/crypto-historyHistorical price, market cap, and volume time series for a coin. Granularity is automatic per CoinGecko: <=1 day = 5-min…
Crypto price
GET /api/crypto-priceLive crypto prices for one or many coins in any vs_currency (usd, eur, btc, eth, etc). Returns last price, 24h change %,…
Crypto trending
GET /api/crypto-trendingTrending coins on CoinGecko in the last 24 hours, ranked by user search activity on the site (currently ~15 results). In…
Crypto market pulse
POST /api/crypto-market-pulseOne-call market snapshot across every perpetual listed on Hyperliquid: breadth (advancers, decliners, unchanged, mean/me…
DeFi TVL by chain
POST /api/defi-chainsBlockchains ranked by DeFi TVL from DefiLlama's free chain list: name, TVL in USD, share of total DeFi TVL, native token…