GitHub API: How to check user or organization name availability?

There is no way to create new users using the API. If you wanted to do this automatically, you would have to jump through a lot of hoops, including automatically confirming email addresses and you would probably be violating the TOS. Why would you want to do that?

Checking for usernames is much easier. To do this with the regular GitHub API, use:

curl -w '%{response_code}' 'https://api.github.com/users/<username>'

If it's a 404, the username should be available, assuming it meets all the username requirements (length, characters, etc).

An even easier way is to use what GitHub uses on its registration form:

curl --write-out ' %{http_code}\n' --data "value=$USERNAME" https://github.com/signup_check/username

This prints a little message if the username is unavailable and returns a 403. It returns 200 if it's available.


If the other solution does not work, just visit http://checkusernames.com/