elephant-bird icon indicating copy to clipboard operation
elephant-bird copied to clipboard

Why using /2/users/by/username/:username for getting user tweets

Open bastienuh opened this issue 2 years ago • 0 comments

I created a question in the Twitter forum for a discordance between rate limit in the documentation and rate limit in the API. See here.

But here, my question is for you.

My code for getting tweets same as documentation :

$twitter_name = "elonmusk";
$twitter_user = $twitter->user($twitter_name)->tweets($params);

And the called API URL is : GET https://api.twitter.com/2/users/by/username/elonmusk So why are you using GET /2/users/by/username/:username for getting a user tweet instead of GET /2/users/:id/tweets ? I'm asking because maybe the discordance seen above is only for GET /2/users/by/username/:username and not for GET /2/users/:id/tweets.

Thanks for your feedback.

bastienuh avatar May 04 '22 12:05 bastienuh