A TypeScript-based Node.js client for the CoinGecko API v3, version 0.0.31. It provides full coverage of the CoinGecko API endpoints including simple price, coin data, market charts, exchange info, trending, and more. Zero runtime dependencies, ships with TypeScript definitions, and supports auto-retry on rate-limiting (HTTP 429). The library is actively maintained on GitHub with CI and code coverage. Key differentiator: a typed, fully promise-based client with minimal config compared to alternatives.
npm install coingecko-api-v3Verified import paths — ran on the pinned version, not inferred.
Initializes the client, pings the API, fetches Bitcoin price in USD, and retrieves trending coins.
Use `import { CoinGeckoClient } from 'coingecko-api-v3'` instead of `require('coingecko-api-v3')`.Implement your own rate-limiting or use a paid CoinGecko plan to increase limits.
Ensure `date` is a string in `dd-mm-yyyy` format when calling history methods.
Monitor CoinGecko API changelog; consider using `client.customRequest()` to manually call new endpoints.
Cache responses yourself or use a memoization pattern in your application.
Replace `import CoinGeckoClient from 'coingecko-api-v3'` with `import { CoinGeckoClient } from 'coingecko-api-v3'`.Ensure your `tsconfig.json` includes `"moduleResolution": "node"` and `"esModuleInterop": true`.
Increase the `timeout` option in the client constructor (default 30s). Also check your network and ensure you are not hitting API limits.
No dependency data recorded yet.