Is there a way to identify a user’s past usernames using the Twitter API?(I don’t have to use the twitter api.)
For example, maybe the metadata of the tweet contains the username at that point in time.
Question posted in Twitter API
The official Twitter API documentation can be found here.
The official Twitter API documentation can be found here.
2
Answers
No, this is not available in the Twitter API.
It is not directly possible to ask the Twitter API for a user’s old usernames, but it might be possible in some cases. This will only work if other people replied to or mentioned this user while they still had their old username. Here is how you can do it:
Request
GET /2/users/by/username/:username
with the user’s current username. This returns the user’s data, including auser.id
field.Request
GET /2/users/:id/mentions
with the user ID from the last response.Navigate through all the mentions to see if the @username at the beginning of each tweet’s text changed to another handle in older tweets.