Github v3 API 获取所有超过 100 的组织
Github v3 API get all organizations more than 100
我正在尝试通过 http://host/api/v3/organizations?page=2&per_page=100
获取所有组织项目
默认大小似乎是 30,而 100 似乎是每个请求的最大限制。
但是在 link 以上仍然只有 returns 的前 100 项,即不是第 101-200
我也试过了http:host//api/v3/organizations?page=2
无论我设置哪个页面,它都只returns前30项。
请问如何获得组织项目的完整列表?请帮忙。欣赏。
来自 Github API reference for listing organizations:
Note: Pagination is powered exclusively by the since parameter. Use
the Link header to get the URL for the next page of organizations.
例如使用 curl 检查第二页:
curl -I "https://api.github.com/organizations"
给出以下 link header :
Link: <https://api.github.com/organizations?since=3043>; rel="next", <https://api.github.com/organizations{?since}>; rel="first"
因此下一页将是 https://api.github.com/organizations?since=3043
对于每个请求,您将检查此 header 以获得下一个 url 命中
我正在尝试通过 http://host/api/v3/organizations?page=2&per_page=100
获取所有组织项目默认大小似乎是 30,而 100 似乎是每个请求的最大限制。 但是在 link 以上仍然只有 returns 的前 100 项,即不是第 101-200
我也试过了http:host//api/v3/organizations?page=2 无论我设置哪个页面,它都只returns前30项。
请问如何获得组织项目的完整列表?请帮忙。欣赏。
来自 Github API reference for listing organizations:
Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of organizations.
例如使用 curl 检查第二页:
curl -I "https://api.github.com/organizations"
给出以下 link header :
Link: <https://api.github.com/organizations?since=3043>; rel="next", <https://api.github.com/organizations{?since}>; rel="first"
因此下一页将是 https://api.github.com/organizations?since=3043
对于每个请求,您将检查此 header 以获得下一个 url 命中