feat(coingecko): add CoinGecko crypto adapter with 10 commands#203
feat(coingecko): add CoinGecko crypto adapter with 10 commands#2030xsline wants to merge 2 commits intojackwener:mainfrom
Conversation
…in commands CoinGecko (4 commands, public API, no auth needed): - top: top cryptocurrencies by market cap with price and 24h change - trending: trending coins on CoinGecko - search: search for cryptocurrencies by name - coin: detailed info for a specific coin (price, 24h/7d/30d change, ATH) Supports multi-currency pricing via --currency flag (usd, eur, aud, etc.)
…hanges, gainers, losers New commands: - price: quick multi-coin price check via markets API - global: top 10 coins by market cap overview - categories: coin categories ranked by market cap (DeFi, Layer 1, etc.) - exchanges: top exchanges by trading volume with trust scores - gainers: top gaining coins by 24h change (sorted from 250 coins) - losers: top losing coins by 24h change All commands use public CoinGecko API, no auth needed.
2b4dee5 to
aa74846
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Good coverage of CoinGecko endpoints. Several issues, some blocking:
CoinGecko API now requires a demo API key
The public api.coingecko.com/api/v3 endpoint now requires x-cg-demo-api-key (free registration). Without it, requests are limited to 5-15 calls/min and will frequently return 401/429. The adapters have no header injection path for API keys. Consider adding a headers: config with an env var (e.g. COINGECKO_API_KEY), or at minimum document this requirement.
Unrelated files: facebook.md and instagram.md
These doc changes don't belong in a CoinGecko PR. They also change existing positional arg examples (facebook profile zuck) to named flags (--username zuck), which contradicts the actual YAML definitions (positional: true). Please revert these and submit separately.
URL encoding missing
search.yaml and price.yaml interpolate user input directly into URLs. Use params: (auto-encodes) or the urlencode filter.
global.yaml duplicates top.yaml
global calls /coins/markets?per_page=10, which is identical to top --limit 10. CoinGecko has a dedicated /global endpoint for actual market-wide stats (total market cap, BTC dominance, etc.). Consider using that instead.
losers.yaml missing filter
gainers.yaml has - filter: item.price_change_percentage_24h to remove null entries, but losers.yaml doesn't. Coins with null values will incorrectly appear at the top of the losers list.
Doc examples use --id/--query but args are positional
Same issue as #215 — YAML defines positional args correctly, but docs show --flag usage which will cause commander errors.
Missing deliverables
No README, docs/adapters/index.md, config.mts sidebar, or E2E tests.
Summary
Add comprehensive CoinGecko adapter with 10 public API commands for cryptocurrency data. No authentication needed.
New Commands
topopencli coingecko top --limit 10trendingopencli coingecko trendingsearchopencli coingecko search --query solanacoinopencli coingecko coin --id bitcoinpriceopencli coingecko price --ids "bitcoin,ethereum,solana"globalopencli coingecko globalcategoriesopencli coingecko categories --limit 10exchangesopencli coingecko exchanges --limit 10gainersopencli coingecko gainers --limit 10losersopencli coingecko losers --limit 10Supports
--currencyflag for multi-currency pricing (usd, eur, aud, cny, etc.)Test plan
top --limit 5— BTC $70,613, ETH $2,153, market caps and 24h changestrending— Akash Network, Zano, Bitcoin, Pudgy Penguinssearch --query solana— SOL rank npm 包缺少 github 目录导致模块找不到错误 #7, related tokenscoin --id bitcoin— price, 24h/7d/30d change, ATH $126,080price --ids "bitcoin,ethereum,solana"— 3 coins with price, change, market capglobal— top 10 coins by market cap overviewcategories --limit 5— Smart Contract Platform, Layer 1, PoWexchanges --limit 5— Binance, Gate, Bybit, Coinbase, OKXgainers --limit 5— Akash Network +11.69%losers --limit 5— Provenance -6.46%, Midnight -4.10%