在Github中,是否有一种方法可以让我看到回购的下载数量?


当前回答

要查看发布文件/包被下载的次数,您可以访问https://githubstats0.firebaseapp.com

它会给你一个总下载计数和每个发布标签的总下载的细分。

其他回答

访问者数量应该可以在你的仪表板>流量(或统计数据或见解):

很晚了,但这是你想要的答案:

https://api.github.com/repos/ [git username] / [git project] /releases

接下来,在数据中找到您要查找的项目的id。它应该在顶部附近,在url旁边。然后,导航到

https://api.github.com/repos/ [git username] / [git project] /releases/ [id] / assets

名为download_count的字段就是答案。

编辑:在你的用户名和项目名中大写字母很重要

Github API不再提供所需的信息。看看Stan Towianski的回答中提到的发布页面。正如我们在回答的评论中讨论的那样,Github API只报告他每次发布的三个文件中的一个的下载量。

我已经检查了解决方案,在这个问题的其他一些答案。Vonc的回答体现了Michele Milidoni解决方案的关键部分。我安装了他的gdc脚本,结果如下

# ./gdc stant
mdcsvimporter.mxt: 37 downloads
mdcsvimporter.mxt: 80 downloads
How-to-use-mdcsvimporter-beta-16.zip: 12 downloads

正如您可以清楚地看到的,gdc没有报告tar.gz和zip文件的下载计数。

如果您想在不安装任何东西的情况下进行检查,请尝试Somsubhra在他的回答中提到的安装解决方案的网页。填写“stant”作为Github用户名和“mdcsvimportter2015”作为存储库名称,你会看到如下内容:

Download Info:
mdcsvimporter.mxt(0.20MB) - Downloaded 37 times.
Last updated on 2015-03-26

唉,还是只有一个没有下载tar.gz和zip文件的报告。我仔细检查了Github的API返回的信息,但它没有提供任何地方。目前,API返回的download_count还远远不够完整。

为了更清楚地说明这一点: 对于这个github项目:stant/ mdcsvimportter2015 https://github.com/stant/mdcsvimporter2015 在 https://github.com/stant/mdcsvimporter2015/releases

转到HTTP或https:(注意添加了“api.”和“/repos”) https://api.github.com/repos/stant/mdcsvimporter2015/releases

你会得到这个json输出,你可以搜索"download_count":

    "download_count": 2,
    "created_at": "2015-02-24T18:20:06Z",
    "updated_at": "2015-02-24T18:20:07Z",
    "browser_download_url": "https://github.com/stant/mdcsvimporter2015/releases/download/v18/mdcsvimporter-beta-18.zip"

或者在命令行执行: Wget——no-check-certificate https://api.github.com/repos/stant/mdcsvimporter2015/releases

我用javascript写了一个小的web应用程序,用于显示Github上任何项目可用版本中所有资产的下载数量。您可以在这里试用该应用程序:http://somsubhra.github.io/github-release-stats/