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

Python SDK

The official Python SDK wraps the CoinMarketCap Pro API with typed request/response models, automatic retries, and a namespace API grouped by endpoint category.

  • PyPI: coinmarketcap-sdk
  • GitHub: OpenCMC/coinmarketcap-api-python
  • Import name: coinmarketcap (package on PyPI is coinmarketcap-sdk)
  • Requires: Python 3.10+

Get started

  1. Install the package

    TerminalCode
    pip install coinmarketcap-sdk

    Or with uv / Poetry:

    TerminalCode
    uv add coinmarketcap-sdk poetry add coinmarketcap-sdk
  2. Create a client

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

    Code
    import os from coinmarketcap import CoinMarketCap cmc = CoinMarketCap(api_key=os.environ["CMC_PRO_API_KEY"])
  3. Call an endpoint

    Endpoints are grouped by category on the client instance:

    Code
    quotes = cmc.cryptocurrency.quotes_latest(id="1,1027") listings = cmc.cryptocurrency.listings_latest(limit=10)

    Async variants use the async_ prefix:

    Code
    quotes = await cmc.cryptocurrency.async_quotes_latest(id="1,1027")
  4. Handle errors

    The SDK raises typed exceptions for common HTTP failures:

    Code
    from coinmarketcap import CMCError, RateLimitError, AuthenticationError try: quotes = cmc.cryptocurrency.quotes_latest(id="1") except RateLimitError: # 429 — backoff or reduce request rate ... except AuthenticationError: # 401 — check your API key ... except CMCError as e: print(e.status_code, e)

Public (keyless) mode

Code
from coinmarketcap import CoinMarketCap cmc = CoinMarketCap(environment="public") cmc.cryptocurrency.listings_latest(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 examples on GitHub
Best PracticesTypeScript
On this page
  • Get started
  • Public (keyless) mode
  • Next steps