← 返回 Skills 市场
bryan-cmc

CoinMarketCap x402 APIs

作者 CoinMarketCap · GitHub ↗ · v1.0.1
cross-platform ⚠ suspicious
476
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install cmc-x402
功能描述
Access CoinMarketCap data via x402 pay-per-request protocol with USDC payments on Base. Use when users mention x402, want CMC data without API keys, ask abou...
使用说明 (SKILL.md)

CoinMarketCap x402

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.

What is x402?

x402 is an open payment protocol developed by Coinbase that enables automatic stablecoin payments over HTTP. Instead of managing API keys, you pay $0.01 USDC per request on Base. The x402 client library handles payment signing automatically.

Learn more: https://docs.x402.org

Prerequisites

Before using x402 endpoints, ensure you have:

  1. Node.js 18+ and npm installed
  2. Base network wallet with a private key you control
  3. USDC on Base to pay for requests ($0.01 per request)
  4. Small amount of ETH on Base for gas fees

Use Cases

Get current prices for specific coins: Use /x402/v3/cryptocurrency/quotes/latest with symbol or id parameter. Example: Get BTC and ETH prices for a portfolio tracker.

List top cryptocurrencies: Use /x402/v3/cryptocurrency/listing/latest with limit parameter. Example: Display top 100 coins ranked by market cap.

Search for DEX tokens: Use /x402/v1/dex/search with keyword parameter. Example: Find a memecoin by name when you don't know the contract address.

Get DEX pair trading data: Use /x402/v4/dex/pairs/quotes/latest with pair address. Example: Monitor liquidity and volume for a specific Uniswap pool.

AI agent data access: Use the MCP endpoint at https://mcp.coinmarketcap.com/x402/mcp. Example: Let Claude or other LLMs fetch live crypto data with automatic payment.

Quick Start

Install the x402 TypeScript SDK:

npm install @x402/axios @x402/evm viem

Fetch data with automatic payment:

import { createX402AxiosClient } from "@x402/axios";
import { ExactEvmScheme, toClientEvmSigner } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
import { createPublicClient, http } from "viem";
import { base } from "viem/chains";

// SECURITY: Never hardcode private keys in source code.
// Use environment variables: process.env.PRIVATE_KEY
// For production, use a dedicated hot wallet with limited funds.
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const publicClient = createPublicClient({ chain: base, transport: http() });
const signer = toClientEvmSigner(account, publicClient);

const client = createX402AxiosClient({
  schemes: [new ExactEvmScheme(signer)],
});

const response = await client.get(
  "https://pro.coinmarketcap.com/x402/v3/cryptocurrency/quotes/latest",
  { params: { symbol: "BTC,ETH" } }
);

console.log(response.data);

Endpoints

Base URL: https://pro.coinmarketcap.com

Endpoint Path Use For
Quotes /x402/v3/cryptocurrency/quotes/latest Current prices for specific coins
Listings /x402/v3/cryptocurrency/listing/latest Top coins by market cap
DEX Search /x402/v1/dex/search Find DEX tokens by keyword
DEX Pairs /x402/v4/dex/pairs/quotes/latest DEX pair trading data

All parameters from the standard CMC Pro API work with x402 endpoints. See endpoints.md for full parameter reference.

MCP for AI Agents

The x402 MCP endpoint lets AI agents access CMC data with automatic payment.

Connection URL:

https://mcp.coinmarketcap.com/x402/mcp

Transport: Streamable HTTP (POST)

Connect using any MCP client with an x402-aware HTTP transport. The server exposes the same tools as the REST endpoints and supports automatic tool discovery.

Pricing

$0.01 USDC per request on Base (Chain ID: 8453).

Payment only occurs on successful data delivery. If the request fails, no payment is deducted.

References

Resources

安全使用建议
This skill appears to be a legitimate x402 client for CoinMarketCap, but before installing: (1) Understand it requires a Base wallet private key and funds (USDC + gas) to pay ~ $0.01 per request — do NOT use your main or high-value wallet. Create a dedicated hot wallet with minimal funds. (2) The skill's registry metadata does NOT declare the PRIVATE_KEY env var even though SKILL.md expects process.env.PRIVATE_KEY — ask the publisher to update metadata, and be cautious about where you set that env var. (3) Verify the payment recipient address (0x271189c860DB25bC43173B0335784aD68a680908) and USDC contract address in the docs before funding anything. (4) If you will run code, inspect and verify the npm packages/@x402 packages and versions before npm install. (5) Test with tiny amounts first and rotate the wallet if you suspect misuse. If you are not comfortable providing a private key or funding a wallet, do not install or use this skill.
功能分析
Type: OpenClaw Skill Name: cmc-x402 Version: 1.0.1 The skill is designed to access CoinMarketCap data via a pay-per-request protocol, which inherently requires on-chain USDC payments. The `SKILL.md` documentation and embedded TypeScript code explicitly instruct the AI agent to read a private key from `process.env.PRIVATE_KEY` to sign these transactions. While this action is necessary for the skill's stated purpose and there is no evidence of intentional malicious behavior (e.g., exfiltration of the key, unauthorized transactions), requiring an AI agent to handle a private key directly from its environment represents a significant security risk and vulnerability. This design choice, though transparent, makes the skill suspicious due to the high potential for misuse or compromise of sensitive cryptographic material.
能力评估
Purpose & Capability
The skill's stated purpose (accessing CMC via x402 with on-chain USDC payments) matches the SKILL.md content: it requires a Base wallet/private key, USDC on Base, and Node/npm to run the x402 client. Requiring a wallet and small payments is proportionate for x402-based access. However, the registry metadata lists no required env vars or primary credential even though the instructions explicitly reference a PRIVATE_KEY environment variable and npm dependencies — this metadata mismatch is unexpected.
Instruction Scope
SKILL.md gives concrete runtime instructions that instruct the agent/user to install npm packages (@x402/axios, @x402/evm, viem), to use process.env.PRIVATE_KEY for the wallet, to construct signatures and send PAYMENT-SIGNATURE headers, and to pay 0.01 USDC per request. Those steps are within the declared purpose but they require handling a sensitive private key and performing on-chain payments. The instructions do not request unrelated files, but they do rely on a private key that the registry metadata did not declare — granting broad runtime discretion about key use is a scope concern.
Install Mechanism
This is an instruction-only skill with no install spec. It asks the user/agent to npm install several packages from public registries. That is reasonable for a Node-based x402 client, but because there's no packaged install spec the environment must be prepared manually; verify package names/versions and source before installing.
Credentials
The SKILL.md expects a PRIVATE_KEY environment variable and requires an on-chain wallet funded with USDC and some ETH for gas. Those requirements are proportionate to pay-per-request behavior, but the skill metadata declares no required env vars or primary credential. The presence of a hardcoded payment recipient address (0x271189c860DB25bC43173B0335784aD68a680908) and USDC contract address in payment-details.md is normal for a payment flow but is sensitive information the user should verify. The omission of declared required credentials in metadata is a mismatch and a red flag.
Persistence & Privilege
The skill is not marked always:true, is user-invocable, and is instruction-only with no install-time persistency specified. It does not request elevated persistent privileges or attempt to modify other skills or system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cmc-x402
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cmc-x402 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Added homepage and source fields to SKILL metadata for improved discoverability and reference. - No changes to core functionality or SDK usage.
v1.0.0
- Initial release of the cmc-x402 skill. - Enables pay-per-request access to CoinMarketCap data using the x402 protocol with on-chain USDC payments. - No API key or subscription required; payments are $0.01 USDC per request on Base. - Provides SDK integration example and usage instructions. - Supports endpoints for cryptocurrency quotes, listings, DEX search, and DEX pair data. - Includes guidance for AI agents to access CMC data via the x402 MCP endpoint.
元数据
Slug cmc-x402
版本 1.0.1
许可证
累计安装 1
当前安装数 1
历史版本数 2
常见问题

CoinMarketCap x402 APIs 是什么?

Access CoinMarketCap data via x402 pay-per-request protocol with USDC payments on Base. Use when users mention x402, want CMC data without API keys, ask abou... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 476 次。

如何安装 CoinMarketCap x402 APIs?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cmc-x402」即可一键安装,无需额外配置。

CoinMarketCap x402 APIs 是免费的吗?

是的,CoinMarketCap x402 APIs 完全免费(开源免费),可自由下载、安装和使用。

CoinMarketCap x402 APIs 支持哪些平台?

CoinMarketCap x402 APIs 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 CoinMarketCap x402 APIs?

由 CoinMarketCap(@bryan-cmc)开发并维护,当前版本 v1.0.1。

💬 留言讨论