Twitter API - check if username exists

I just want to check if username exists on Twitter. I thought this would be part of the API, but could not find it in the api wiki http://apiwiki.twitter.com/w/page/22554679/Twitter-API-Documentation .

Any ideas?

thanks

In JP

+6
twitter
source share
2 answers

It seems that I can pass the screen name to the search API. And I have to check the status 404 not found (if the username does not exist). Seems a little ugly, but might just work. Welcome the best deals!

this gives 404: http://api.twitter.com/1/users/show.xml?screen_name=thisdoesnotexist1234abxfd

this returns valid information: http://api.twitter.com/1/users/show.xml?screen_name=billgates

thanks

In JP

+6
source share

@JP Even if the twitter api speed limit is reached, 404 is returned. So, as you said, the dirty method. consider the speed limit and add enough checks to your code so as not to reach them. the above method should work fine. Yours faithfully,

0
source share

All Articles