views:

240

answers:

3

I am trying to do something that appears to be simple, but I can't figure out a way around it without breaking the rate limit.

The first API call I'm making is the get a user's friend's IDs.

$friends = $to->OAuthRequest('http://twitter.com/friends/ids.json', array(), 'GET');

That returns a huge string with IDs. In my case, I'm following 1035 people, so I get 1035 IDs.

$friends = explode(",",$friends)

This gives me an array with all of their IDs.

But how do I pull the user info from all 1035 of those people without breaking the 150 API-call limit?

+3  A: 

If you are trying to get more information than just the IDs, then consider statuses/friends, if the user you are looking up is protected, you will need to auth, which I believe you are doing anyhow.

jakeisonline
A: 

Why are you requesting only a list of IDs?

While you still may run into the rate limit, you'll get a lot further if you request all the user data for friends.

Maybe you could try the statuses/friends method?

timdev
A: 

Use the status/friends method and set the count=200 so you can get more than the default of 20. If you need more, use the page parameter to paginate through. The XML format provides a lot more data than RSS.

Look at the API docs (footer links).