Github API 用户不显示加星标的回购
Github API for users does not show starred repos
我一直在努力寻找一种方法来获取在用户 github 个人资料中加星标的存储库列表。大多数建议的解决方案包括使用 github 的 API,如下所示:
https://api.github.com/users/$GITHUB_USER$/repos
大多数解决方案都以各种形式使用上述 API,例如 post. However, what it gives is the repos that a user owns, which is different than the repos starred by the user. For instance, Kenneth Reitz 拥有 94 个回购协议,而他为 1906 个回购协议加注星标。因此,如果您 运行 下面在 python 中给出的代码,names_repos
将向您显示他拥有的存储库(总共 94 个),而不是他加星标的存储库(总共 1906 个):
import requests
import json
GITHUB_USER = "kennethreitz"
r = requests.get("https://api.github.com/users/" + GITHUB_USER + "/repos?per_page=100" )
names_repos = json.loads(r.text)
我想要的是带星标的回购列表(在文本或其他文件中),可以在这里看到:https://github.com/stars/kennethreitz。但是,github API 似乎无法提供这一点。我不介意是否有任何其他人看不到的私人仓库,但我想获得一份我可以在加星标的仓库下看到的任何仓库的列表。
您需要使用加星标的端点。用于获取有关用户已加星标的信息。
https://api.github.com/users/xxxxxx/starred?per_page=100
Example
https://api.github.com/users/kennethreitz/starred?per_page=100
您可以使用端点
查看api可用的列表
https://api.github.com/users/xxxxx
example
https://api.github.com/users/kennethreitz/
我一直在努力寻找一种方法来获取在用户 github 个人资料中加星标的存储库列表。大多数建议的解决方案包括使用 github 的 API,如下所示:
https://api.github.com/users/$GITHUB_USER$/repos
大多数解决方案都以各种形式使用上述 API,例如 post. However, what it gives is the repos that a user owns, which is different than the repos starred by the user. For instance, Kenneth Reitz 拥有 94 个回购协议,而他为 1906 个回购协议加注星标。因此,如果您 运行 下面在 python 中给出的代码,names_repos
将向您显示他拥有的存储库(总共 94 个),而不是他加星标的存储库(总共 1906 个):
import requests
import json
GITHUB_USER = "kennethreitz"
r = requests.get("https://api.github.com/users/" + GITHUB_USER + "/repos?per_page=100" )
names_repos = json.loads(r.text)
我想要的是带星标的回购列表(在文本或其他文件中),可以在这里看到:https://github.com/stars/kennethreitz。但是,github API 似乎无法提供这一点。我不介意是否有任何其他人看不到的私人仓库,但我想获得一份我可以在加星标的仓库下看到的任何仓库的列表。
您需要使用加星标的端点。用于获取有关用户已加星标的信息。
https://api.github.com/users/xxxxxx/starred?per_page=100
Example
https://api.github.com/users/kennethreitz/starred?per_page=100
您可以使用端点
查看api可用的列表https://api.github.com/users/xxxxx
example
https://api.github.com/users/kennethreitz/