Skip to main content

Getting Started

Full type safety and auto-complete — catch errors at compile time, not runtime.

Prompt for integrating CoinGecko TypeScript SDK

Or set up manually:
1

Install

npm install @coingecko/coingecko-typescript
View on npm | GitHub
2

Import and authenticate

import Coingecko from '@coingecko/coingecko-typescript';

const client = new Coingecko({
  proAPIKey: 'YOUR_API_KEY',
  environment: 'pro',
});
Replace YOUR_API_KEY with your key from the Developer Dashboard.
3

Make your first request

async function main() {
  const response = await client.simple.price.get({
    vs_currencies: 'usd',
    ids: 'bitcoin',
  });

  console.log(JSON.stringify(response, null, 2));
}

main()

Finding Method Names

SDK methods map to API endpoint paths. For example, /simple/price becomes client.simple.price.get(). Two ways to find the right method:
  1. Reference pagescheck the SDK Examples section on any endpoint reference page.
  2. All methods — browse the full list with endpoint mappings.

Found a bug or missing feature? Open an issue.