← 返回 Skills 市场
bryan-cmc

CoinMarketCap Crypto APIs

作者 CoinMarketCap · GitHub ↗ · v1.0.3
cross-platform ⚠ suspicious
665
总下载
1
收藏
2
当前安装
4
版本数
在 OpenClaw 中安装
/install cmc-api-crypto
功能描述
API reference for CoinMarketCap cryptocurrency endpoints including quotes, listings, OHLCV, trending, and categories. Use this skill whenever the user mentio...
使用说明 (SKILL.md)

CoinMarketCap Cryptocurrency API

This skill covers the CoinMarketCap Cryptocurrency API endpoints for retrieving price data, market listings, historical quotes, trending coins, and token metadata.

Authentication

All requests require an API key in the header.

curl -X GET "https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest" \
  -H "X-CMC_PRO_API_KEY: your-api-key"

Get your API key at: https://pro.coinmarketcap.com/login

Base URL

https://pro-api.coinmarketcap.com

Common Use Cases

See use-cases.md for goal-based guidance on which endpoint to use:

  1. Get current price of a token
  2. Find a token's CMC ID from symbol or name
  3. Get a token by contract address
  4. Get top 100 coins by market cap
  5. Find coins in a price range
  6. Get historical price at a specific date
  7. Build a price chart (OHLCV data)
  8. Find where a coin trades
  9. Get all-time high and distance from ATH
  10. Find today's biggest gainers
  11. Discover newly listed coins
  12. Get all tokens in a category (e.g., DeFi)

API Overview

Endpoint Description Reference
GET /v1/cryptocurrency/categories List all categories with market metrics categories.md
GET /v1/cryptocurrency/category Single category details categories.md
GET /v1/cryptocurrency/listings/historical Historical listings snapshot listings.md
GET /v1/cryptocurrency/listings/latest Current listings with market data listings.md
GET /v1/cryptocurrency/listings/new Newly added cryptocurrencies listings.md
GET /v1/cryptocurrency/map Map names/symbols to CMC IDs map.md
GET /v1/cryptocurrency/trending/gainers-losers Top gainers and losers trending.md
GET /v1/cryptocurrency/trending/latest Currently trending coins trending.md
GET /v1/cryptocurrency/trending/most-visited Most visited on CMC trending.md
GET /v2/cryptocurrency/info Static metadata (logo, description, URLs) info.md
GET /v2/cryptocurrency/market-pairs/latest Trading pairs for a coin market-pairs.md
GET /v2/cryptocurrency/ohlcv/historical Historical OHLCV candles ohlcv.md
GET /v2/cryptocurrency/ohlcv/latest Latest OHLCV data ohlcv.md
GET /v2/cryptocurrency/price-performance-stats/latest Price performance stats price-performance.md
GET /v2/cryptocurrency/quotes/latest Latest price quotes quotes.md
GET /v3/cryptocurrency/quotes/historical Historical price quotes quotes.md

Common Workflows

Get Token Price by Symbol

  1. First, map the symbol to a CMC ID using /v1/cryptocurrency/map
  2. Then fetch the price using /v2/cryptocurrency/quotes/latest
# Step 1: Get CMC ID for ETH
curl -X GET "https://pro-api.coinmarketcap.com/v1/cryptocurrency/map?symbol=ETH" \
  -H "X-CMC_PRO_API_KEY: your-api-key"

# Step 2: Get price quote (using id=1027 for ETH)
curl -X GET "https://pro-api.coinmarketcap.com/v2/cryptocurrency/quotes/latest?id=1027" \
  -H "X-CMC_PRO_API_KEY: your-api-key"

Get Top 100 Coins by Market Cap

curl -X GET "https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=100&sort=market_cap" \
  -H "X-CMC_PRO_API_KEY: your-api-key"

Get Historical Price Data

curl -X GET "https://pro-api.coinmarketcap.com/v3/cryptocurrency/quotes/historical?id=1&time_start=2024-01-01&time_end=2024-01-31&interval=daily" \
  -H "X-CMC_PRO_API_KEY: your-api-key"

Get Token Metadata

curl -X GET "https://pro-api.coinmarketcap.com/v2/cryptocurrency/info?id=1,1027" \
  -H "X-CMC_PRO_API_KEY: your-api-key"

Error Handling

HTTP Status Codes

Code Meaning
200 Success
400 Bad request (invalid parameters)
401 Unauthorized (invalid API key)
403 Forbidden (endpoint not available on your plan)
429 Rate limit exceeded
500 Server error

Rate Limits

Rate limits depend on your subscription plan. The response headers include:

  1. X-CMC_PRO_API_KEY_CREDITS_USED - Credits used this call
  2. X-CMC_PRO_API_KEY_CREDITS_LEFT - Credits remaining

Common Errors

Invalid ID: Ensure you use valid CMC IDs from the /map endpoint. Symbol lookups may return multiple matches.

Missing Required Parameter: Some endpoints require at least one identifier (id, slug, or symbol).

Plan Restrictions: Historical endpoints and some features require paid plans. Check your plan limits.

Error Response Format

{
  "status": {
    "timestamp": "2024-01-15T12:00:00.000Z",
    "error_code": 400,
    "error_message": "Invalid value for 'id'",
    "credit_count": 0
  }
}

Response Format

All responses follow this structure:

{
  "status": {
    "timestamp": "2024-01-15T12:00:00.000Z",
    "error_code": 0,
    "error_message": null,
    "credit_count": 1
  },
  "data": { ... }
}

Reference Files

See the references/ directory for complete parameter and response documentation for each endpoint.

安全使用建议
This is a documentation/reference skill (curl examples and endpoint descriptions) for the official CoinMarketCap pro API and appears internally consistent. It does not request or store credentials itself — you will need to supply your CoinMarketCap API key if you want the agent to run the provided curl commands. Before using the skill to make live requests: (1) only provide your API key when you trust the agent and environment, (2) avoid pasting your API key into public logs or shared chat, and (3) verify the agent will call the official base URL (https://pro-api.coinmarketcap.com) and not an unexpected third-party endpoint. If you want stricter control, keep the skill installed but do not provide the API key unless needed.
功能分析
Type: OpenClaw Skill Name: cmc-api-crypto Version: 1.0.3 The skill is classified as suspicious due to the explicit allowance of the 'Bash' tool in SKILL.md. While the skill's content and all `curl` examples are directed at the legitimate CoinMarketCap API for data retrieval (pro-api.coinmarketcap.com) and show no direct malicious intent, the ability to execute arbitrary shell commands via Bash introduces a significant vulnerability surface (e.g., RCE via prompt injection) if the AI agent's environment is not robustly sandboxed or if user input is not properly sanitized. There is no evidence of intentional malicious behavior within the provided files, but the high-risk capability warrants a 'suspicious' classification.
能力评估
Purpose & Capability
The name/description match the contents: the files are API reference docs and curl examples for CoinMarketCap crypto endpoints. Nothing requested (no env vars, no binaries, no installs) is disproportionate to an API reference.
Instruction Scope
SKILL.md contains concrete curl examples that show how to include an X-CMC_PRO_API_KEY header but does not declare or read any environment variables or system files. This is appropriate for a docs-only skill, but implementers/agents will need to supply an API key at runtime to actually make requests.
Install Mechanism
There is no install spec and no code files — lowest-risk instruction-only skill. Nothing is downloaded or written to disk by the skill itself.
Credentials
The skill does not request any credentials, config paths, or environment variables. The docs merely show a placeholder header value (your-api-key). This is proportionate for a reference.
Persistence & Privilege
always is false and the skill is user-invocable. It does not request permanent presence or modify other skills or system settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cmc-api-crypto
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cmc-api-crypto 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
- Added homepage and source links to the skill metadata for better discoverability and attribution. - Removed the unused requires-credentials section for improved clarity. - No changes to endpoints, usage, or workflows.
v1.0.2
- Added a requires-credentials section, specifying that users must provide a CoinMarketCap Pro API key and instructions on where to obtain it. - No other functional or content changes.
v1.0.1
Update display name
v1.0.0
Initial release of the CoinMarketCap Cryptocurrency API reference skill: - Provides detailed documentation for all major CMC REST endpoints, including quotes, listings, trending, categories, and more. - Covers authentication requirements, error handling, rate limits, and response formats. - Includes common workflow examples for tasks like getting token prices, metadata, and historical data. - Offers quick guidance on mapping symbols to IDs and integrating crypto price data programmatically. - References external documentation files for endpoint details.
元数据
Slug cmc-api-crypto
版本 1.0.3
许可证
累计安装 2
当前安装数 2
历史版本数 4
常见问题

CoinMarketCap Crypto APIs 是什么?

API reference for CoinMarketCap cryptocurrency endpoints including quotes, listings, OHLCV, trending, and categories. Use this skill whenever the user mentio... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 665 次。

如何安装 CoinMarketCap Crypto APIs?

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

CoinMarketCap Crypto APIs 是免费的吗?

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

CoinMarketCap Crypto APIs 支持哪些平台?

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

谁开发了 CoinMarketCap Crypto APIs?

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

💬 留言讨论