Welcome to the Panopto Community

Please note: All new registrants to the Panopto Community Forum must be approved by a forum moderator or admin. As such, if you navigate to a feature that is members-only, you may receive an error page if your registration has not yet been approved. We apologize for any inconvenience and are approving new members as quickly as possible.

How to stop API throttling (Error 429) when getting session viewers through 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:

Answers

  • Following...

  • Joe MalmstenJoe Malmsten Panopto Employee

    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?


  • Joe MalmstenJoe Malmsten Panopto Employee
    edited December 2022

    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

Sign In or Register to comment.