Question: How to get the user id from username?
Closed this issue · 3 comments
Hi, thanks for all your hard work on this project folks.
I'm trying to block a list of users, but I need the userid (https://github.com/trevorhobenshield/twitter-api-client/blob/main/twitter/account.py#L367), but I only have Twitter usernames.
The official docs, can take screen_name as a param (https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-blocks-create).
So question is, how to get the user id from username please?
did u find any way to do it?
did u find any way to do it?
Try here for an example:
incandenza-11/blockout2024@8db592c#diff-38b1a045d7d575204f06272c38ba3a2d00ad906b102c245897b76135b355e70cR44
Thanks for the question.
The user ID will need to be parsed from the JSON response returned by scraper.users(["user1", "user2", ...])