Sean Danzeiser
Sean Danzeiser

Reputation: 9243

Why is the twitter list API not returning the correct number of results?

I'm using the twitter List API to get tweets from a set of accounts that I've added to a list. However, I'm noticing that for some reason I'm not receiving the correct number of tweets in the response from twitter. Here is my URL

https://api.twitter.com/1/lists/statuses.xml?list_id=68707107&per_page=30

I'm clearly asking for 30 results there, however if you just type that into a web browser you'll see it does not return 30 results. Does anyone know why this is?

Thanks!!

Upvotes: 0

Views: 167

Answers (1)

Miguel Lomelí
Miguel Lomelí

Reputation: 1324

The per_page attribute it's an "up to" value. If you use the since_id you may get better results. And the pages in the api are being deprecated as you can read in the doc. Work your solution using the since_id and max_id arguments in the api.

Check https://dev.twitter.com/docs/working-with-timelines

Check this answer: GET lists/statuses per_page returning unexpected results

Twitter may be limiting the number of tweets in requests to 20 so you could try downloading 20 and then load the next 10 after that.

Upvotes: 1

Related Questions