Reputation: 1123
What is the difference between GitHub username and GitHub ID? I was asked for my Github ID for a certain project and I happened to give my username. But the person is unable to find me on GitHub with my username. So I got a GitHub ID from the below URL:
http://caius.github.io/github_id/
But I'm unable to find this ID from my account directly. Where can I find this in my GitHub account? It would be great to elaborate on this.
Upvotes: 111
Views: 322679
Reputation: 41
Only this method is working,
Go to your GitHub account and click on the Settings option.
Go to the emails section.Your id is listed there.
The format is:
{id}+{user_name}@users.noreply.github.com
Upvotes: 3
Reputation: 11
You can find your GitHub ID on https://github.com/settings/emails.
Upvotes: 0
Reputation: 425258
From the command line:
curl -s https://api.github.com/users/<your-user-name> | jq '.id'
Upvotes: 10
Reputation: 70176
If you do have the GitHub Id but need to find the username / login you can do it like this with the List users endpoint:
Subtract the id by 1 and run the following query. My GitHub Id is 4015237
and therefore the query parameter since receives the value 4015236
.
https://api.github.com/users?since=4015236&per_page=1
https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#list-users
Description for since:
Query parameters - since - A user ID. Only return users with an ID greater than this ID.
Upvotes: 3
Reputation: 2894
From this answer
If you cannot use the API answer or from http://caius.github.io/github_id/ you can go to
github --> settings --> emails
, under thePrimary email address
you will find{id}+{user_name}@users.noreply.github.com
.
This is at least true if you have Keep my email address private
checked.
I have this text in the Keep my email address private
explanation, and I'm guessing this will be there even if it is turned off.
Look for 'noreply' in the emails section.
Upvotes: 5
Reputation: 71
Step-1: Go to this link: https://caius.github.io/github_id/
Step-2 Enter your Github username
You got it!
The second method is:
Upvotes: 3
Reputation: 88
Don't use the ID stated in other answers I tried this and it didn't work and said it was invalid on AWS.
It's located on the main GIT repository. Those random letters and numbers are below the add file button with no description, obviously. Not only that but it's clickable if you click into it you'll find a much longer commit ID. You want the longer one.
Everyone loves completely unnecessary complexity in a platform!!
Upvotes: -2
Reputation: 2720
It can be easily retrieved using Github API
. If you cannot use the API answer or from http://caius.github.io/github_id/ you can go to github --> settings --> emails
, under the Primary email address you will find {id}+{user_name}@users.noreply.github.com
. The format is simillar to this: [email protected]
, that 50826640
is the id
.
Upvotes: 6
Reputation:
It can be easily retrieved using GitHub API:
https://api.github.com/users/your_github_user_name
where instead of your_github_user_name you must use the desired GitHub username.
Example:
https://api.github.com/users/github
Upvotes: 192
Reputation: 1129
It can be easily retrieved using Github API.
Example: https://api.github.com/users/username
Upvotes: 44