CoinMarketCapCoinMarketCap
PricingAPI StatusGet API Key
  • Overview
  • API Reference
  • WebSocket
  • AI Agent Hub
  • Changelog
  • FAQ
If you are an AI agent, LLM, or automated tool, this documentation provides clean Markdown versions of pages. Use the HTTP Link header for the exact Markdown alternate, append .md to documentation page URLs, or start from https://pro.coinmarketcap.com/llms.txt.

© 2026 CoinMarketCap. All rights reserved.

xgithub
Start Here
    API OverviewKeyless Public APIGet Started with an API KeyAuthenticationCommon Workflows
Using the API
    Standards and ConventionsRate limits and troubleshootingBest Practices
Developer Tools
    SDKs & tools
      PythonTypeScript
SDKs & tools

TypeScript SDK

The official TypeScript/JavaScript SDK wraps the CoinMarketCap Pro API with full type definitions, automatic retries, and a namespace API grouped by endpoint category.

  • npm: @coinmarketcap/sdk
  • GitHub: OpenCMC/coinmarketcap-api-typescript
  • Requires: Node.js 18+ (TypeScript 5.0+ recommended)

Get started

  1. Install the package

    TerminalCode
    npm install @coinmarketcap/sdk

    Or with Yarn / pnpm:

    TerminalCode
    yarn add @coinmarketcap/sdk pnpm add @coinmarketcap/sdk
  2. Create a client

    Set your API key from the Developer Portal. For keyless endpoints, use environment: 'public'.

    Code
    import { CoinMarketCap } from "@coinmarketcap/sdk"; const cmc = new CoinMarketCap({ apiKey: process.env.CMC_PRO_API_KEY!, });
  3. Call an endpoint

    Endpoints are grouped under cmc.api:

    Code
    const { data, error } = await cmc.api.cryptocurrency.quotesLatest({ query: { id: "1,1027" }, }); if (data) { console.log(data); }

    Or throw on error:

    Code
    const { data } = await cmc.api.cryptocurrency.quotesLatest({ query: { id: "1" }, throwOnError: true, });
  4. Handle errors

    The SDK returns typed error classes (or throws when throwOnError: true):

    Code
    import { RateLimitError, AuthenticationError, CMCError } from "@coinmarketcap/sdk"; const { data, error } = await cmc.api.cryptocurrency.quotesLatest({ query: { id: "1" }, }); if (error instanceof RateLimitError) { // 429 — check Retry-After header } else if (error instanceof AuthenticationError) { // 401 — check your API key } else if (error instanceof CMCError) { console.log(error.status, error.message); }

Public (keyless) mode

Code
import { CoinMarketCap } from "@coinmarketcap/sdk"; const cmc = new CoinMarketCap({ environment: "public" }); await cmc.api.cryptocurrency.listingsLatest({ query: { limit: 10 } });

See the Keyless Public API for available endpoints without a key.

Next steps

  • Get Started with an API Key if you have not set up authentication yet
  • Choose an endpoint to find the right API family
  • Full README and API reference on GitHub
Python
On this page
  • Get started
  • Public (keyless) mode
  • Next steps
TypeScript
TypeScript
TypeScript
TypeScript
TypeScript