Twitter – Do Twitter accounts have a never-changing identifier

twittertwitter-integration

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?

Best Answer

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.