How to stop API throttling (Error 429) when getting session viewers through API?
in API
This is from the sample. py file provided in the repository that I modified.
While this is from the panopto_sessions.py file.
So I used the panopto-api-python-examples repository in github and it allowed me to view the session details as successfully. However, when I try to make it display the session viewers through the GET /api/v1/sessions/{id}/viewers API as shown in the images above. Error 429 is encountered as there is supposedly too many requests. Is there a work around for this?
Tagged:
0


Answers
Following...
Hi,
The Public REST API has a limit on how many calls can be made per second/minute/hour so I would suggest limiting your polling to 1 api request per second and see if your error goes away.
Thanks,
Joe Malmsten
I'm sorry I'm completely new to this so I searched for a way to limit the api requests and I used this method and changed the calls and rate_limit to 1 but it does not return any values. Are there other ways to limit the polling/api requests?
Hi,
You could probably do something like add 'import time' at the top of your file and then time.sleep(1) inside of your while loop.
Thanks,
Joe Malmsten