Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get list of organizations on GitHub

Is there a workaround to get the list of organizations on GitHub?

For example: https://github.com/showcases/open-source-organizations

How can we do that via the GitHub API or GitHub search?

like image 426
Nam Vu Avatar asked Jul 21 '14 14:07

Nam Vu


2 Answers

You can get a list of all accounts:

https://developer.github.com/v3/users/#get-all-users

The type parameter will tell you if it's a user or organization.

An alternative is to use the search API:

https://developer.github.com/v3/search/#search-users

You can specify type:org to get organizations only:

https://api.github.com/search/users?q=type:org

like image 96
Ivan Zuzak Avatar answered Oct 19 '22 23:10

Ivan Zuzak


On June 17, 2015 GitHub added a new API to get organizations:

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."
  },
  ...
]

Additional information can be found on the following link:

List all organizations

Lists all organizations, in the order that they were created on GitHub.

Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of organizations.

Parameters

  • Name: since
  • Type: string
  • Description: The integer ID of the last Organization that you've seen.

Response

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"
  }
]
like image 29
Gabor Meszaros Avatar answered Oct 19 '22 23:10

Gabor Meszaros