Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnableThrottling for GetFollowersIdsAll #253

Open
xfreakart opened this issue Jul 5, 2018 · 1 comment
Open

EnableThrottling for GetFollowersIdsAll #253

xfreakart opened this issue Jul 5, 2018 · 1 comment

Comments

@xfreakart
Copy link

Hi,

I'm trying to get all Followers Id's of a "big" account. Twitter limits 5K results per page (pagination) every 15 min. So I tried to set EnableThrottling with:

	api := anaconda.NewTwitterApiWithCredentials(AT, ATS, CK, CS)
	api.EnableThrottling(duration, 1)

When I call GetFollowersIdsAll I though that internally even that is just one query that I'm making it would apply EnableThrottling.

result := api.GetFollowersIdsAll(v)
	for id := range result {
		fmt.Println(id)
	}

It does not. It follows the pagination so when It has to load the second part It gets the error "Rate limit exceded".

returned status 429, {"errors":[{"message":"Rate limit exceeded","code":88}]}}

Was this a misunderstanding of EnableThrottling usage or there is another aproach for this?

Thanks!

@rumd3x
Copy link

rumd3x commented Jun 5, 2020

As I understand, anaconda has built-in rate limit handling, when you call EnableThrottling you turn that off, as you choose to throttle the requests manually yourself.

From the README:

If you make queries too quickly, you may bump against Twitter's rate limits. If this happens, anaconda automatically retries the query when the rate limit resets, using the X-Rate-Limit-Reset header that Twitter provides to determine how long to wait.

In other words, users of the anaconda library should not need to handle rate limiting errors themselves; this is handled seamlessly behind-the-scenes. If an error is returned by a function, another form of error must have occurred (which can be checked by using the fields provided by the ApiError struct).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants