返回 Skill 市集

Market Data

cmc-api-crypto

This skill documents the CoinMarketCap (CMC) Cryptocurrency REST API for programmatic access to market and token data. It details authentication (API key via X-CMC_PRO_API_KEY), base URL, and endpoints for listings (latest, historical, new), quotes, OHLCV/candles for charts, trending (gainers/losers

45 天前更新1 分鐘內設定完

總覽

This skill documents the CoinMarketCap (CMC) Cryptocurrency REST API for programmatic access to market and token data.

This skill documents the CoinMarketCap (CMC) Cryptocurrency REST API for programmatic access to market and token data. It details authentication (API key via X-CMC_PRO_API_KEY), base URL, and endpoints for listings (latest, historical, new), quotes, OHLCV/candles for charts, trending (gainers/losers), categories, mapping names/symbols/contract addresses to CMC IDs, and market metadata. Use it to fetch current prices, build price charts, backfill historical quotes, identify top movers, discover newly listed tokens, locate trading pairs, or filter coins by market cap/category. Core advantages include a single authoritative source of normalized crypto market data, pagination and filtering for large queries, and precise token identification—ideal for dashboards, trading bots, analytics pipelines, alerts, and integrations requiring reliable market metrics.

Skill.md

這個 Skill 如何運作

This skill documents the CoinMarketCap (CMC) Cryptocurrency REST API for programmatic access to market and token data. It details authentication (API key via X-CMC_PRO_API_KEY), base URL, and endpoints for listings (latest, historical, new), quotes, OHLCV/candles for charts, trending (gainers/losers

SKILL.mdALPHIO / 已驗證

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

EndpointDescriptionReference
GET /v1/cryptocurrency/categoriesList all categories with market metricscategories.md
GET /v1/cryptocurrency/categorySingle category detailscategories.md
GET /v1/cryptocurrency/listings/historicalHistorical listings snapshotlistings.md
GET /v1/cryptocurrency/listings/latestCurrent listings with market datalistings.md
GET /v1/cryptocurrency/listings/newNewly added cryptocurrencieslistings.md
GET /v1/cryptocurrency/mapMap names/symbols to CMC IDsmap.md
GET /v1/cryptocurrency/trending/gainers-losersTop gainers and loserstrending.md
GET /v1/cryptocurrency/trending/latestCurrently trending coinstrending.md
GET /v1/cryptocurrency/trending/most-visitedMost visited on CMCtrending.md
GET /v2/cryptocurrency/infoStatic metadata (logo, description, URLs)info.md
GET /v2/cryptocurrency/market-pairs/latestTrading pairs for a coinmarket-pairs.md
GET /v2/cryptocurrency/ohlcv/historicalHistorical OHLCV candlesohlcv.md
GET /v2/cryptocurrency/ohlcv/latestLatest OHLCV dataohlcv.md
GET /v2/cryptocurrency/price-performance-stats/latestPrice performance statsprice-performance.md
GET /v2/cryptocurrency/quotes/latestLatest price quotesquotes.md
GET /v3/cryptocurrency/quotes/historicalHistorical price quotesquotes.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

CodeMeaning
200Success
400Bad request (invalid parameters)
401Unauthorized (invalid API key)
403Forbidden (endpoint not available on your plan)
429Rate limit exceeded
500Server 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 skill documents the CoinMarketCap (CMC) Cryptocurrency REST API for programmatic access to market and token data. It details authentication (API key via X-CMC_PRO_API_KEY), base URL, and endpoints for listings (latest, historical, new), quotes, OHLCV/candles for charts, trending (gainers/losers

01 · 會前準備

準備決策簡報

在投資委員會開會前,把零散證據整理成結構化的論據。

02 · 團隊協作

統一交接標準

讓分析師、投資組合經理與 Agent 產出一致的研究結果。

03 · 即時更新

更新投資邏輯

出現新催化劑、KPI 發布或財報結果後,更新情境假設。

社群回饋

越用越好用。

隨著 Skill 被使用與評審,回饋將顯示在這裡。

提交回饋

探索更多

相關 Skills

查看全部
免費開始