gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 00:33:42 27 4
gpt4 key购买 nike

我正在向 github 的 API 发出请求以获取以下项目:存储库名称、存储库所有者名称、存储库 URL、存储库描述、星星数量、许可证类型以及存储库是否 fork 或不。根据 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
})
}

最佳答案

对我有用。这里我在自述文件中搜索包含 Labyrinth 的存储库:

https://api.github.com/search/repositories?q=labyrinth+in:readme&type=repository

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

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

关于javascript - 在 github API 上访问 github 存储库的正确端点是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53747159/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com