Get all past tweets via Twitter Streaming API
How can i get all past tweets vi开发者_JAVA技巧a Twitter Streaming API? As you may know it sends real-time tweets, not past ones. Useful count parameter was disabled in 2010. REST API have so bad limitations that it would take a whole life to get all past tweets. Is there any solution?
Sorry, you can't get historical tweets from the streaming API unless you have elevated access (e.g., Firehose, Retweet, Link, Birddog or Shadow). You can request additional access by emailing api at twitter dot com. Note that you cannot use the track parameter with count.
Only the last 150,000 statuses sent through Twitter are available when using count. To quote the Twitter docs:
On unfiltered streams, all considered statuses are delivered, so the number requested is the number returned. On filtered streams, the number requested is the number of statuses that are applied to the filter predicate, and not the number of statuses returned.
Also, that circular buffer containing the last 150,000 tweets is subject to the rate in which they are flowing out of Twitter. So, if the current tweet rate is 600 tweets per second, the buffer only holds the last 250 seconds of data, and if you are interested in just a few users, there probably won't be more than just a couple tweets in the buffer, if any.
If you're authenticated, the REST API will allow you to pull 1,680,000 tweets per day, but the real limiting factor is that you can only get at 3,200 tweets per user. The search API is worse, since it currently seems to be returning only about four days worth of tweets from a specific target.
Note: Edited after abraham brought up count is still available with elevated access to the streaming API.
Found this question while looking for something related. The only way I know of to get all of your past tweets is to request them from Twitter citing the Data Protection Act. This (I think) only works is you live in Europe, and you can only get your own tweets, but the process for doing it can be found here. Hope this helps you... my girlfriend and I met on Twitter and have both successfully got our tweets using this process to see how our relationship unfolded.
First, I have to say that you cannot find historical tweets with Streaming API. Second, I far as I know, you could use Search API but there are some restrictions to find all historical tweets like only getting 200 max. and historically max. 2 weeks old tweets in these 200.
However, you can implement a system that uses both streaming and search API for both historical and prospective tweets. You could develop two applications that one of them can use only Streaming which requires only one twitter account for authentication, meanwhile the second app can use Search API with several unique twitter accounts to avoid rate limit issue.
With the help of this platform, you will be able to get almost 98% tweets which is an acceptable rate for this job. If you have further question, let me know.
All best
精彩评论