Crypto categories by market cap
GET /api/coin-categoriesCoin categories (Layer 1, Meme, AI, DeFi, Stablecoins, RWA, ...) ranked by market cap, with 24h market cap change %, 24h volume and the top-3 coins per category. Send GET /api/coin-categories with no required fields (3 optional) and pay $0.005 per call over x402 or MPP (there is no free tier). It returns a JSON object with source, fetchedAt, cached, order, count and 2 more.
Order by market_cap_desc (default), market_cap_asc, market_cap_change_24h_desc/asc, name_asc/desc; optional `query` substring filter on category name/id; limit 1-100 (default 25). The sector-rotation view: which narratives are gaining or bleeding today. Cached in-process for 5 minutes.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
order | string | no | market_cap_desc (default), market_cap_asc, market_cap_change_24h_desc, market_cap_change_24h_asc, name_asc, name_desc. |
limit | number | no | 1-100 (default 25). |
query | string | no | Optional case-insensitive substring filter on the category name or id (e.g. "meme", "layer-2"). |
Example request
curl -i "https://agent402.tools/api/coin-categories?order=market_cap_desc&limit=10"
Without payment this returns HTTP 402 Payment Required with the exact price for coin-categories; any x402 v2 or MPP client pays it and retries.
Example response
{
"source": "coingecko",
"fetchedAt": "2026-08-22T13:20:00.000Z",
"cached": false,
"order": "market_cap_desc",
"count": 1,
"totalCategories": 400,
"categories": [
{
"rank": 1,
"id": "smart-contract-platform",
"name": "Smart Contract Platform",
"marketCap": 2261471553524.96,
"marketCapChange24hPct": 1.1784,
"volume24h": 95000000000,
"topCoins": [
"bitcoin",
"ethereum",
"solana"
],
"updatedAt": "2026-08-22T13:15:00.000Z"
}
]
}
| Field | Type | Always present | In the example |
|---|---|---|---|
source | string | yes | coingecko |
fetchedAt | string | yes | 2026-08-22T13:20:00.000Z |
cached | boolean | yes | false |
order | string | yes | market_cap_desc |
count | number | yes | 1 |
totalCategories | number | yes | 400 |
categories | array of objects | yes | 1 item in the example |
From an MCP client
catalog.call {
"slug": "coin-categories",
"params": {
"order": "market_cap_desc",
"limit": 10
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for coin-categories; 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 (
Authorization: Bearer a402_...) also pays it. - A
POSTwith a JSON body to /api/coin-categories 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/coin-categories?order=market_cap_desc&limit=10");
Related tools
Global DeFi market
GET /api/global-defiGlobal DeFi snapshot: DeFi market cap (USD), ETH market cap, DeFi-to-ETH ratio, 24h DeFi trading volume, DeFi dominance …
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…
Coin search
GET /api/coin-searchResolve a name or ticker to coin ids: full-text search returning matching coins (id, symbol, name, market cap rank, orde…
Crypto news headlines
POST /api/crypto-newsLatest crypto headlines aggregated from the public RSS/Atom feeds of 8 major outlets (coindesk, cointelegraph, decrypt, …
DeFi chain TVL history
POST /api/defi-chain-tvl-historyDaily TVL history for one chain (Ethereum, Base, Solana, Arbitrum...) or for all of DeFi (chain "all") from DefiLlama's …
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…