CoinGecko Skill
When to use
Trigger this skill when the user's request matches any of the following:
Crypto market data queries
- - Coin/token prices, market caps, trading volume, price changes
- Historical price data, OHLC charts, time-range queries
- Circulating or total supply data
- Global crypto market stats (total market cap, BTC dominance, DeFi TVL)
- Trending coins, top gainers/losers, newly listed coins
Token and contract lookups
- - Looking up a token by its contract address (e.g.
0x...) - Token metadata, categories, or platform info
- Comparing multiple coins or tokens
Exchange and trading data
- - Exchange listings, volume, tickers, trust scores
- DEX-specific data (Uniswap, PancakeSwap, etc.)
- Derivatives exchanges and tickers (futures, perpetuals)
On-chain / DeFi data (GeckoTerminal)
- - Liquidity pool data, trending/new pools, pool search
- On-chain token prices, holder data, top traders
- OHLCV candles or trade history for specific pools or tokens
- DEX and network discovery (supported chains, DEXes)
- On-chain pool categories and filtering
NFT data
- - NFT collection prices, floor prices, market data
- NFT collection charts and tickers
Other triggers
- - Building dashboards, visualizations, or apps with crypto data
- Questions about CoinGecko or GeckoTerminal API capabilities, endpoints, or rate limits
- API key setup, authentication, plan tiers, or pricing questions
- "What crypto data is available?" or similar exploratory questions
- User mentions CoinGecko, GeckoTerminal, or shares a CoinGecko URL
- Investment calculators, portfolio trackers, or ROI calculations involving crypto
- Public company/institution crypto treasury holdings (e.g. "how much BTC does MicroStrategy hold?")
You have access to the CoinGecko API (aggregated data) and the GeckoTerminal API
(on-chain DEX data). Together they cover virtually all crypto market data needs.
Both APIs share the same API key and plan tier. GeckoTerminal endpoints use the
same base URL as CoinGecko plus an
/onchain path prefix (details in
references/core.md).
STRICT RULE — All market data must come from live API calls
Never answer questions about crypto prices, market caps, volumes, supply, TVL, exchange
rates, or any time-sensitive market data using training knowledge. These figures change
by the minute — training data is months or years stale and will be wrong.
If an API call fails or has not been attempted yet, you MUST:
- 1. Stop. Do not answer the data question.
- Tell the user the data could not be fetched (or hasn't been fetched yet).
- Diagnose the failure and direct them to fix it (missing allowlist, wrong key, etc.).
Do NOT say "based on my knowledge", "approximately", or cite any price/market figure from
memory. The only acceptable source for market data is a successful live API response.
Bad: "The domain is blocked… However, I have reliable data. Bitcoin today: ~$87,000"
(actual price was ~$69,000 — Claude fabricated a confident, wrong answer)
Good: "The API call failed because the domain is blocked. Let me walk you through
adding it to your allowlist so we can fetch the live data."
Workflow
Follow these steps in strict order. Do NOT skip ahead. Do NOT write code, plan an
architecture, or make any API call until the blocking steps are fully resolved.
Step 0a — Claude environment check (BLOCKING — Claude only)
If you are running inside Claude (claude.ai), read references/claude-env.md first.
It documents two platform constraints that break all CoinGecko API calls:
- 1. Domain allowlist — the user must add
api.coingecko.com and
pro-api.coingecko.com at
claude.ai/settings/capabilities.
If this is the user's first time or any call fails with a network error, pause and
walk them through it before debugging anything else.
- 2. Artifact sandbox —
fetch() inside Artifacts will always fail silently.
Default to bash_tool with curl for all CoinGecko API calls, then embed
results as static data into any Artifact or visualization. This is the standard
approach, not a fallback.
Skip this step if not running inside Claude.
Step 0b — Confirm credentials (BLOCKING)
STOP. Before doing anything else, you must resolve the user's API tier. This is a hard
prerequisite — not a suggestion, not something to revisit later, and not something to skip
because "keyless should work for this request."
Why this exists: Keyless and Demo tiers have restrictions that silently break multi-step
tasks. Example failure pattern:
User: "If I invested in Bitcoin 5 years ago, how much would it be worth today?"
Bad behavior: Claude assumes keyless works, starts building a dashboard, then hits
error 10012 because keyless/Demo cannot fetch historical data beyond 365 days.
The user wasted time and rate-limit calls on something that was never going to work.
The correct behavior is to ask for credentials first, identify that "5 years ago" exceeds
keyless/Demo limits, and tell the user upfront — before writing a single line of code.
Procedure:
- 1. Check memory for a previously saved plan tier and API key.
- If found, confirm they are still current. If not found, ask the user:
-
Plan tier — paid (Pro) or free (Demo)?
-
API key — their
CG-… key?
- 3. No key? Only fall back to keyless after the user explicitly says they have no key.
If the user simply hasn't mentioned a key,
ask — do not treat silence as "no key."
When proceeding keyless, warn: capped at 5 calls/min, unstable, and data restrictions
apply. Suggest a free Demo key at https://www.coingecko.com/en/api/pricing.
- 4. Assess feasibility against the confirmed tier. Check whether the request involves
data or endpoints that exceed the tier's limits — e.g. historical data beyond 365 days
(keyless/Demo), Enterprise-only intervals (
5m), or paid-only endpoints. If it does,
tell the user
before attempting any call. Do not make the call and let it fail.
- 5. Read
references/core.md for full auth setup and save the confirmed tier to memory.
Do NOT proceed to step 1 until this step is fully resolved.
Step 1 — Identify the domain
Use the Reference index below to decide which file(s) to load.
Step 2 — Load references and construct the request
Load the relevant reference file(s) and build the API call.
Step 3 — Execute and handle errors
Auth and rate-limit error codes are documented in references/core.md. If the API returns
error 10005, the endpoint requires a higher plan — inform the user and link them to
https://www.coingecko.com/en/api/pricing. If you get error 10010 or 10011, you've used
the wrong base URL for the key type — swap URLs per core.md's error table and retry
automatically.
"Failed to fetch" or network errors: If a request fails with no HTTP status (e.g.
"Failed to fetch", TypeError), follow the diagnostic in references/claude-env.md if
running inside Claude — the cause is usually the Artifact CSP sandbox (move to bash_tool)
or a missing domain allowlist entry. Outside Claude, the cause is likely a wrong
base URL — see core.md's "Network-level failures" section. In either case, never assume
CORS is the problem.
Reference index
Load the relevant reference file based on what the user is asking for. You only need to
load the file(s) that match the current request.
Inspiration & Use cases
If the user asks what they can build, wants project ideas, or asks an exploratory
question like "what data is available?" — load references/common-use-cases.md instead
of the domain-specific files below, then follow its pointers to drill deeper.
Environment
| File | When to load |
|---|
| INLINECODE23 | Read in Step 0a — Claude-specific constraints (domain allowlist, Artifact CSP sandbox, bash_tool strategy, MCP upgrade path). Only applies when running inside Claude. |
CoinGecko (aggregated)
| File | When to load |
|---|
| INLINECODE24 | Always read — auth, methodology, rate limits |
| INLINECODE25 |
Coin prices, market data, metadata, tickers, gainers/losers |
|
references/coin-history.md | Historical charts, OHLC, time-range queries by coin ID |
|
references/coin-supply.md | Circulating/total supply charts |
|
references/contract.md | Coin data or charts looked up by token contract address |
|
references/asset-platforms.md | Blockchain platform IDs, token lists |
|
references/categories.md | Coin categories and sector market data |
|
references/exchanges.md | Spot and DEX exchange data, tickers, volume charts |
|
references/derivatives.md | Derivatives exchanges and tickers |
|
references/treasury.md | Public company/institution crypto treasury holdings |
|
references/nfts.md | NFT collection data, market data, charts, tickers |
|
references/global.md | Global market stats and DeFi data |
|
references/utils.md | API status, API key usage, supported currencies, search, trending coins/NFTs/categories, exchange rates |
GeckoTerminal (on-chain)
| File | When to load |
|---|
| INLINECODE37 | Supported networks and DEXes (ID resolution) |
| INLINECODE38 |
Pool discovery, trending/new pools, megafilter |
|
references/onchain-tokens.md | Token data, price by contract address, holders and traders |
|
references/onchain-ohlcv-trades.md | OHLCV candles and trade history for pools/tokens |
|
references/onchain-categories.md | On-chain pool categories (GeckoTerminal-specific) |
General guidance
- - If a request spans multiple domains (e.g. coin price + exchange data), load multiple
reference files.
- - When uncertain which file to load, check the index above before answering.
- For CoinGecko vs GeckoTerminal preference, see
references/core.md (Methodology section).
CoinGecko 技能
使用时机
当用户的请求符合以下任意条件时触发此技能:
加密货币市场数据查询
- - 币种/代币价格、市值、交易量、价格变动
- 历史价格数据、OHLC图表、时间范围查询
- 流通量或总供应量数据
- 全球加密货币市场统计数据(总市值、比特币主导地位、DeFi TVL)
- 热门币种、涨幅/跌幅最大币种、新上市币种
代币和合约查询
- - 通过合约地址查询代币(例如 0x...)
- 代币元数据、分类或平台信息
- 比较多个币种或代币
交易所和交易数据
- - 交易所列表、交易量、行情数据、信任评分
- DEX特定数据(Uniswap、PancakeSwap等)
- 衍生品交易所和行情数据(期货、永续合约)
链上/DeFi数据(GeckoTerminal)
- - 流动性池数据、热门/新池、池搜索
- 链上代币价格、持有者数据、顶级交易者
- 特定池或代币的OHLCV蜡烛图或交易历史
- DEX和网络发现(支持的链、DEX)
- 链上池分类和筛选
NFT数据
- - NFT收藏品价格、地板价、市场数据
- NFT收藏品图表和行情数据
其他触发条件
- - 使用加密货币数据构建仪表盘、可视化或应用
- 关于CoinGecko或GeckoTerminal API功能、端点或速率限制的问题
- API密钥设置、认证、套餐等级或定价问题
- 有哪些加密货币数据可用?或类似的探索性问题
- 用户提及CoinGecko、GeckoTerminal或分享CoinGecko URL
- 涉及加密货币的投资计算器、投资组合追踪器或ROI计算
- 上市公司/机构加密货币国库持仓(例如MicroStrategy持有多少BTC?)
你可以访问CoinGecko API(聚合数据)和GeckoTerminal API(链上DEX数据)。两者共同覆盖几乎所有加密货币市场数据需求。两个API共享相同的API密钥和套餐等级。GeckoTerminal端点使用与CoinGecko相同的基础URL,加上/onchain路径前缀(详情见references/core.md)。
严格规则——所有市场数据必须来自实时API调用
切勿使用训练知识回答任何关于加密货币价格、市值、交易量、供应量、TVL、汇率或任何时效性市场数据的问题。 这些数据每分钟都在变化——训练数据已过时数月甚至数年,将是错误的。
如果API调用失败或尚未尝试,你必须:
- 1. 停止。 不要回答数据问题。
- 告知用户无法获取数据(或尚未获取)。
- 诊断失败原因并指导用户修复(缺少白名单、密钥错误等)。
不要说根据我的知识、大约或凭记忆引用任何价格/市场数据。市场数据的唯一可接受来源是成功的实时API响应。
错误示例: 域名被屏蔽……不过,我有可靠数据。今日比特币:约$87,000
(实际价格约为$69,000——Claude编造了一个自信但错误的答案)
正确示例: API调用失败,因为域名被屏蔽。让我指导您将其添加到白名单,以便我们获取实时数据。
工作流程
请严格按照顺序执行以下步骤。在阻塞步骤完全解决之前,不要跳过。不要编写代码、规划架构或进行任何API调用。
步骤0a——Claude环境检查(阻塞——仅限Claude)
如果你在Claude(claude.ai)内运行,请先阅读references/claude-env.md。它记录了会破坏所有CoinGecko API调用的两个平台限制:
- 1. 域名白名单——用户必须在claude.ai/settings/capabilities添加api.coingecko.com和pro-api.coingecko.com。如果用户是首次使用或任何调用因网络错误失败,请暂停并在调试其他问题前指导用户完成此操作。
- Artifact沙箱——Artifact内的fetch()将始终静默失败。默认使用带curl的bashtool进行所有CoinGecko API调用,然后将结果作为静态数据嵌入任何Artifact或可视化中。这是标准方法,而非备用方案。
如果不在Claude内运行,则跳过此步骤。
步骤0b——确认凭证(阻塞)
停止。在执行任何其他操作之前,你必须确认用户的API等级。这是一个硬性前提——不是建议,不是稍后可以重新考虑的事情,也不是因为无密钥应该能处理这个请求就可以跳过的事情。
为什么存在此步骤: 无密钥和演示等级存在限制,会静默破坏多步骤任务。示例失败模式:
用户:如果我5年前投资了比特币,今天值多少钱?
错误行为:Claude假设无密钥可用,开始构建仪表盘,然后遇到错误10012,因为无密钥/演示无法获取超过365天的历史数据。用户浪费了时间和速率限制调用在永远无法完成的事情上。
正确的做法是先询问凭证,识别出5年前超出了无密钥/演示的限制,并在编写一行代码之前提前告知用户。
流程:
- 1. 检查记忆中之前保存的套餐等级和API密钥。
- 如果找到,确认它们仍然有效。如果未找到,询问用户:
-
套餐等级——付费(Pro)还是免费(Demo)?
-
API密钥——他们的CG-…密钥?
- 3. 没有密钥? 只有在用户明确表示没有密钥时才回退到无密钥模式。如果用户只是没有提到密钥,请询问——不要将沉默视为没有密钥。在无密钥模式下继续时,警告:限制为5次/分钟,不稳定,且有数据限制。建议在https://www.coingecko.com/en/api/pricing获取免费演示密钥。
- 根据确认的等级评估可行性。 检查请求是否涉及超出等级限制的数据或端点——例如超过365天的历史数据(无密钥/演示)、仅限企业版的间隔(5m)或仅限付费的端点。如果是,请在尝试任何调用之前告知用户。不要进行调用然后让它失败。
- 阅读references/core.md了解完整认证设置,并将确认的等级保存到记忆。
在此步骤完全解决之前,不要进入步骤1。
步骤1——确定领域
使用下面的参考索引决定加载哪些文件。
步骤2——加载参考并构建请求
加载相关的参考文件并构建API调用。
步骤3——执行并处理错误
认证和速率限制错误代码在references/core.md中有文档说明。如果API返回错误10005,该端点需要更高的套餐——告知用户并链接到https://www.coingecko.com/en/api/pricing。如果收到错误10010或10011,说明你为密钥类型使用了错误的基础URL——根据core.md的错误表交换URL并自动重试。
获取失败或网络错误: 如果请求失败且没有HTTP状态码(例如获取失败、TypeError),如果在Claude内运行,请按照references/claude-env.md的诊断方法处理——原因通常是Artifact CSP沙箱(移至bash_tool)或缺少域名白名单条目。在Claude之外,原因可能是错误的基础URL——参见core.md的网络级故障部分。无论哪种情况,都不要假设是CORS问题。
参考索引
根据用户询问的内容加载相关的参考文件。你只需要加载与当前请求匹配的文件。
灵感与用例
如果用户询问可以构建什么、想要项目创意或提出探索性问题如有哪些数据可用?——请加载references/common-use-cases.md而不是下面的领域特定文件,然后按照其指引深入探索。
环境
| 文件 | 加载时机 |
|---|
| references/claude-env.md | 在步骤0a中阅读——Claude特定限制(域名白名单、Artifact CSP沙箱、bash_tool策略、MCP升级路径)。仅在Claude内运行时适用。 |
CoinGecko(聚合数据)
| 文件 | 加载时机 |
|---|
| references/core.md | 始终阅读——认证、方法论、速率限制 |
| references/coins.md |
币种价格、市场数据、元数据、行情数据、涨幅/跌幅最大币种 |
| references/coin-history.md | 历史图表、OHLC、按币种ID的时间范围查询 |
| references/coin-supply.md | 流通量/总供应量图表 |
| references/contract.md | 通过代币合约地址查询的币种数据或图表 |
| references/asset-platforms.md | 区块链平台ID、代币列表 |
| references/categories.md | 币种分类和板块市场数据 |
| references/exchanges.md | 现货和DEX交易所数据、行情数据、交易量图表 |
|