GnistAI GnistAI
Log in

Getting Started with CoinGecko Crypto

Real-time and historical cryptocurrency prices, market data, trending coins, and market rankings for 10,000+ coins. Prices, market caps, volumes, charts, and category filtering.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Finance

Data source: CoinGecko API

Overview

CoinGecko Crypto wraps CoinGecko API, handling authentication, pagination, and rate limits for you. This tutorial covers all 7 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-coingecko": {
      "url": "https://context.gnist.ai/mcp/coingecko/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (7)

search_coins

Search for cryptocurrencies by name or ticker symbol. Find coin IDs for use with other tools. Covers 10,000+ coins tracked by CoinGecko. Args: query: Coin name or ticker symbol. Returns: List of matching coins with ID, name, symbol, and market cap rank. Use the ID with get_price, get_coin_detail, or get_market_chart.

ParameterTypeRequiredDescription
querystringrequiredCoin name or symbol (e.g. "bitcoin", "eth", "solana", "dogecoin").
curl -X POST "https://context.gnist.ai/mcp/coingecko/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_coins", "arguments": {"query": "bitcoin"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/coingecko/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'query': 'bitcoin'}, 'name': 'search_coins'}},
)
print(resp.json())

get_price

Get current prices for one or more cryptocurrencies. Returns real-time prices with 24h change and market cap. Supports any fiat or crypto as the quote currency. Args: coin_ids: List of CoinGecko coin IDs (up to 10). vs_currency: Quote currency (default 'usd'). Returns: Current price, market cap, and 24h change percentage for each coin.

ParameterTypeRequiredDescription
coin_idslist[string]requiredCoin IDs (e.g. ["bitcoin", "ethereum"]). Use search_coins to find IDs.
vs_currencystringoptionalCurrency for prices: usd, eur, nok, gbp, btc, etc. (default: usd)
curl -X POST "https://context.gnist.ai/mcp/coingecko/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_price", "arguments": {"coin_ids": "[\"bitcoin\""}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/coingecko/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'coin_ids': '["bitcoin"'}, 'name': 'get_price'}},
)
print(resp.json())

get_coin_detail

Get comprehensive details for a cryptocurrency. Includes description, market data (price, market cap, volume, supply), ATH/ATL, price changes across timeframes, categories, and genesis date. Args: coin_id: CoinGecko coin ID. Returns: Full coin profile with market data, supply metrics, and price history.

ParameterTypeRequiredDescription
coin_idstringrequiredCoinGecko coin ID (e.g. "bitcoin", "ethereum", "solana"). Use search_coins to find it.
curl -X POST "https://context.gnist.ai/mcp/coingecko/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_coin_detail", "arguments": {"coin_id": "bitcoin"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/coingecko/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'coin_id': 'bitcoin'}, 'name': 'get_coin_detail'}},
)
print(resp.json())

get_market_chart

Get historical price chart data for a cryptocurrency. Returns timestamped price data points for charting or analysis. Granularity depends on time range: hourly for short periods, daily for longer ones. Args: coin_id: CoinGecko coin ID. vs_currency: Quote currency (default 'usd'). days: Number of days of history (1–365, default 30). Returns: Time series of prices (up to 100 sampled points), plus latest market cap and volume.

ParameterTypeRequiredDescription
coin_idstringrequiredCoinGecko coin ID (e.g. "bitcoin"). Use search_coins to find it.
vs_currencystringoptionalQuote currency (default 'usd'). (default: usd)
daysintegeroptionalDays of history (1–365, default 30). 1=hourly, 2-90=hourly, 91+=daily. (default: 30)
curl -X POST "https://context.gnist.ai/mcp/coingecko/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_market_chart", "arguments": {"coin_id": "bitcoin"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/coingecko/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'coin_id': 'bitcoin'}, 'name': 'get_market_chart'}},
)
print(resp.json())

get_trending

Get trending cryptocurrencies — most searched coins in the last 24 hours. Shows what the crypto community is paying attention to right now. Updated frequently based on CoinGecko search volume. Returns: Top trending coins with name, symbol, market cap rank, and BTC price.

curl -X POST "https://context.gnist.ai/mcp/coingecko/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_trending", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/coingecko/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'get_trending'}},
)
print(resp.json())

get_markets

Get top cryptocurrencies ranked by market capitalization. Returns current price, market cap, volume, 24h change, and supply data for the largest coins. Can filter by category. Args: vs_currency: Quote currency (default 'usd'). limit: Number of results (1–50, default 20). category: Filter by category (optional). Returns: List of top coins with price, market cap, volume, and 24h change.

ParameterTypeRequiredDescription
vs_currencystringoptionalQuote currency (default 'usd'). (default: usd)
limitintegeroptionalNumber of results (1–50, default 20). (default: 20)
categoryanyoptionalCategory filter: 'decentralized-finance-defi', 'stablecoins', 'meme-token', 'layer-1', 'layer-2', 'gaming', etc.
curl -X POST "https://context.gnist.ai/mcp/coingecko/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_markets", "arguments": {"vs_currency": "usd"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/coingecko/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'vs_currency': 'usd'}, 'name': 'get_markets'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/coingecko/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/coingecko/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use search_coins to find items, then get_price to get full details. This two-step pattern is common for exploring data before drilling down.
Pagination
Several tools support limit, offset, or page parameters. Start with small limits during development, then increase for production queries.

FAQ

What data does CoinGecko Crypto provide?

Real-time and historical cryptocurrency prices, market data, trending coins, and market rankings for 10,000+ coins. Prices, market caps, volumes, charts, and category filtering. It exposes 7 tools: search_coins, get_price, get_coin_detail, get_market_chart, get_trending, get_markets, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the CoinGecko Crypto API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials