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

Getting limited by the API #159

Open
JasonKramer525 opened this issue Aug 16, 2020 · 1 comment
Open

Getting limited by the API #159

JasonKramer525 opened this issue Aug 16, 2020 · 1 comment
Labels
documentation Documentation is needed or requires an update

Comments

@JasonKramer525
Copy link

Are the limits per minute, hour, day posted anywhere? I have been working on a script that runs through a loop to get stats for several players, but I am getting limited even with a small wait time between calls. Is there any way around this or something I can do so that I can runt he full loop? Thanks!

@cryobry
Copy link

cryobry commented Aug 17, 2020

You can add a brief time.sleep() following every API call.

This seems to work well for me without slowing things down too much (it's what is used to test this module's endpoints):

nba_cooldown = random.gammavariate(alpha=9, beta=0.4)
time.sleep(nba_cooldown)

...or you can just use a flat number of seconds.

@swar swar added the question Inquiry from community label Aug 19, 2020
@rsforbes rsforbes added documentation Documentation is needed or requires an update and removed question Inquiry from community labels Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation is needed or requires an update
4 participants