CoinGecko

CoinGecko

Official CoinGecko API MCP Server for Crypto Price & Market Data, across 200+ Blockchain Networks and 8M+ Tokens.

37
Stars
8
Forks
20
Releases

Overview

This repository provides a server-side TypeScript/JavaScript client for the CoinGecko REST API. It offers a typed interface for accessing price and market data via the REST endpoints, with support for Pro API access and Demo API access via environment selection. Installation is via npm, and usage examples show creating a client with API keys and making requests such as retrieving simple price data. The library ships with TypeScript definitions for all request parameters and responses, and rich error handling through APIError subclasses (BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, UnprocessableEntityError, RateLimitError, InternalServerError, APIConnectionError). Retries are automatic by default (2 retries with exponential backoff), and requests can be configured per-request or globally (maxRetries). Timeouts are configurable (default 1 minute). Raw response access is supported through asResponse() and withResponse(). Logging is configurable via COINGECKO_LOG or logLevel, and custom loggers are supported. It also enables undocumented endpoints and parameters, customizable fetch, and proxy support for Node/Deno/Bun environments.

Details

Owner
coingecko
Language
TypeScript
License
Apache License 2.0
Updated
2025-12-07

Features

Retry logic with exponential backoff

Automatically retries transient failures by default (2 retries) with exponential backoff; configurable maxRetries.

Configurable timeouts

Default 1 minute timeout with per-request overrides; per-request timeout supported.

Comprehensive error handling

APIError family with specific error types for common HTTP errors (e.g., BadRequestError, AuthenticationError, etc.).

Raw Response access

Access the raw fetch Response via asResponse() and withResponse() helpers.

Type-safe request/response definitions

TypeScript definitions for all request parameters and responses, with hover documentation.

Flexible fetch customization

Support custom fetch implementations, fetchOptions, and proxy configurations for different runtimes.

Undocumented endpoints support

Make calls to undocumented endpoints or parameters; extra values pass through without runtime validation.

Configurable logging

Control log output via COINGECKO_LOG or logLevel; optional custom logger support.

Audience

DevelopersBuild server-side apps in TypeScript/JavaScript to access CoinGecko price and market data via REST API.
API integratorsIntegrate CoinGecko data into dashboards and services with typed parameters.
Backend engineersEnsure resilient API calls with retries, timeouts, and customizable fetch.

Tags

TypeScriptJavaScriptREST APICoinGeckoAPI clientServer-sideError handlingRetriesTimeoutsLoggingUndocumented endpointsCustom fetchProxyDenoNodeBun