CoinMarketCap Public API Documentation

Version 2


Summary of Endpoints

Public API Endpoints

Listings

  • 端点: /listings/
  • 方法: GET
  • Description: This endpoint displays all active cryptocurrency listings in one call. Use the "id" field on the Ticker endpoint to query more information on a specific cryptocurrency.
  • 例子: https://api.coinmarketcap.com/v2/listings/
  • 抽样回复:
    {
        "data": [
            {
                "id": 1, 
                "name": "Bitcoin", 
                "symbol": "BTC", 
                "website_slug": "bitcoin"
            }, 
            {
                "id": 2, 
                "name": "Litecoin", 
                "symbol": "LTC", 
                "website_slug": "litecoin"
            }, 
            ...
        },
        "metadata": {
            "timestamp": 1525137187, 
            "num_cryptocurrencies": 1602, 
            "error": null
        }
    ]                               

代码

  • 端点: /ticker/
  • 方法: GET
  • Description: This endpoint displays cryptocurrency ticker data in order of rank. The maximum number of results per call is 100. Pagination is possible by using the start and limit parameters.
  • 可选参数:
    • (int) start - return results from rank [start] and above (default is 1)
    • (int) limit - return a maximum of [limit] results (default is 100; max is 100)
    • (string) sort - return results sorted by [sort] . Possible values are id, rank, volume_24h, and percent_change_24h (default is rank).
      Note: It is strongly recommended to use id to sort if paginating through all available results since id is the only sort option guaranteed to return in a consistent order.
    • (string) structure - specify the structure for the main data field. Possible values are dictionary and array (default is dictionary).
    • (string) convert - return pricing info in terms of another currency.
      Valid fiat currency values are: "AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR"
      Valid cryptocurrency values are: "BTC", "ETH" "XRP", "LTC", and "BCH"
  • 例子: https://api.coinmarketcap.com/v2/ticker/
  • 例子: https://api.coinmarketcap.com/v2/ticker/?limit=10
  • 例子: https://api.coinmarketcap.com/v2/ticker/?start=101&limit=10
  • 例子: https://api.coinmarketcap.com/v2/ticker/?start=101&limit=10&sort=id
  • 例子: https://api.coinmarketcap.com/v2/ticker/?start=101&limit=10&sort=id&structure=array
  • 例子: https://api.coinmarketcap.com/v2/ticker/?convert=EUR&limit=10
  • 例子: https://api.coinmarketcap.com/v2/ticker/?convert=BTC&limit=10
  • 抽样回复:
    {
        "data": {
            "1": {
                "id": 1, 
                "name": "Bitcoin", 
                "symbol": "BTC", 
                "website_slug": "bitcoin", 
                "rank": 1, 
                "circulating_supply": 17008162.0, 
                "total_supply": 17008162.0, 
                "max_supply": 21000000.0, 
                "quotes": {
                    "USD": {
                        "price": 9024.09, 
                        "volume_24h": 8765400000.0, 
                        "market_cap": 153483184623.0, 
                        "percent_change_1h": -2.31, 
                        "percent_change_24h": -4.18, 
                        "percent_change_7d": -0.47
                    }
                }, 
                "last_updated": 1525137271
            }, 
            "1027": {
                "id": 1027, 
                "name": "Ethereum", 
                "symbol": "ETH", 
                "website_slug": "ethereum", 
                "rank": 2, 
                "circulating_supply": 99151888.0, 
                "total_supply": 99151888.0, 
                "max_supply": null, 
                "quotes": {
                    "USD": {
                        "price": 642.399, 
                        "volume_24h": 2871290000.0, 
                        "market_cap": 63695073558.0, 
                        "percent_change_1h": -3.75, 
                        "percent_change_24h": -7.01, 
                        "percent_change_7d": -2.32
                    }
                }, 
                "last_updated": 1525137260
            } 
            ...
        },
        "metadata": {
            "timestamp": 1525137187, 
            "num_cryptocurrencies": 1602, 
            "error": null
        }
    ]                               

代码(具体货币)

  • 端点: /ticker/{id}/
  • 方法: GET
  • Description: This endpoint displays ticker data for a specific cryptocurrency. Use the "id" field from the Listings endpoint in the URL.
  • 可选参数:
    • (string) structure - specify the structure for the main data field. Possible values are dictionary and array (default is dictionary).
    • (string) convert - return pricing info in terms of another currency.
      Valid fiat currency values are: "AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR"
      Valid cryptocurrency values are: "BTC", "ETH" "XRP", "LTC", and "BCH"
  • 例子: https://api.coinmarketcap.com/v2/ticker/1/
  • 例子: https://api.coinmarketcap.com/v2/ticker/1/?structure=array
  • 例子: https://api.coinmarketcap.com/v2/ticker/1/?convert=EUR
  • 例子: https://api.coinmarketcap.com/v2/ticker/1/?convert=BCH
  • 抽样回复:
    {
        "data": {
            "id": 1, 
            "name": "Bitcoin", 
            "symbol": "BTC", 
            "website_slug": "bitcoin", 
            "rank": 1, 
            "circulating_supply": 17008162.0, 
            "total_supply": 17008162.0, 
            "max_supply": 21000000.0, 
            "quotes": {
                "USD": {
                    "price": 9024.09, 
                    "volume_24h": 8765400000.0, 
                    "market_cap": 153483184623.0, 
                    "percent_change_1h": -2.31, 
                    "percent_change_24h": -4.18, 
                    "percent_change_7d": -0.47
                }
            }, 
            "last_updated": 1525137271
        },
        "metadata": {
            "timestamp": 1525237332, 
            "error": null
        }
    
    }               
  • 抽样误差回复:
    {
        "data": null, 
        "metadata": {
            "timestamp": 1525137187, 
            "error": "id not found"
        }
    }                                
                                

全球数据

  • 端点: /global/
  • 方法: GET
  • Description: This endpoint displays the global data found at the top of coinmarketcap.com.
  • 可选参数:
    • (string) convert - return pricing info in terms of another currency.
      Valid fiat currency values are: "AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR"
      Valid cryptocurrency values are: "BTC", "ETH" "XRP", "LTC", and "BCH"
  • 例子: https://api.coinmarketcap.com/v2/global/
  • 例子: https://api.coinmarketcap.com/v2/global/?convert=EUR
  • 例子: https://api.coinmarketcap.com/v2/global/?convert=BTC
  • 抽样回复:
    {
        "data": {
            "active_cryptocurrencies": 1594, 
            "active_markets": 10526, 
            "bitcoin_percentage_of_market_cap": 37.65, 
            "quotes": {
                "USD": {
                    "total_market_cap": 407690157494.0, 
                    "total_volume_24h": 30969801118.0
                }
            }, 
            "last_updated": 1525137271
        },
        "metadata": {
            "timestamp": 1525237332, 
            "error": null
        }
    }                       


付费API

即将推出 - 填写意向表接受发布通知

其他

限制

  • Please limit requests to no more than 30 per minute.
  • 端点每五分钟更新一次。

Terms of Use

  • By accessing the Public API, you agree to be bound by the Terms of Use.

Looking for API Version 1?

  • Documentation is here.

最后更新记录

  • 2018年05月20日