user3792699
user3792699

Reputation: 379

Get latest tweets for multiple screen_names through Twitter Rest API in CURL

I'm completely new to the Twitter Rest API. I have generated a curl command using OAuth tool in twitter to get the tweets posted by a single user.

curl --get 'https://api.twitter.com/1.1/statuses/user_timeline.json' --data 'count=2&screen_name=twitterapi' --header 'Authorization: OAuth oauth_consumer_key="AAAAAAAAAAAAAAAAAAAA", oauth_nonce="BBBBBBBBBBBBBBBBBBBBBBB", oauth_signature="CCCCCCCCCCCCCCCCCCCCCCCCCCC", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1471672391", oauth_token="DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", oauth_version="1.0"'

Reference: https://dev.twitter.com/rest/reference/get/statuses/user_timeline

I got the data for a single screen_name and now I would like to pull the tweets for multiple screen_names at once through Curl. I have tried this using POST but it didn't work. I have been trying since 7 days.

Can anyone help me to resolve this ?

Thanks in Advance. Aswin

Upvotes: 0

Views: 541

Answers (1)

ophychius
ophychius

Reputation: 2653

As far as I know this is not possible with one API call. The operation you are referencing only allows for the retrieval of statuses by a specific user, not multiple users. Also, it requires a GET request so a POST won't get you very much.

You can look at other operations to see if they fit your requirements. For example GET statuses/home_timeline gets the statuses of all users that are followed by the account with which you request this.

However if the users whose statuses you are looking to retrieve have nothing like this in common than the best way to go is to use separate requests for each user and use the API as intended.

Upvotes: 0

Related Questions