CoinGecko Crypto Market Data API

The CoinGecko Crypto Market Data API provides comprehensive and reliable cryptocurrency price and market data through RESTful JSON endpoints. It offers over 70 endpoints covering real-time and historical prices, trading volumes, market capitalization, OHLCV data, exchange information, NFT metrics, derivatives data, and public treasury holdings for over 18,000 coins.

OpenAPI Specification

coingecko-crypto-market-data-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: CoinGecko Crypto Market Data API
  description: >-
    The CoinGecko Crypto Market Data API provides comprehensive and reliable
    cryptocurrency price and market data through RESTful JSON endpoints. It
    offers over 70 endpoints covering real-time and historical prices, trading
    volumes, market capitalization, OHLCV data, exchange information, NFT
    metrics, derivatives data, and public treasury holdings for over 18,000
    coins. The Demo API plan provides free access with 30 calls per minute
    to a subset of 30 publicly accessible endpoints.
  version: '3.0.1'
  contact:
    name: CoinGecko Support
    url: https://support.coingecko.com
  termsOfService: https://www.coingecko.com/en/terms
externalDocs:
  description: CoinGecko API Documentation
  url: https://docs.coingecko.com
servers:
  - url: https://api.coingecko.com/api/v3
    description: CoinGecko Demo API Server
tags:
  - name: Asset Platforms
    description: >-
      List all asset platforms (blockchains) supported by CoinGecko.
  - name: Categories
    description: >-
      List cryptocurrency categories and their market data.
  - name: Coins
    description: >-
      Comprehensive coin data including current prices, market data,
      historical data, tickers, and OHLCV charts.
  - name: Companies
    description: >-
      Public company cryptocurrency holdings data.
  - name: Contract
    description: >-
      Query coin data by contract address on a specific asset platform.
  - name: Derivatives
    description: >-
      Derivatives market data including tickers and exchange information.
  - name: Exchange Rates
    description: >-
      BTC exchange rates against other currencies.
  - name: Exchanges
    description: >-
      Exchange data including volumes, tickers, and status updates.
  - name: Global
    description: >-
      Global cryptocurrency and DeFi market data.
  - name: NFTs
    description: >-
      NFT collection data including floor prices and market information.
  - name: Ping
    description: Check API server status
  - name: Search
    description: >-
      Search for coins, exchanges, and categories.
  - name: Simple
    description: >-
      Simple price and token price lookups without the overhead of full
      coin data responses.
  - name: Trending
    description: >-
      Trending coins, NFTs, and categories on CoinGecko.
security:
  - demoApiKeyHeader: []
  - demoApiKeyQuery: []
paths:
  /ping:
    get:
      operationId: ping
      summary: Check API server status
      description: >-
        Check the API server status. Returns a gecko_says message to confirm
        the server is operational.
      tags:
        - Ping
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  gecko_says:
                    type: string
                    description: Status message from the API server
  /simple/price:
    get:
      operationId: getSimplePrice
      summary: Get coin price by IDs
      description: >-
        Query the prices of one or more coins by using their unique CoinGecko
        coin IDs. Optionally include market cap, 24h volume, 24h change,
        and last updated timestamp.
      tags:
        - Simple
      parameters:
        - $ref: '#/components/parameters/coinIds'
        - $ref: '#/components/parameters/vsCurrencies'
        - name: include_market_cap
          in: query
          description: Include market cap in the response
          schema:
            type: boolean
            default: false
        - name: include_24hr_vol
          in: query
          description: Include 24-hour trading volume in the response
          schema:
            type: boolean
            default: false
        - name: include_24hr_change
          in: query
          description: Include 24-hour price change percentage in the response
          schema:
            type: boolean
            default: false
        - name: include_last_updated_at
          in: query
          description: Include last updated timestamp in the response
          schema:
            type: boolean
            default: false
        - name: precision
          in: query
          description: Decimal precision for currency price values (0-18)
          schema:
            type: string
            enum: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', 'full']
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: object
                  additionalProperties:
                    type: number
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - invalid or missing API key
        '429':
          description: Rate limit exceeded
  /simple/token_price/{id}:
    get:
      operationId: getSimpleTokenPrice
      summary: Get token price by contract address
      description: >-
        Query the prices of one or more tokens by using their contract
        addresses on a specific asset platform. This endpoint is useful
        for looking up token prices when you have the contract address
        rather than the CoinGecko coin ID.
      tags:
        - Simple
      parameters:
        - $ref: '#/components/parameters/assetPlatformId'
        - name: contract_addresses
          in: query
          required: true
          description: >-
            Comma-separated list of token contract addresses on the specified
            asset platform
          schema:
            type: string
        - $ref: '#/components/parameters/vsCurrencies'
        - name: include_market_cap
          in: query
          description: Include market cap in the response
          schema:
            type: boolean
            default: false
        - name: include_24hr_vol
          in: query
          description: Include 24-hour trading volume in the response
          schema:
            type: boolean
            default: false
        - name: include_24hr_change
          in: query
          description: Include 24-hour price change percentage in the response
          schema:
            type: boolean
            default: false
        - name: include_last_updated_at
          in: query
          description: Include last updated timestamp in the response
          schema:
            type: boolean
            default: false
        - name: precision
          in: query
          description: Decimal precision for currency price values (0-18)
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: object
                  additionalProperties:
                    type: number
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - invalid or missing API key
  /simple/supported_vs_currencies:
    get:
      operationId: getSimpleSupportedVsCurrencies
      summary: Get supported vs currencies
      description: >-
        Get the list of all supported vs currencies (fiat and crypto) that
        can be used in price queries.
      tags:
        - Simple
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  description: Currency identifier (e.g., usd, btc, eth)
  /coins/list:
    get:
      operationId: getCoinsList
      summary: List all supported coins
      description: >-
        Get the complete list of all supported coins with their IDs, symbols,
        and names. Use this endpoint to obtain coin IDs for use in other
        endpoints. This list is cached and updated periodically.
      tags:
        - Coins
      parameters:
        - name: include_platform
          in: query
          description: >-
            Include platform contract addresses in the response (e.g.,
            Ethereum, Solana contract addresses)
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CoinListItem'
  /coins/markets:
    get:
      operationId: getCoinsMarkets
      summary: List coins with market data
      description: >-
        Get a paginated list of all supported coins with price, market cap,
        volume, and other market-related data. Results are ordered by market
        cap rank by default.
      tags:
        - Coins
      parameters:
        - name: vs_currency
          in: query
          required: true
          description: The target currency of market data (e.g., usd, eur, btc)
          schema:
            type: string
        - name: ids
          in: query
          description: Comma-separated list of coin IDs to filter results
          schema:
            type: string
        - name: category
          in: query
          description: Filter by coin category
          schema:
            type: string
        - name: order
          in: query
          description: Sort order for results
          schema:
            type: string
            enum:
              - market_cap_asc
              - market_cap_desc
              - volume_asc
              - volume_desc
              - id_asc
              - id_desc
            default: market_cap_desc
        - name: per_page
          in: query
          description: Number of results per page (1-250)
          schema:
            type: integer
            minimum: 1
            maximum: 250
            default: 100
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: sparkline
          in: query
          description: Include sparkline 7-day price data
          schema:
            type: boolean
            default: false
        - name: price_change_percentage
          in: query
          description: >-
            Comma-separated list of price change percentage timeframes
            (1h, 24h, 7d, 14d, 30d, 200d, 1y)
          schema:
            type: string
        - name: locale
          in: query
          description: Language locale for descriptions
          schema:
            type: string
            default: en
        - name: precision
          in: query
          description: Decimal precision for currency price values
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CoinMarket'
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - invalid or missing API key
  /coins/{id}:
    get:
      operationId: getCoinById
      summary: Get coin data by ID
      description: >-
        Get comprehensive data for a specific coin including current price,
        market data, community data, developer data, and more. This is the
        most detailed single-coin endpoint.
      tags:
        - Coins
      parameters:
        - $ref: '#/components/parameters/coinId'
        - name: localization
          in: query
          description: Include all localized language descriptions
          schema:
            type: boolean
            default: true
        - name: tickers
          in: query
          description: Include exchange tickers data
          schema:
            type: boolean
            default: true
        - name: market_data
          in: query
          description: Include market data
          schema:
            type: boolean
            default: true
        - name: community_data
          in: query
          description: Include community data
          schema:
            type: boolean
            default: true
        - name: developer_data
          in: query
          description: Include developer data
          schema:
            type: boolean
            default: true
        - name: sparkline
          in: query
          description: Include sparkline 7-day price data
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoinData'
        '404':
          description: Coin not found
  /coins/{id}/tickers:
    get:
      operationId: getCoinTickers
      summary: Get coin tickers
      description: >-
        Get trading pair tickers for a specific coin across all exchanges.
        Results include price, volume, spread, and trust score information.
      tags:
        - Coins
      parameters:
        - $ref: '#/components/parameters/coinId'
        - name: exchange_ids
          in: query
          description: Filter tickers by exchange IDs (comma-separated)
          schema:
            type: string
        - name: include_exchange_logo
          in: query
          description: Include exchange logo URL in the response
          schema:
            type: boolean
            default: false
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: order
          in: query
          description: Sort order for tickers
          schema:
            type: string
            enum:
              - trust_score_desc
              - trust_score_asc
              - volume_desc
              - volume_asc
            default: trust_score_desc
        - name: depth
          in: query
          description: Include order book depth (2% cost to move)
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    description: Coin name
                  tickers:
                    type: array
                    items:
                      $ref: '#/components/schemas/Ticker'
        '404':
          description: Coin not found
  /coins/{id}/history:
    get:
      operationId: getCoinHistory
      summary: Get historical coin data
      description: >-
        Get historical data for a specific coin at a given date. Includes
        price, market cap, 24h volume, and community and developer data.
      tags:
        - Coins
      parameters:
        - $ref: '#/components/parameters/coinId'
        - name: date
          in: query
          required: true
          description: The date of data snapshot in dd-mm-yyyy format
          schema:
            type: string
            pattern: '^\d{2}-\d{2}-\d{4}$'
        - name: localization
          in: query
          description: Include all localized language descriptions
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoinData'
        '404':
          description: Coin not found
  /coins/{id}/market_chart:
    get:
      operationId: getCoinMarketChart
      summary: Get coin market chart data
      description: >-
        Get historical market data including price, market cap, and 24h
        volume for a specific coin over a time range. Data granularity is
        automatic based on the number of days requested.
      tags:
        - Coins
      parameters:
        - $ref: '#/components/parameters/coinId'
        - name: vs_currency
          in: query
          required: true
          description: The target currency for market data
          schema:
            type: string
        - name: days
          in: query
          required: true
          description: >-
            Number of days of historical data (1, 7, 14, 30, 90, 180, 365,
            or max for all available data)
          schema:
            type: string
        - name: interval
          in: query
          description: Data interval (daily). Leave empty for automatic granularity.
          schema:
            type: string
            enum:
              - daily
        - name: precision
          in: query
          description: Decimal precision for currency price values
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketChart'
        '404':
          description: Coin not found
  /coins/{id}/market_chart/range:
    get:
      operationId: getCoinMarketChartRange
      summary: Get coin market chart data within date range
      description: >-
        Get historical market data including price, market cap, and 24h
        volume for a specific coin within a custom date range specified by
        UNIX timestamps.
      tags:
        - Coins
      parameters:
        - $ref: '#/components/parameters/coinId'
        - name: vs_currency
          in: query
          required: true
          description: The target currency for market data
          schema:
            type: string
        - name: from
          in: query
          required: true
          description: Start date as UNIX timestamp
          schema:
            type: number
        - name: to
          in: query
          required: true
          description: End date as UNIX timestamp
          schema:
            type: number
        - name: precision
          in: query
          description: Decimal precision for currency price values
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketChart'
        '404':
          description: Coin not found
  /coins/{id}/ohlc:
    get:
      operationId: getCoinOHLC
      summary: Get coin OHLC chart data
      description: >-
        Get OHLC (Open, High, Low, Close) candlestick data for a specific
        coin. Data granularity is automatic based on the number of days
        requested. 1-2 days returns 30-minute candles, 3-30 days returns
        4-hour candles, and 31+ days returns daily candles.
      tags:
        - Coins
      parameters:
        - $ref: '#/components/parameters/coinId'
        - name: vs_currency
          in: query
          required: true
          description: The target currency for OHLC data
          schema:
            type: string
        - name: days
          in: query
          required: true
          description: Number of days of historical data (1, 7, 14, 30, 90, 180, 365)
          schema:
            type: string
        - name: precision
          in: query
          description: Decimal precision for currency price values
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: array
                  description: >-
                    OHLC data point as array of [timestamp, open, high, low, close]
                  items:
                    type: number
                  minItems: 5
                  maxItems: 5
        '404':
          description: Coin not found
  /coins/{id}/contract/{contract_address}:
    get:
      operationId: getCoinByContractAddress
      summary: Get coin data by contract address
      description: >-
        Get comprehensive coin data by querying a contract address on a
        specific asset platform. Returns the same data as the /coins/{id}
        endpoint.
      tags:
        - Contract
      parameters:
        - $ref: '#/components/parameters/assetPlatformId'
        - $ref: '#/components/parameters/contractAddress'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoinData'
        '404':
          description: Coin or contract not found
  /coins/{id}/contract/{contract_address}/market_chart:
    get:
      operationId: getCoinContractMarketChart
      summary: Get coin market chart data by contract address
      description: >-
        Get historical market data including price, market cap, and 24h
        volume by querying a contract address on a specific asset platform.
      tags:
        - Contract
      parameters:
        - $ref: '#/components/parameters/assetPlatformId'
        - $ref: '#/components/parameters/contractAddress'
        - name: vs_currency
          in: query
          required: true
          description: The target currency for market data
          schema:
            type: string
        - name: days
          in: query
          required: true
          description: Number of days of historical data
          schema:
            type: string
        - name: precision
          in: query
          description: Decimal precision for currency price values
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketChart'
        '404':
          description: Coin or contract not found
  /coins/{id}/contract/{contract_address}/market_chart/range:
    get:
      operationId: getCoinContractMarketChartRange
      summary: Get coin market chart range data by contract address
      description: >-
        Get historical market data for a specific contract address within a
        custom date range specified by UNIX timestamps.
      tags:
        - Contract
      parameters:
        - $ref: '#/components/parameters/assetPlatformId'
        - $ref: '#/components/parameters/contractAddress'
        - name: vs_currency
          in: query
          required: true
          description: The target currency for market data
          schema:
            type: string
        - name: from
          in: query
          required: true
          description: Start date as UNIX timestamp
          schema:
            type: number
        - name: to
          in: query
          required: true
          description: End date as UNIX timestamp
          schema:
            type: number
        - name: precision
          in: query
          description: Decimal precision for currency price values
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketChart'
        '404':
          description: Coin or contract not found
  /asset_platforms:
    get:
      operationId: getAssetPlatforms
      summary: List asset platforms
      description: >-
        Get the list of all asset platforms (blockchains) supported by
        CoinGecko. Each platform includes its chain identifier and
        native coin ID.
      tags:
        - Asset Platforms
      parameters:
        - name: filter
          in: query
          description: Filter by platform type (e.g., nft to get NFT-supported platforms)
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AssetPlatform'
  /coins/categories/list:
    get:
      operationId: getCoinsCategoriesList
      summary: List all categories (ID map)
      description: >-
        Get the complete list of all supported coin categories with their
        IDs and names. Use this to obtain category IDs for filtering in
        other endpoints.
      tags:
        - Categories
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    category_id:
                      type: string
                      description: Category identifier
                    name:
                      type: string
                      description: Category display name
  /coins/categories:
    get:
      operationId: getCoinsCategories
      summary: List categories with market data
      description: >-
        Get the list of all coin categories with market data including
        market cap, volume, and top coins in each category.
      tags:
        - Categories
      parameters:
        - name: order
          in: query
          description: Sort order for categories
          schema:
            type: string
            enum:
              - market_cap_desc
              - market_cap_asc
              - name_desc
              - name_asc
              - market_cap_change_24h_desc
              - market_cap_change_24h_asc
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Category'
  /exchanges:
    get:
      operationId: getExchanges
      summary: List all exchanges
      description: >-
        Get a paginated list of all supported exchanges with volume, trust
        score, and other exchange-related data. Results are ordered by
        trading volume by default.
      tags:
        - Exchanges
      parameters:
        - name: per_page
          in: query
          description: Number of results per page (1-250)
          schema:
            type: integer
            minimum: 1
            maximum: 250
            default: 100
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Exchange'
  /exchanges/list:
    get:
      operationId: getExchangesList
      summary: List all supported exchanges (ID map)
      description: >-
        Get the complete list of all supported exchange IDs and names.
        Use this to obtain exchange IDs for use in other endpoints.
      tags:
        - Exchanges
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Exchange identifier
                    name:
                      type: string
                      description: Exchange display name
  /exchanges/{id}:
    get:
      operationId: getExchangeById
      summary: Get exchange data by ID
      description: >-
        Get comprehensive data for a specific exchange including volume,
        trust score, year established, country, and social links.
      tags:
        - Exchanges
      parameters:
        - $ref: '#/components/parameters/exchangeId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeData'
        '404':
          description: Exchange not found
  /exchanges/{id}/tickers:
    get:
      operationId: getExchangeTickers
      summary: Get exchange tickers
      description: >-
        Get paginated trading pair tickers for a specific exchange. Results
        include price, volume, spread, and trust score data for each
        trading pair.
      tags:
        - Exchanges
      parameters:
        - $ref: '#/components/parameters/exchangeId'
        - name: coin_ids
          in: query
          description: Filter tickers by coin IDs (comma-separated)
          schema:
            type: string
        - name: include_exchange_logo
          in: query
          description: Include exchange logo URL in the response
          schema:
            type: boolean
            default: false
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            default: 1
        - name: depth
          in: query
          description: Include order book depth (2% cost to move)
          schema:
            type: boolean
            default: false
        - name: order
          in: query
          description: Sort order for tickers
          schema:
            type: string
            enum:
              - trust_score_desc
              - trust_score_asc
              - volume_desc
              - volume_asc
            default: trust_score_desc
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    description: Exchange name
                  tickers:
                    type: array
                    items:
                      $ref: '#/components/schemas/Ticker'
        '404':
          description: Exchange not found
  /exchanges/{id}/volume_chart:
    get:
      operationId: getExchangeVolumeChart
      summary: Get exchange volume chart data
      description: >-
        Get historical volume chart data for a specific exchange over a
        specified number of days.
      tags:
        - Exchanges
      parameters:
        - $ref: '#/components/parameters/exchangeId'
        - name: days
          in: query
          required: true
          description: Number of days of historical data (1, 7, 14, 30, 90, 180, 365)
          schema:
            type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: array
                  description: Volume data point as [timestamp, volume_in_btc]
                  items:
                    type: string
                  minItems: 2
                  maxItems: 2
        '404':
          description: Exchange not found
  /derivatives:
    get:
      operationId: getDerivatives
      summary: List all derivative tickers
      description: >-
        Get the list of all derivative tickers across all exchanges including
        price, index, basis, spread, and open interest data.
      tags:
        - Derivatives
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DerivativeTicker'
  /derivatives/exchanges:
    get:
      operationId: getDerivativesExchanges
      summary: List derivative exchanges
      description: >-
        Get the list of all derivative exchanges with data including open
        interest, trade volume, and number of perpetual and futures pairs.
      tags:
        - Derivatives
      parameters:
        - name: order
          in: query
          description: Sort order for results
          schema:
            type: string
            enum:
              - name_asc
              - name_desc
              - open_interest_btc_asc
              -

# --- truncated at 32 KB (69 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/coingecko/refs/heads/main/openapi/coingecko-crypto-market-data-api-openapi.yml