You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用CoinMarketCap v2加密货币信息API GET请求报错求助

问题原因与解决方案
  • 接口功能混淆:你调用的/v2/cryptocurrency/info接口是用于查询指定加密货币的详情信息,并非批量获取无筛选的列表数据。该接口强制要求传入至少一个筛选参数(id/symbol/slug/address),否则就会返回value must contain at least one of [id, symbol, slug, address]的错误。

  • 批量获取100条数据的正确方式:如果需要一次性获取100条加密货币数据(比如Top100排名币种),应该使用专门的列表类接口,比如/v1/cryptocurrency/listings/latest,通过设置limit参数指定返回数量,示例请求:

    https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?CMC_PRO_API_KEY=your_key&limit=100
    
  • 正确调用/v2/cryptocurrency/info的示例:如果确实需要用该接口批量查询指定币种的信息,可以传入多个筛选值(用逗号分隔),比如:

    https://pro-api.coinmarketcap.com/v2/cryptocurrency/info?CMC_PRO_API_KEY=your_key&symbol=BTC,ETH,BNB
    

内容的提问来源于stack exchange,提问作者Hello422

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 16:25:39