How to poll for job results
This tutorial shows how to poll job results using the pyannoteAI API
As an alternative to webhooks, you can poll the get job endpoint to retrieve job results.
To poll for job results, use the status
field in the job response to check if the job is completed. Once the job is completed, you can retrieve the job results by accessing the output
field.
The output
field contains the job results and is only available when the job status is succeeded
. Job results are automatically deleted after 24 hours of job completion.
A job is completed when the status
field is either succeeded
, failed
, or canceled
.
Be cautious of rate limits when polling. Excessive requests to check job status can lead to rate limiting, potentially disrupting your workflow. Check the rate limits documentation for more information.
In production environments, we strongly recommend using webhooks instead of polling. This guarantees that you get job results as soon as they are available. Additionally, you won’t have to worry about rate limits.
Example
Here’s an example of how to poll for job results in Python: