Use of Github API
Github APIs( or Github ReST APIs) are the APIs that you can use to interact with GitHub. They allow you to create and manage repositories, branches, issues, pull requests, and many more. For fetching publicly available information (like public repositories, user profiles, etc.), you can call the API.
Important URLs -
https://docs.github.com/en/rest/search#search-users
https://docs.github.com/en/search-github/searching-on-github/searching-users
https://api.github.com/search/users?q=Subhradip%20in:name
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/search/users
Search only users or organizations
By default, searching users will return both personal and organizations. However, you can use the type
qualifier to restrict search results to personal accounts or organizations only.
Qualifier | Example |
---|---|
type:user | mike in:name created:<2011-01-01 type:user matches personal accounts named "mike" that were created before 2011. |
type:org | data in:email type:org matches organizations with the word "data" in their email. |
Search by account name, full name, or public email
You can filter your search to the personal user or organization account name with user
or org
qualifiers.
With the in
qualifier you can restrict your search to the username (login
), full name, public email, or any combination of these. When you omit this qualifier, only the username and email address are searched. For privacy reasons, you cannot search by email domain name.
Qualifier | Example |
---|---|
user:name | user:octocat matches the user with the username "octocat". |
org:name | org:electron type:users matches the Electron organization's account name. |
in:login | kenya in:login matches users with the word "kenya" in their username. |
in:name | bolton in:name matches users whose real name contains the word "bolton." |
fullname:firstname lastname | fullname:nat friedman matches a user with the full name "Nat Friedman." Note: This search qualifier is sensitive to spacing. |
in:email | data in:email matches users with the word "data" in their email. |
No comments