Developer

GeckoTerminal API Guide: Pools, Trending & OHLCV

Every GeckoTerminal endpoint for Solana pools, trending tokens, OHLCV candles and trades, with rate limits and trading bot integration patterns.

GeckoTerminal API Guide: Pools, Trending & OHLCV article cover
In this article
  1. 🎯 What You'll Learn
  2. 📡 API Overview
  3. 🔗 Core Endpoints
  4. 💹 Pool Endpoints
  5. 🔥 Trending Endpoints
  6. 🪙 Token Endpoints
  7. 📊 OHLCV Data (Candlesticks)
  8. 📜 Trade History
  9. 🔍 Search
  10. 🛠️ Integration Examples
  11. ⚠️ Best Practices
  12. In Practice
  13. 📚 Resources
  14. 🎓 Key Takeaways

GeckoTerminal, created by the team behind CoinGecko, provides broad on-chain DEX analytics and a public API for pool, token, trade, and historical candle data.

This guide covers the exact pool, trending, token, trade, and OHLCV endpoints commonly needed by a Solana application or GeckoTerminal trading bot. ScreenerBot uses GeckoTerminal for discovery, pool context, and strategy candles while keeping direct pool prices separate for trading and P&L.


🎯 What You'll Learn

  • GeckoTerminal API overview and capabilities
  • All available endpoints with examples
  • How to fetch OHLCV candlestick data
  • Rate limits and best practices

📡 API Overview

Key Features

  • Broad Network Coverage: Solana, Ethereum, BSC, and many more
  • Deep DEX Coverage: Raydium, Orca, Meteora, and many other venues
  • Keyless Public Access: Useful for low-volume testing and educational use
  • OHLCV Data: Historical candlestick charts

Base URL

https://api.geckoterminal.com/api/v2

Rate Limits

The keyless GeckoTerminal API is subject to IP-based rate limiting, and CoinGecko API limits depend on the selected plan. Do not build around one permanent requests-per-minute number. Start conservatively, monitor 429 responses, back off with jitter, and use the current limits shown for your account before raising throughput.

The same on-chain data is also available through CoinGecko API /onchain endpoints for keyed production access.


🔗 Core Endpoints

Network Information

Get list of supported networks.

Endpoint: GET /networks

Example:

GET https://api.geckoterminal.com/api/v2/networks

Response:

{
  "data": [
    {
      "id": "solana",
      "type": "network",
      "attributes": {
        "name": "Solana",
        "coingecko_asset_platform_id": "solana"
      }
    }
  ]
}

DEXs on a Network

Get list of DEXs on Solana.

Endpoint: GET /networks/{network}/dexes

Example:

GET https://api.geckoterminal.com/api/v2/networks/solana/dexes

Response:

{
  "data": [
    {
      "id": "raydium",
      "type": "dex",
      "attributes": {
        "name": "Raydium"
      }
    },
    {
      "id": "orca",
      "type": "dex",
      "attributes": {
        "name": "Orca"
      }
    }
  ]
}

💹 Pool Endpoints

Get Pool by Address

Fetch detailed data for a specific pool.

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

Example:

GET https://api.geckoterminal.com/api/v2/networks/solana/pools/7XawhbbxtsRcQA8KTkHT9f9nc6d69UwqCDh6U5EEbEmX

Response:

{
  "data": {
    "id": "solana_7XawhbbxtsRcQA8KTkHT9f9nc6d69UwqCDh6U5EEbEmX",
    "type": "pool",
    "attributes": {
      "name": "SOL / USDC",
      "address": "7XawhbbxtsRcQA8KTkHT9f9nc6d69UwqCDh6U5EEbEmX",
      "base_token_price_usd": "198.50",
      "quote_token_price_usd": "1.00",
      "base_token_price_native_currency": "1",
      "quote_token_price_native_currency": "0.00504",
      "base_token_price_quote_token": "198.50",
      "quote_token_price_base_token": "0.00504",
      "pool_created_at": "2023-01-15T10:30:00Z",
      "reserve_in_usd": "25000000",
      "fdv_usd": "850000000",
      "market_cap_usd": "750000000",
      "price_change_percentage": {
        "m5": "0.5",
        "h1": "1.2",
        "h6": "-0.8",
        "h24": "5.5"
      },
      "transactions": {
        "m5": { "buys": 15, "sells": 12, "buyers": 12, "sellers": 10 },
        "h1": { "buys": 180, "sells": 165, "buyers": 145, "sellers": 130 },
        "h24": { "buys": 4500, "sells": 4200, "buyers": 3200, "sellers": 2800 }
      },
      "volume_usd": {
        "m5": "50000",
        "h1": "850000",
        "h6": "3500000",
        "h24": "15000000"
      }
    },
    "relationships": {
      "base_token": {
        "data": { "id": "solana_So111...", "type": "token" }
      },
      "quote_token": {
        "data": { "id": "solana_EPjFW...", "type": "token" }
      },
      "dex": {
        "data": { "id": "raydium", "type": "dex" }
      }
    }
  }
}

Get Multiple Pools

Fetch up to 30 pools at once.

Endpoint: GET /networks/{network}/pools/multi/{addresses}

Example:

GET https://api.geckoterminal.com/api/v2/networks/solana/pools/multi/7XawhbbxtsRcQA8KTkHT9f9nc6d69UwqCDh6U5EEbEmX,ABC123...

Top Pools by Volume

Endpoint: GET /networks/{network}/pools

Query Parameters:

  • page: Page number (default: 1)
  • sort: Sort field (h24_volume_usd_desc, h24_tx_count_desc)

Example:

GET https://api.geckoterminal.com/api/v2/networks/solana/pools?sort=h24_volume_usd_desc

Get pools trending by different time periods.

Endpoint: GET /networks/{network}/trending_pools

Query Parameters:

  • page: Page number
  • duration: Time period (5m, 1h, 6h, 24h)

Example:

GET https://api.geckoterminal.com/api/v2/networks/solana/trending_pools?duration=1h

Response:

{
  "data": [
    {
      "id": "solana_ABC123...",
      "type": "pool",
      "attributes": {
        "name": "BONK / SOL",
        "address": "ABC123...",
        "base_token_price_usd": "0.00002345",
        "volume_usd": {
          "h1": "2500000",
          "h24": "45000000"
        }
      }
    }
  ]
}

Trending across all networks.

Endpoint: GET /networks/trending_pools


🪙 Token Endpoints

Get Token Pools

Find all pools trading a specific token.

Endpoint: GET /networks/{network}/tokens/{address}/pools

Example:

GET https://api.geckoterminal.com/api/v2/networks/solana/tokens/JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN/pools

Get Token Info

Endpoint: GET /networks/{network}/tokens/{address}/info

Response:

{
  "data": {
    "id": "solana_JUPyiwr...",
    "type": "token",
    "attributes": {
      "name": "Jupiter",
      "symbol": "JUP",
      "address": "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
      "decimals": 6,
      "total_supply": "10000000000",
      "price_usd": "0.89",
      "fdv_usd": "8900000000",
      "total_reserve_in_usd": "125000000",
      "volume_usd": {
        "h24": "85000000"
      },
      "market_cap_usd": "890000000"
    }
  }
}

Recently Updated Tokens

Endpoint: GET /networks/{network}/tokens


📊 OHLCV Data (Candlesticks)

Get historical price data for charting.

Get OHLCV

Endpoint: GET /networks/{network}/pools/{pool_address}/ohlcv/{timeframe}

Timeframes:

  • minute: 1-minute candles
  • hour: 1-hour candles
  • day: 1-day candles

Query Parameters:

  • aggregate: Aggregate bars (e.g., 5 for 5-minute)
  • before_timestamp: Get data before this Unix timestamp
  • limit: Number of candles (max 1000)
  • currency: Price currency (usd or token)

Example (5-minute candles):

GET https://api.geckoterminal.com/api/v2/networks/solana/pools/7XawhbbxtsRcQA8KTkHT9f9nc6d69UwqCDh6U5EEbEmX/ohlcv/minute?aggregate=5&limit=100

Response:

{
  "data": {
    "id": "solana_7Xawh..._minute_5",
    "type": "ohlcv",
    "attributes": {
      "ohlcv_list": [
        [1699920000, "198.50", "199.00", "198.00", "198.75", "1500000"],
        [1699920300, "198.75", "199.50", "198.25", "199.25", "1200000"]
      ]
    }
  },
  "meta": {
    "base": {
      "address": "So111...",
      "name": "Wrapped SOL",
      "symbol": "SOL"
    },
    "quote": {
      "address": "EPjFW...",
      "name": "USD Coin",
      "symbol": "USDC"
    }
  }
}

OHLCV Array Format:

[timestamp, open, high, low, close, volume]

Timeframe Examples

TimeframeEndpointAggregate
1 minute/ohlcv/minute1
5 minutes/ohlcv/minute5
15 minutes/ohlcv/minute15
1 hour/ohlcv/hour1
4 hours/ohlcv/hour4
1 day/ohlcv/day1

📜 Trade History

Get recent trades for a pool.

Endpoint: GET /networks/{network}/pools/{pool_address}/trades

Query Parameters:

  • trade_volume_in_usd_greater_than: Filter by minimum USD volume

Example:

GET https://api.geckoterminal.com/api/v2/networks/solana/pools/7XawhbbxtsRcQA8KTkHT9f9nc6d69UwqCDh6U5EEbEmX/trades?trade_volume_in_usd_greater_than=100

Response:

{
  "data": [
    {
      "id": "solana_tx_signature...",
      "type": "trade",
      "attributes": {
        "block_number": 235678901,
        "tx_hash": "signature...",
        "tx_from_address": "wallet...",
        "from_token_amount": "10.5",
        "to_token_amount": "2089.75",
        "price_from_in_currency_token": "198.93",
        "price_to_in_currency_token": "0.00502",
        "price_from_in_usd": "198.93",
        "price_to_in_usd": "1.00",
        "volume_in_usd": "2089.75",
        "kind": "buy",
        "block_timestamp": "2024-01-15T10:30:45Z"
      }
    }
  ]
}

Search for tokens and pools.

Endpoint: GET /search/pools

Query Parameters:

  • query: Search term
  • network: Filter by network (optional)
  • page: Page number

Example:

GET https://api.geckoterminal.com/api/v2/search/pools?query=JUP&network=solana

🛠️ Integration Examples

Fetching OHLCV for Charts

async function getOHLCV(poolAddress, timeframe = 'hour', limit = 100) {
  const url = `https://api.geckoterminal.com/api/v2/networks/solana/pools/${poolAddress}/ohlcv/${timeframe}?limit=${limit}`;
  
  const response = await fetch(url);
  const data = await response.json();
  
  return data.data.attributes.ohlcv_list.map(candle => ({
    timestamp: candle[0] * 1000, // Convert to milliseconds
    open: parseFloat(candle[1]),
    high: parseFloat(candle[2]),
    low: parseFloat(candle[3]),
    close: parseFloat(candle[4]),
    volume: parseFloat(candle[5])
  }));
}
async function getTrendingPools(duration = '1h') {
  const url = `https://api.geckoterminal.com/api/v2/networks/solana/trending_pools?duration=${duration}`;
  
  const response = await fetch(url);
  const data = await response.json();
  
  return data.data.map(pool => ({
    name: pool.attributes.name,
    address: pool.attributes.address,
    price: pool.attributes.base_token_price_usd,
    volume24h: pool.attributes.volume_usd?.h24,
    priceChange24h: pool.attributes.price_change_percentage?.h24
  }));
}

Pool Discovery

async function findPoolsForToken(tokenAddress) {
  const url = `https://api.geckoterminal.com/api/v2/networks/solana/tokens/${tokenAddress}/pools`;
  
  const response = await fetch(url);
  const data = await response.json();
  
  // Sort by liquidity
  return data.data.sort((a, b) => {
    const liqA = parseFloat(a.attributes.reserve_in_usd || 0);
    const liqB = parseFloat(b.attributes.reserve_in_usd || 0);
    return liqB - liqA;
  });
}

⚠️ Best Practices

1. Respect Rate Limits

class GeckoTerminalClient {
  constructor(requestIntervalMs = 6000) {
    this.requestQueue = [];
    this.processing = false;
    this.requestIntervalMs = requestIntervalMs;
  }
  
  async request(endpoint) {
    return new Promise((resolve, reject) => {
      this.requestQueue.push({ endpoint, resolve, reject });
      this.processQueue();
    });
  }
  
  async processQueue() {
    if (this.processing || this.requestQueue.length === 0) return;
    
    this.processing = true;
    const { endpoint, resolve, reject } = this.requestQueue.shift();
    let nextDelay = this.requestIntervalMs;
    
    try {
      const response = await fetch(
        `https://api.geckoterminal.com/api/v2${endpoint}`
      );

      if (!response.ok) {
        if (response.status === 429) {
          const retryAfterSeconds = Number(response.headers.get("retry-after"));
          nextDelay = Number.isFinite(retryAfterSeconds)
            ? Math.max(nextDelay, retryAfterSeconds * 1000)
            : nextDelay * 2;
        }

        throw new Error(`GeckoTerminal request failed: ${response.status}`);
      }

      resolve(await response.json());
    } catch (error) {
      reject(error);
    }
    
    // Start conservatively; tune only to the current published/account limit.
    setTimeout(() => {
      this.processing = false;
      this.processQueue();
    }, nextDelay);
  }
}

2. Cache OHLCV Data

Historical data doesn't change - cache it:

const ohlcvCache = new Map();

async function getCachedOHLCV(poolAddress, timeframe) {
  const cacheKey = `${poolAddress}_${timeframe}`;
  
  if (ohlcvCache.has(cacheKey)) {
    return ohlcvCache.get(cacheKey);
  }
  
  const data = await getOHLCV(poolAddress, timeframe);
  ohlcvCache.set(cacheKey, data);
  
  return data;
}

3. Handle Pagination

async function getAllTrendingPools(duration = '1h') {
  const allPools = [];
  let page = 1;
  let hasMore = true;
  
  while (hasMore) {
    const url = `https://api.geckoterminal.com/api/v2/networks/solana/trending_pools?duration=${duration}&page=${page}`;
    const response = await fetch(url);
    const data = await response.json();
    
    if (data.data.length === 0) {
      hasMore = false;
    } else {
      allPools.push(...data.data);
      page++;
    }
    
    await sleep(2000); // Respect rate limits
  }
  
  return allPools;
}

In Practice

ScreenerBot runs on this exact pool and OHLCV surface: GeckoTerminal drives discovery, pool context, and the candles behind strategy evaluation, while direct on-chain pool prices - not GeckoTerminal's - are what the trading and P&L math actually use. If you're building the same split, that boundary is the part worth getting right first.


📚 Resources


🎓 Key Takeaways

  1. Keyless public API - Suitable for low-volume use; handle IP-based limits and 429 responses
  2. OHLCV support - Great for building charts
  3. Multi-network coverage - One API shape spans many on-chain markets
  4. CoinGecko integration - Keyed /onchain access is available for production plans
  5. Cache historical data - It doesn't change
  6. Use pagination - For complete data sets

GeckoTerminal's API is perfect for building analytics and charting applications. Now you have everything you need! 🚀

View all research