0
votes

In my iOS app, I am trying to get list of Twitter friends of my account. I have over 500 friends. I am using https://api.twitter.com/1.1/friends/list.json twitter resource to get list of friends.

The problem is that after getting 300 friends the API returns error 429 "Twitter response, HTTP response: 429". This error shows that some limit have been exceed and no more request can be made now.

According to Twitter API Limits we can do 15 firends/list.json GET requests per 15 minutes. Since each request only returns maximum of 20 friends at a time the 15 requests returns only 300 friends and then error 429.

I would like to know the best way to show more than 500 twitter friends in a table view in iOS app. For each friends, I need its name, photo and Id.

1

1 Answers

0
votes

Well, you just saw the official Twitter documentation that limits you to 15*20 = 300 friends per 15 minutes. I believe what Twitter recommends is for you to store data within your application so that you don't have to reload the entire friends list from their server every time. Ie, store the first 300, and when it allows you store the next 200 in your app permanently. Then you have all 500 followers in a list within your application, and you should in theory never have to update again (or maybe you could have an option for the user to refresh, should his follower list change significantly).