3

On Facebook, you are identified by a number like 7435423976 that will never change, even after changing your name or your URL shortcut.

Does Twitter have the same never-changing identifier?

Twitter users have a name (for instance "JohnDoe4ever"), but they can change it, so it is not a good identifier. Is there a hidden, better one?

8

Yes, each Twitter Account is assigned a user_id.

Taken from the Twitter API Documentation

user_id

The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name.

http://api.twitter.com/1/users/show.json?user_id=12345

It's also useful to know that you can get the user_id by displaying a users tweet via the /statuses/show/{tweetId} API Call

This will display results similar to this:

Sample Twitter API Results

As you can see the user_id is provided along with the individual tweet information.

The {tweetId} can be found by clicking on the time stamp of any tweet. The {tweetId} will be long number at the end of the URL.

1
  • Thanks a lot! I guess that's exactly what I need, I will look into this user_id now. – nic Apr 6 '11 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.