【问题标题】:How to get only 15 repositories from GitHub API?如何从 GitHub API 只获取 15 个存储库?
【发布时间】:2019-09-30 05:30:09
【问题描述】:

由于我的标题不变,如何从公共 API 中仅获取有限数量的存储库?我正在使用以下链接:

https://api.github.com/repositories //Gets 100

首先获得 100 个存储库,但我只需要获得 15 个。这是我尝试过的:

https://api.github.com/repositories?per_page=15 //Gets 100

似乎添加per_page=10 根本不起作用。我也试过:

https://api.github.com/repositories?since=369&per_page=15

没有任何运气。谁能帮我解决这个问题?

【问题讨论】:

    标签: git github github-api


    【解决方案1】:

    GitHub Api 文档说: 注意:分页仅由 since 参数提供支持。 见https://developer.github.com/v3/repos/#list-all-public-repositories

    不支持per_page 参数。

    【讨论】:

    • 好的,感谢您的回答,但它没有回答我的问题。如何从 GitHub API 中仅获取 15 个元素?我不想要全部 100 个。这可能吗?
    • 好像不行。
    猜你喜欢
    • 2011-11-19
    • 2021-02-26
    • 1970-01-01
    • 2017-09-01
    • 2014-09-29
    • 2022-11-03
    • 2018-09-24
    • 2014-09-21
    相关资源
    最近更新 更多