coingecko
Crypto spot prices, OHLC charts, market discovery, and global stats. Use when looking up coin prices, market caps, trending coins, sector rankings, or comparing tokens (e.g. BTC price, ETH chart, top gainers).
By starchild-ai-agent · 7,857 installs
npx skills add starchild-ai-agent/official-skills --skill coingecko
Source repository · Upstream listing
Script Usage
Script mode skill — read this file, then invoke from a bash block:
Read exports.py for the full list of available functions. Common ones:
coin price , coin ohlc , coin chart , cg trending ,
cg top gainers losers , cg new coins , cg global , cg global defi ,
cg categories , cg derivatives , cg coins markets , cg coin data ,
cg coin tickers , cg search , cg token price , cg coin by contract .
CoinGecko Skill
Function Reference (signatures)
All public functions are in exports.py . coin id is the CoinGecko id
(e.g. bitcoin , ethereum ) — use cg search(query) first if unsure.
vs currency defaults to usd .
Prices & Charts
Function Description
coin price(coin ids, timestamps=None, vs currency='usd') Current or historical price. coin ids = comma string like "bitcoin,ethereum" . timestamps = list of unix ts for historical (default: now).
coin ohlc(coin id, days=30, vs currency='usd') OHLC bars for last N days. Returns list of [ts, o, h, l, c] . Granularity auto selected: 1d=30min, 7 30d=4h, 30d+=4h.
coin chart(coin id, days=30, vs currency='usd') Price + market cap + total volume timeseries. Returns {prices, market caps, total volumes} (each list of [ts, val] ).
Discovery
Function Description
cg trending() Trending coins, NFTs, categories (last 24h).
cg top gainers losers(vs currency='usd', duration='24h') Top gainers/losers. duration = 1h / 24h / 7d / 14d / 30d / 60d / 1y .
cg new coins() Recently listed coins.
cg search(query) Search coins/exchanges/categories by name.
Market Data
Function Description
cg global() Global crypto market: total market cap, volume, dominance.
cg global defi() Global DeFi: TVL, dominance, top protocols.
cg coins markets(vs currency='usd', order='market cap desc', per page=100, page=1, sparkline=False, price change percentage='24h', category=None, ids=None) Top coins with full market data.
cg coin data(coin id, localization=False, tickers=False, market data=True, community data=False, developer data=False, sparkline=False) Detailed data for one coin.
cg coin tickers(coin id, exchange ids=None, include exchange logo=False, page=1, order='volume desc', depth=False) Where a coin trades + volumes.
cg coins list(include platform=False) All coin ids/symbols (for resolving).
Categories / Derivatives / NFTs
Function Description
cg categories(order='market cap desc') Top categories with market cap and volume.
cg categories list() Just category ids/names.
cg derivatives(include tickers='unexpired') Derivatives tickers across exchanges.
cg derivatives exchanges(order='open interest btc desc', per page=50) Derivatives exchange rankings.
cg nfts list(order='market cap usd desc', per page=100, page=1) Top NFT collections.
cg nft(nft id) NFT collection detail.
cg nft by contract(asset platform, contract address) NFT by contract address.
Exchanges
Function Description
cg exchanges(per page=100, page=1) Exchange rankings.
cg exchange(exchange id) One exchange's detail.
cg exchange tickers(exchange id, ...) Tickers on an exchange.
cg exchange volume chart(exchange id, days=30) Exchange volume history.
Contracts / Tokens (by platform)
Function Description
cg token price(platform, contract addresses, vs currencies='usd', include market cap=False, include 24hr vol=False, include 24hr change=False, include last updated at=False) Price by contract address on a platform.
cg coin by contract(platform, contract address) Coin metadata by contract.
cg asset platforms(filter=None) Supported chains.
cg vs currencies() Supported quote currencies.
cg exchange rates() BTC denominated rates for fiat/major coins.
🚫 CRITICAL: STOP — READ THIS BEFORE CALLING ANY TOOL
The 1 error is calling Coinglass tools instead of CoinGecko tools. They have similar names but are COMPLETELY DIFFERENT systems.
WRONG → RIGHT Tool Substitution Table
❌ NEVER call this ✅ Call this instead How to tell them apart
cg coins market data cg coins markets market data=Coinglass derivatives. markets=CoinGecko spot.
cg ohlc history coin ohlc ohlc history=Coinglass futures candles. coin ohlc=CoinGecko spot candles.
cg pair market data cg coin tickers pair market data=Coinglass futures pair. coin tickers=CoinGecko spot pairs.
cg supported exchanges cg exchanges supported exchanges=Coinglass futures. exchanges=CoinGecko spot.
cg taker exchanges cg exchange taker=Coinglass volume. exchange=CoinGecko exchange info.
cg aggregated taker volume cg coin tickers taker volume=Coinglass. coin tickers=CoinGecko volume across exchanges.
defillama chains cg global defi For DeFi stats from CoinGecko, use cg global defi().
Also FORBIDDEN:
❌ web search / web fetch — ALL data is available via native CoinGecko tools above. NEVER use web search for crypto market data.
❌ bash for data processing — CoinGecko tools return clean data. No bash needed.
❌ NEVER answer with training data — all prices, rankings, OHLC are stale. CALL THE TOOL.
⚠️ MANDATORY TOOL CALLS — You MUST call a tool before answering these
Request type You MUST call Why
K线 / OHLC / candlestick / open high low close coin ohlc(coin id, days) Price data is real time; training data is stale
走势图 / price chart / 价格趋势 coin chart(coin id, days) Same reason
当前价格 / price right now coin price(coin ids) Training data has no live prices
DO NOT return any numeric market data (prices, OHLC values, percentages) without calling a tool first.
⚡ Question → Tool Map (match first keyword, call immediately)
Question keyword Tool to call Example
价格 / price / 多少钱 (single coin) coin price(coin id) coin price(coin ids="bitcoin")
K线 / OHLC / candlestick / 蜡烛图 coin ohlc(coin id, days) coin ohlc(coin id="ethereum", days=7)
走势 / trend / price chart / 价格历史 coin chart(coin id, days) coin chart(coin id="solana", days=30)
热门 / trending / 趋势币 cg trending() cg trending()
涨幅最大 / 跌幅最大 / gainers / losers cg top gainers losers() cg top gainers losers()
新币 / 新上线 / new coins / recently added cg new coins() cg new coins()
总市值 / BTC市占率 / global / 晨报 / 市场概况 cg global() cg global()
DeFi总市值 / DeFi TVL / DeFi dominance cg global defi() cg global defi()
板块 / sector / category / L1 / L2 / Meme / AI coins cg categories() cg categories()
板块内个币 / Meme前10 / AI币排名 / DeFi币排名 cg coins markets(category=X) cg coins markets(category="meme token", per page=10)
市值排名 / top 10 / ranking / 前10币 cg coins markets(per page=N) cg coins markets(per page=10)
ATH / 历史最高 / 社区 / dev / 研究 / fundamentals cg coin data(coin id) cg coin data(coin id="solana", community data=True)
对比两个币 / compare / XX vs YY cg coin data() × 2 call once per coin
NFT排名 / NFT市场 / floor price / top NFTs cg nfts list() cg nfts list()
某个NFT (BAYC/Punks/Azuki) cg nft(nft id) cg nft(nft id="bored ape yacht club")
交易所详情 / Binance详情 / exchange data cg exchange(exchange id) cg exchange(exchange id="binance")
交易所列表 / exchange ranking cg exchanges() cg exchanges()
交易对 / trading pairs / 流动性分布 cg coin tickers(coin id) cg coin tickers(coin id="bitcoin")
交易所交易量趋势 / volume chart cg exchange volume chart(exchange id) cg exchange volume chart(exchange id="binance", days=30)
合约地址价格 / token price on chain cg token price(platform, contract) cg token price(platform="ethereum", contract addresses="0xa0b...")
搜索币 / 找币 / coin lookup / search cg search(query) cg search(query="pepe")
永续合约交易所 / derivatives exchange / OI排名 cg derivatives exchanges() cg derivatives exchanges()
合约ticker / perpetual / funding / basis cg derivatives() cg derivatives()
交易所对比 + 永续交易所 cg exchanges() + cg derivatives exchanges() both calls
🌳 Decision Tree
Common Category IDs
meme token , artificial intelligence , layer 1 , layer 2 , decentralized finance defi , gaming , real world assets rwa
Output Formatting
Prices: always use $ sign → $66,697
Percentages: always use % → +4.2%
NFT floor in ETH: show USD too → 5.17 ETH ($10,534)
Important Notes
CoinGecko uses slug IDs: "bitcoin", "ethereum", "solana". Symbols (BTC, ETH, SOL) auto resolve.
If unsure about a coin ID → cg search(query="coin name") first.
Most questions need only 1 2 tool calls. Do NOT chain 3+ calls.
Common Issues
coin price failed with invalid ID
Solution: Use cg search(query="coin name") to find the correct CoinGecko ID first, or use the symbol directly (e.g., 'COMP').