市值:

CoinMarketCap公共程序编程接口(API)文档

版本 2


端点汇总

公共应用程序编程接口(API)端点

列表

  • 端点: /listings/
  • 方法: GET
  • 描述: 该端点将显示一次查询下的所有活跃加密货币列表。使用代码端点的“id”区以查询某加密货币的详细信息
  • 例子: 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
  • 描述: 该端点将按序显示加密货币的代码。最大索引数量为100。可使用startlimit参数进行分页编码。
  • 可选参数:
    • (int) start - return results starting from the specified number (default is 1)
    • (int) limit - 返回最大 [limit] 获得 (默认为 100;最大为 100)
    • (string) sort - 返回筛选为 [sort] 的结果。可用值为idrankvolume_24h,及percent_change_24h(默认为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 - 表明主数据区的数据结构。可用值为dictionaryarray(默认为dictionary).
    • (string) convert - 返回其他货币的定价信息。
      可用法定通货货币为:"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"
      可用加密货币为:"BTC","ETH","XRP","LTC","BCH"
  • 例子: https://api.coinmarketcap.com/v2/ticker/
  • 例子: https://api.coinmarketcap.com/v2/ticker/?limit=10
  • 例子: https://api.coinmarketcap.com/v2/ticker/?limit=10&sort=id
  • 例子: 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
  • 描述: 端点将显示具体加密货币的代码数据。可使用链接中的列表端点的“id”栏。
  • 可选参数:
    • (string) structure - 表明主数据区的数据结构。可用值为dictionaryarray(默认为dictionary).
    • (string) convert - 返回其他货币的定价信息。
      可用法定通货货币为:"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"
      可用加密货币为:"BTC","ETH","XRP","LTC","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
  • 描述: 该端点将显示coinmarketcap.com上的最高全球数据。
  • 可选参数:
    • (string) convert - 返回其他货币的定价信息。
      可用法定通货货币为:"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"
      可用加密货币为:"BTC","ETH","XRP","LTC","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

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

其他

限制

  • 请限制每分钟请求不超过30次。
  • 端点每五分钟更新一次。

使用条款

  • 接入公共程序编程接口(API)将表明您同意受使用条款的约束.

在寻找第一版程序编程接口(API)文档?

最后更新记录

  • 2018年05月20日