How to convert list of user IDs to usernames?

api

#1

Hey!

I have a huge list of user IDs and I want to convert them to usernames. How can I do that? I have been searching online but all I can find is how to do it one-by-one on some websites.

I have never used Twitter API before. Does anybody have a script like that to share or to give me some key points I should take a look at to create this kind of script?

Thank You!


#2

You need to use users/lookup and pass up to 100 ids a time to get the user objects back.

From there you can get their usernames from the user object of each returned record.