Search code examples
phptwittertwitter-oauthtweets

get recent tweets from twitter using API 1.1


I want to get recent tweets from twitter using API 1.1 .

I just don't want to get it only for current user or user's followers. I want to get all the tweets from all the users.

Is there a way by which I can get all user's tweets. Is there any limit for this type of API call?

I want to fetch all the tweets at the application level, that means I won't be having any user token. How I can do this?

EDIT:

I found that we can use SEARCH API to search recent tweets using this

https://dev.twitter.com/docs/api/1.1/get/search/tweets

But In this API we have to pass the q parameter to search. But what if I don't want search based on specific parameter. I just want all the tweets from last 24 hours.

Is there way where I don't have to pass q in search API?


Solution

  • You want to call

    https://stream.twitter.com/1.1/statuses/sample.json 
    

    This will allow you to get a random sample of the most recent tweets made by all users.