I have access to Twitter’s premium API. But I don’t know how to use it to access Twitter user data. I use the following piece of code:
tweets = api.request('friends/list', {'user_id':theUserID})
However, I immediately get the “rate limit” error after a few tries, just as I would get with the standard account.
I understand that I must mention my endpoint somewhere (maybe with a colon after the URL), but I don’t know how to do it. If I use “friends/list:[MY_DEV_LABEL]” I’ll get an error message telling me that the endpoint is unsupported.
It occurs to me that the “friends/list” is not part of what the premium account supports. If that is the case, what should I do to access list of friends and followers for users without having to deal with rate limits?
2
Answers
Your code snippet looks correct.
This Standard endpoint, which has no Premium version, has a rate limit of 15 requests every 15 minutes. See this doc https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friends-list.html
Twitter does not offer a way to access this endpoint at higher request rates.
Make sure you are using the user’s auth token as they count per user per endpoint. If you use the App auth token then all access count towards the app auth count per endpoint.