mrKC.988
mrKC.988

Reputation: 35

Retrieve tweets by username - twitter api

Can you display tweets of somebody else or is it just the account that you got the key and secret... etc details from?

I'm checking the params in GET statuses/user_timeline docs and I don't think I can!

I'm trying to build an app that allows you to display tweets by inputting a username of any account. Thanks you.

Upvotes: 3

Views: 4676

Answers (3)

Prashant Pokhriyal
Prashant Pokhriyal

Reputation: 3837

You can get tweets of public users but if user is protected one then his timelines may only be requested when the you either “own” the timeline or are an approved follower of the protected user.

To get tweets from a specific user you will want to use the GET statuses/user_timeline API method.

Just add ?screen_name=USERNAME at the end of the endpoint. For example

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=username

This method can only return up to 3,200 of a user’s most recent Tweets.

Upvotes: 2

Jonas
Jonas

Reputation: 4058

You can display another user's tweets even if you are not using their credentials. Basically, you can display anyone's public tweets if you know their screen name. This is the Twitter api request: https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline

Upvotes: 4

Kleo G
Kleo G

Reputation: 247

This will only work for the user who has authenticated and is now using your app, as well as the users that they follow.

Returns a collection of the most recent Tweets and Retweets posted by the authenticating user and the users they follow.

This is directly from the link you posted.

Upvotes: 1

Related Questions