Pay-per-request crypto market data powered by the x402 protocol. Access CoinMarketCap endpoints instantly with on-chain USDC payment — no API key or subscription required.
Pricing, features, and availability may change without prior notice. For production workloads, we recommend using the standard CoinMarketCap Pro API with an API key subscription.
What is x402?
x402 is an open payment protocol developed by Coinbase that enables instant, automatic stablecoin payments directly over HTTP. Instead of managing API keys and subscriptions, you pay per request using USDC on Base. Learn more at the x402 documentation.
How it works
Make a request to any x402-enabled endpoint. The server responds with HTTP 402 and a Payment-Required header containing the payment details (amount, network, asset, recipient).
Your wallet signs a USDC transferWithAuthorization (EIP-3009) message for the requested amount. This is an off-chain signature — no on-chain transaction occurs yet.
Resend the original request with the signed PAYMENT-SIGNATURE header attached. The facilitator verifies the signature, the server processes your request, and you receive the data. The on-chain USDC transfer is only executed upon successful data delivery.
x402 endpoints do not require X-CMC_PRO_API_KEY or any other authentication header. Payment is the authentication.
MCP endpoint
The /x402/mcp endpoint exposes a Model Context Protocol server that supports x402 payments at the HTTP transport layer. This enables AI agents and LLM clients (e.g., Claude, Cursor) to discover and call CMC data tools with automatic per-request payment.
Connection URL:
Code
Transport: Streamable HTTP (POST to /x402/mcp)
To connect, use any MCP-compatible client with an x402-aware HTTP transport that intercepts 402 responses, signs the payment, and retries. The MCP server exposes the same data tools as the REST endpoints below, and supports automatic tool discovery via the standard MCP tools/list method.
For standard MCP documentation, see CMC MCP.
Base URL
All x402 requests use the following base URL:
Code
Supported REST endpoints
| Endpoint | Method | Path | Description |
|---|---|---|---|
| DEX Search | GET | /x402/v1/dex/search | Search for DEX tokens by keyword (name, symbol, or contract address). |
| Cryptocurrency Quotes Latest | GET | /x402/v3/cryptocurrency/quotes/latest | Get the latest market quotes for one or more cryptocurrencies. |
| Cryptocurrency Listing Latest | GET | /x402/v3/cryptocurrency/listings/latest | Get a paginated list of all active cryptocurrencies with latest market data, ranked by market cap. |
| DEX Pairs Quotes Latest | GET | /x402/v4/dex/pairs/quotes/latest | Get the latest quotes and trading data for specific DEX trading pairs. |
All parameters supported by the standard CoinMarketCap Pro API endpoints are also supported in their x402 counterparts. Refer to the linked documentation for full parameter details, limits, and response schemas. You can download the full list of IDs in a CSV file here.
Request examples
Example 1: Search DEX tokens by keyword:
Code
Example 2: Get latest quotes for Bitcoin and Ethereum by CoinMarketCap ID:
Code
Example 3: Get the top 10 cryptocurrencies by market cap:
Code
Example 4: Get latest DEX pair quotes:
Code
Example 5: Using curl with a pre-signed payment header:
Code
Pricing and payment
Current price: $0.01 USDC per API request across all supported endpoints.
Pricing is subject to change without prior notice. Always parse the Payment-Required response header for the current amount before signing.
Supported payment network:
- Base (Chain ID: 8453)
Payment asset:
- USDC on Base (
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)
Payment method:
- EIP-3009
transferWithAuthorization— your wallet signs an off-chain authorization, and the facilitator executes the on-chain transfer only upon successful data delivery.
402 response format
When a request is made without a valid PAYMENT-SIGNATURE, the server returns HTTP 402 with a base64-encoded Payment-Required header:
Code
| Field | Description |
|---|---|
scheme | Payment scheme, currently exact (EIP-3009 transferWithAuthorization) |
network | Target chain in CAIP-2 format (eip155:8453 = Base Mainnet) |
asset | USDC contract address on Base |
amount | Payment amount in smallest unit (10000 = $0.01 USDC, 6 decimals) |
payTo | Recipient address for the payment |
maxTimeoutSeconds | Maximum validity window for the signed authorization |
extra.name | EIP-712 domain name for the token (must be "USD Coin" for USDC on Base) |
extra.version | EIP-712 domain version for the token |
Quick start
Using the x402 TypeScript SDK
Install dependencies:
Code
Example — fetch DEX search results with automatic x402 payment:
Code
Using curl (manual flow)
Code
Important notes
- No API key required — x402 payment replaces traditional API key authentication.
- Pay only on success — the on-chain USDC transfer is executed only when the server successfully returns data. If the server encounters an error, no payment is deducted.
- Authorization expiry — signed authorizations expire after
maxTimeoutSeconds(typically 30s). Unused authorizations are never submitted on-chain. - EIP-712 domain — when constructing the
transferWithAuthorizationsignature, usename: "USD Coin"andversion: "2"for the USDC token domain on Base. - Rate limits — x402 endpoints may have separate rate limits from the standard Pro API. Refer to the
Payment-Requiredresponse for the latest terms.