Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if twitter username exists

Is there a way to check if a twitter username exists? Without being authenticated with OAuth or the twitter basic authentication?

like image 920
tarnfeld Avatar asked May 16 '10 19:05

tarnfeld


People also ask

How do you check if a Twitter name is available?

Namechk (@namechk) / Twitter. Check the availability of your username & domain name across 100+ of the most popular social networks & registrars.

How do I trace a Twitter username?

How to find people by name. Type the person's name or username into the search box at the top of your twitter.com Home timeline, or tap the Explore tab through your Twitter for iOS or Android app to access the search box.

Can I get a suspended Twitter username?

The username may be claimed by a suspended or deactivated account. Suspended and deactivated usernames are not immediately available for use, so you'll need to select a different username.

How do you find old usernames on Twitter?

Try to single out a user who was replying regularly to your target account just after a username change, then select a date range for the period just before the username change, and search for tweets FROM the replying account. I've unearthed loads of old usernames with this trick.


2 Answers

UPDATE 2021: This API is not available.

As of right now, you're better off using the API the signup form uses to check username availability in realtime. Requests are of the format:

https://twitter.com/users/username_available?username=whatever

And give you a JSON response with a valid key giving you a true if the username can be registered:

{"valid":false,"reason":"taken","msg":"Username has already been taken","desc":"That username has been taken. Please choose another."}
{"valid":true,"reason":"available","msg":"Available!","desc":"Available!"}
{"valid":false,"reason":"is_banned_word","msg":"Username is unavailable","desc":"The username \"root\" is unavailable. Sorry!"}

The reason this is better than checking for 404 responses is that sometimes words are reserved (like 'root' above), or a username is actually taken but for some reason the account is gone from the Twitter front end.

like image 67
Thom Avatar answered Sep 21 '22 13:09

Thom


UPDATE

The Twitter REST API v1 is no longer active.

So use https://api.twitter.com/1.1/users/show.json?screen_name=username


You can also use the API with username :

http://api.twitter.com/1/users/show.xml?screen_name=tarnfeld

Will give you :

<?xml version="1.0" encoding="UTF-8"?>
<user>
  ...................
  <screen_name>tarnfeld</screen_name>
  <location>Portsmouth, UK</location>
  .................
  </status>
</user>

Or if not exist :

<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <request>/1/users/show.xml?screen_name=tarnfeldezf</request>
  <error>Not found</error>
</hash>
like image 37
chipeau Avatar answered Sep 18 '22 13:09

chipeau