Redirect GitHub ID to Username

Scratching my own itch here...

GitHub users have a username (mine is @edent) and have a user ID number (mine is #837136).

If you want to redirect a user ID to a username, you can use the little service I've cobbled together:

That will take your browser to my GitHub page, using nothing but my ID.


  • Some login services only give you the GitHub user's ID.
  • GitHub users can change their username - but their ID stays the same.


Inspired by Caius Durling's useful GitHub username to ID service.

Mine is a scrap of JavaScript which uses this undocumented endpoint to get user info.

A screen of JSON code showing my details.

<script type="text/javascript" charset="utf-8">
function get_github_name_for(id) {
    $.getJSON('' + id + "?callback=?",
        var github_user_url = json["data"]["html_url"]
        return false
$(document).ready(function() {
    if (document.location.hash) {
        var id = document.location.hash.match(/^#(.*?)$/)[1]

Feel free to copy it, or use as a handy little webservice.

Share this post on…

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">