Skip to content
Development
Skill

/coingecko

Complete CoinGecko Solana API integration for token prices, DEX pool data, OHLCV charts, trades, and market analytics. Use for building trading bots, portfolio trackers, price feeds, and on-chain data applications.

From plugin
skills
13048 skills

Claude Code

$ npx -y skills add sendaifun/skills --skill coingecko --agent claude-code

SKILL.md

coingecko.SKILL.md
name: coingecko
description: Complete CoinGecko Solana API integration for token prices, DEX pool data, OHLCV charts, trades, and market analytics. Use for building trading bots, portfolio trackers, price feeds, and on-chain data applications.

CoinGecko Solana API Development Guide

A comprehensive guide for integrating CoinGecko's on-chain API for Solana. Access real-time token prices, DEX pool data, OHLCV charts, trade history, and market analytics across 1,700+ decentralized exchanges.

Overview

CoinGecko's Solana API provides:

  • **Token Prices**: Real-time prices by contract address (single or batch)
  • **Pool Data**: Liquidity pool information, trending pools, top pools
  • **OHLCV Charts**: Candlestick data for technical analysis
  • **Trade History**: Recent trades for any pool
  • **DEX Discovery**: List all DEXes operating on Solana
  • **Search**: Find pools by token name, symbol, or address
  • **Megafilter**: Advanced filtering across pools, tokens, and DEXes

Key Features

| Feature | Description | |---------|-------------| | **250+ Networks** | Multi-chain support including Solana | | **1,700+ DEXes** | Raydium, Orca, Jupiter, Meteora, Pump.fun, etc. | | **15M+ Tokens** | Comprehensive token coverage | | **Real-time Data** | Updates every 10-30 seconds | | **Historical Data** | OHLCV charts and trade history |

---

Quick Start

Get Your API Key

1. **Demo API (Free)**: Visit [coingecko.com/en/api](https://www.coingecko.com/en/api) 2. **Pro API (Paid)**: Visit [coingecko.com/en/api/pricing](https://www.coingecko.com/en/api/pricing)

Environment Setup

# .env file
COINGECKO_API_KEY=your_api_key_here
COINGECKO_API_TYPE=demo  # or 'pro'

API Configuration

// Configuration for both Demo and Pro APIs
const CONFIG = {
  demo: {
    baseUrl: 'https://api.coingecko.com/api/v3/onchain',
    headerKey: 'x-cg-demo-api-key',
    rateLimit: 30, // calls per minute
  },
  pro: {
    baseUrl: 'https://pro-api.coingecko.com/api/v3/onchain',
    headerKey: 'x-cg-pro-api-key',
    rateLimit: 500, // calls per minute (varies by plan)
  },
};

const apiType = process.env.COINGECKO_API_TYPE || 'demo';
const apiKey = process.env.COINGECKO_API_KEY;

const BASE_URL = CONFIG[apiType].baseUrl;
const HEADER_KEY = CONFIG[apiType].headerKey;

// Solana network identifier
const NETWORK = 'solana';

Basic Token Price Fetch

async function getTokenPrice(tokenAddress: string): Promise<number | null> {
  const url = `${BASE_URL}/simple/networks/${NETWORK}/token_price/${tokenAddress}`;

  const response = await fetch(url, {
    headers: {
      [HEADER_KEY]: apiKey,
      'Accept': 'application/json',
    },
  });

  if (!response.ok) {
    throw new Error(`API error: ${response.status}`);
  }

  const data = await response.json();
  return data.data?.attributes?.token_prices?.[tokenAddress] ?? null;
}

// Usage
const USDC = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
const price = await getTokenPrice(USDC);
console.log(`USDC Price: $${price}`);

---

API Endpoints Reference

Simple Token Price

Get token prices by contract address.

**Endpoint**: `GET /simple/networks/{network}/token_price/{addresses}`

**Parameters**: | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `network` | string | Yes | Network ID (`solana`) | | `addresses` | string | Yes | Comma-separated token addresses (max 30 Demo, 100 Pro) | | `include_market_cap` | boolean | No | Include market cap data | | `include_24hr_vol` | boolean | No | Include 24h volume | | `include_24hr_price_change` | boolean | No | Include 24h price change % |

async function getTokenPrices(addresses: string[]): Promise<Record<string, TokenPriceData>> {
  const addressList = addresses.join(',');
  const url = `${BASE_URL}/simple/networks/${NETWORK}/token_price/${addressList}`;

  const params = new URLSearchParams({
    include_market_cap: 'true',
    include_24hr_vol: 'true',
    include_24hr_price_change: 'true',
  });

  const response = await fetch(`${url}?${params}`, {
    headers: { [HEADER_KEY]: apiKey },
  });

  const data = await response.json();
  return data.data?.attributes || {};
}

---

Token Data by Address

Get detailed token information.

**Endpoint**: `GET /networks/{network}/tokens/{address}`

**Parameters**: | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `network` | string | Yes | Network ID | | `address` | string | Yes | Token contract address | | `include` | string | No | Include `top_pools` for liquidity data |

interface TokenData {
  address: string;
  name: string;
  symbol: string;
  decimals: number;
  image_url: string;
  price_usd: string;
  fdv_usd: string;
  market_cap_usd: string;
  total_supply: string;
  volume_usd: {
    h24: string;
  };
  price_change_percentage: {
    h24: string;
  };
}

async function getTokenData(address: string): Promise<TokenData> {
  const url = `${BASE_URL}/networks/${NETWORK}/tokens/${address}?include=top_pools`;

  const response = await fetch(url, {
    headers: { [HEADER_KEY]: apiKey },
  });

  const data = await response.json();
  return data.data?.attributes;
}

---

Multi-Token Data

Batch fetch multiple tokens.

**Endpoint**: `GET /networks/{network}/tokens/multi/{addresses}`

async function getMultipleTokens(addresses: string[]): Promise<TokenData[]> {
  const addressList = addresses.join(',');
  const url = `${BASE_URL}/networks/${NETWORK}/tokens/multi/${addressList}`;

  const response = await fetch(url, {
    headers: { [HEADER_KEY]: apiKey },
  });

  const data = await response.json();
  return data.data?.map((item: any) => item.attributes) || [];
}

---

Pool Data by Address

Get detailed pool information.

**Endpoint**: `GET /networks/{network}/pools/{address}`

**Parameters**: | Parameter | Type | Required | Description | |-----------|------|----

Read more
@sendaifun
Ships withskills

AI agent skills for Solana development — DeFi protocols, infrastructure, security, and more.

Stars on GitHub

Momentum

stars in total
130
Star history of sendaifun/skills on GitHub, a chart by star-history.com

Other skills on skills.

arcium

arcium

Build and debug encrypted Solana applications with Arcium — data stays private during computation, no single party sees it. Use…

@sendaifun@sendaifunInstall Skill
birdeye

birdeye

Complete Birdeye API integration for real-time DeFi data across Solana and 15 other chains. Use for token prices, OHLCV charts,…

@sendaifun@sendaifunInstall Skill
carbium

carbium

Build on Solana with Carbium infrastructure — bare-metal RPC, Standard WebSocket pubsub, gRPC Full Block streaming (~22ms), DEX…

@sendaifun@sendaifunInstall Skill
ct-alpha

ct-alpha

Crypto Twitter intelligence and alpha research. Search X/Twitter for real-time crypto narratives, trending tokens, yield…

@sendaifun@sendaifunInstall Skill
debridge

debridge

Complete deBridge Protocol SDK for building cross-chain bridges, message passing, and token transfers on Solana. Use when…

@sendaifun@sendaifunInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about coingecko.

Which coding agents can use coingecko?
coingecko installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.