GitHub API:随时间推移存储库的星数

Tom*_*mmy 4 github-api

有没有办法随时间检索有关 GitHub 存储库星数的信息?我知道我可以获取使用stargazersAPI 端点为存储库加星标的所有用户的列表。但是,这不包括有关每个用户何时为 repo 加注星标的信息。关于如何检索这些数据的任何提示?

Cla*_*fou 6

您可以starred_at使用此自定义媒体获取属性:

Accept: application/vnd.github.v3.star+json
Run Code Online (Sandbox Code Playgroud)

您的标题可能看起来像这样(我在这里使用 Javascript):

Accept: application/vnd.github.v3.star+json
Run Code Online (Sandbox Code Playgroud)

请参阅此处的文档:https : //developer.github.com/v3/activity/starring/#alternative-response-with-star-creation-timestamps

此存储库:https : //github.com/timqian/star-history使用此技术随时间检索星星以创建图表。