Skip to content

Too Many Requests, but I thought I only made 1 #69

Description

@nueverest

For fun I wanted to add up all of the reputation across all users.

Here is the code sample.

stack_auth = StackAuth()
so = Site(StackOverflow, impose_throttling=True)

# Get all users
users = so.users()             # Thought this is a single request.
total_reputation = 0

for user in users:
    total_reputation += user.reputation

print('Total Reputation:', total_reputation)

But after running the code and waiting a minute or two I get this Throttling Error:

raise StackExchangeError(error_ob.get('error_id', StackExchangeError.UNKNOWN), error_ob.get('error_name'), error_ob.get('error_message'))
stackexchange.core.StackExchangeError: 502 [throttle_violation]: too many requests from this IP, more requests available in 45500 seconds

Does user.reputation cause a request, and if so why?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions