在 github API 上访问 github 存储库的正确端点是什么?



我正在向github的API请求获取以下项目:回购名称、回购所有者名称、回购url、回购描述、星数、许可证类型,以及回购是否分叉。根据github的API文档,我有这个端点:https://api.github.com/search/repositories?q={query}{&page,per_page,sort,order}

但这似乎并不奏效。我忘了什么吗?github API在这里:https://help.github.com/articles/searching-repositories.这里还有我的请求:

getRepos = (repoinfo) => {
return fetch(`https://api.github.com/search/repositories?q={query} {&page,per_page,sort,order}`)
.then(respone => Response.json())
.then(response => {
return response
})
}

对我有用。在这里,我在自述文件中搜索包含迷宫的repos:

https://api.github.com/search/repositories?q=labyrinth+在:自述&type=存储库

或者,如果您想要特定的回购,请使用https://api.github.com/repos/:owner/:repo像这样:

https://api.github.com/repos/draluy/labyrinth

最新更新