How to make the Twitter API (home_timeline) returns me over 800 tweets? For example applications like tweetbot how do it to have more updates in the 3000 home timeline? I think that using a cache system but which one?
Asked
Active
Viewed 1,071 times
-1
-
RTFM. This is clearly explained in the [documentation](https://dev.twitter.com/rest/public/timelines) – Mehdi Jun 22 '15 at 11:34
1 Answers
3
You can not get more then 800 tweets in 1 go.
But you can pass parameters like since_id and max_id: https://dev.twitter.com/rest/reference/get/statuses/home_timeline
If you store the oldest tweet id => and in the next api call you pass in that id, then you will get the older ones. After that you just repeat the cycle.
For example: tweet id 500 of date 20/6/2015 is your oldest entry. => max_id: 500 Will return tweets 499, 498, ... which are all older then 20/6/2015

Tom
- 54
- 4
-
I do not exactly understand how it works even by reference to the documentation for Twitter – victor bill Jun 22 '15 at 11:44
-
This explains everything in detail: https://dev.twitter.com/rest/public/timelines and over here there is a an example to use max_id https://shkspr.mobi/blog/2010/06/twitter-api-pagination-and-ids/ – Tom Jun 22 '15 at 12:05
-
Okay I'm on iOS in Objective C and for now I can have 200 tweets but how to use the parameter max_id and since_id? – victor bill Jun 22 '15 at 13:55
-
My code : NSURL *timelineURL = [NSURL URLWithString:@"https://api.twitter.com/1.1/statuses/home_timeline.json"]; NSDictionary *params = @{@"count": @"200"}; // Create a request SLRequest *getUserTimeline = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodGET URL:timelineURL parameters:params]; – victor bill Jun 22 '15 at 13:55
-