Nam*_* Vu 6 github github-api github-organizations
是否有解决方法来获取GitHub上的组织列表?
例如:https://github.com/showcases/open-source-organizations
我们怎么能通过GitHub API或GitHub搜索来做到这一点?
您可以获得所有帐户的列表:
https://developer.github.com/v3/users/#get-all-users
该type参数将告诉您它是用户还是组织.
另一种方法是使用搜索API:
https://developer.github.com/v3/search/#search-users
您可以指定type:org仅限组织:
https://api.github.com/search/users?q=type:org
2015年6月17日, GitHub为组织添加了一个新的API:
curl https://api.github.com/organizations
[
  {
    "login": "github",
    "id": 9919,
    "url": "https://api.github.com/orgs/github",
   "repos_url": "https://api.github.com/orgs/github/repos",
   "events_url": "https://api.github.com/orgs/github/events",
   "members_url": "https://api.github.com/orgs/github/members{/member}",
   "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
   "avatar_url": "https://avatars.githubusercontent.com/u/9919?v=3",
    "description": "GitHub, the company."
  },
  ...
]
其他信息可在以下链接中找到:
按照在GitHub上创建的顺序列出所有组织.
注意:分页仅由since参数提供.使用" 链接"标题获取下一页组织的URL.
参数
响应
Status: 200 OK
Link: <https://api.github.com/organizations?since=135>; rel="next"
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
----------------------------------------------------------------------
[
  {
    "login": "github",
    "id": 1,
    "url": "https://api.github.com/orgs/github",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "description": "A great organization"
  }
]
| 归档时间: | 
 | 
| 查看次数: | 9341 次 | 
| 最近记录: |