Skip to content

Repository files navigation

GeckoTerminal API Wrapper

A Node.js wrapper for the GeckoTerminal API.

Installation

npm install geckoterminal-api

Usage

import { GeckoTerminal } from 'geckoterminal-api';

const geckoTerminal = new GeckoTerminal();

// Get all supported networks
const networks = await geckoTerminal.getNetworks();
console.log(networks.data[0].attributes.name); // "Ethereum"

// Get a specific pool with related resources
const wethUsdc = await geckoTerminal.getPool('eth', '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640', {
  include: ['base_token', 'quote_token', 'dex']
});
console.log(wethUsdc.data.attributes.name); // "WETH/USDC"

// Get token prices
const prices = await geckoTerminal.getPrices('eth', [
  '0xdac17f958d2ee523a2206206994597c13d831ec7', // USDT
  '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // USDC
  '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'  // WETH
]);
console.log(prices.data[0].attributes.price_usd);

Configuration

const geckoTerminal = new GeckoTerminal({
  baseUrl: 'https://api.geckoterminal.com/api',
  apiVersion: 'v2',
  headers: {
    'Accept-Language': 'en-US'
  }
});

Rate Limits

The GeckoTerminal API has a rate limit of 30 requests per minute for free usage. For higher rate limits, you can subscribe to a CoinGecko API paid plan.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages