有什么方法可以下载与 GitHub 主题匹配的项目列表吗? 例如,如果我写:
https://github.com/topics/haskell
在 Web 浏览器中,返回包含与 Haskell 相关的 GitHub 项目的页面。我读了他们的 GitHub API,但他们似乎没有实现该功能:https://developer.github.com/v3/
还有端点 https://api.github.com/似乎不包含任何选项。我的尝试所得到的一切,例如 https://api.github.com/topics/haskell是:
{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3"
}
最佳答案
如果您想搜索与主题匹配的存储库,请使用 /search/repositories
带有 topic
属性:
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:haskell
您必须在仍处于开发者预览版时提供application/vnd.github.mercy-preview+json
:
Note: The topics property for repositories on GitHub is currently available for developers to preview. To view the topics property in calls that return repository results, you must provide a custom media type in the Accept header:
application/vnd.github.mercy-preview+json
关于git - 下载与主题匹配的 GitHub 存储库列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48390046/