Step 1: Authenticate Your API Requests
First, you need to authenticate your API requests using an API key. You can generate your API key from the pyannoteAI dashboard. Here’s an example of how to authenticate using your API key:Step 2: Create Diarization Job
To create a diarization job, you’ll send a POST request to the diarize endpoint with the URL of the audio file and a webhook URL where the results will be sent. Here’s an example:jobId
. More details can be found here.
Getting an url from a file
Typically files are stored in a cloud storage service such as Amazon S3. If you have a file stored in a cloud storage service, you can generate a public (signed) URL to the file and use that URL in the API request. Make sure the URL is publicly accessible so our servers can access the file. If you want to manually expose a public file url, you can use the following code, which exposes a file namedsample.mp3
with a python Flask server:
Step 3: Webhook and Receiving the Results
The results of the diarization will be sent to the webhook URL you provided. The webhook payload will look like this:You can also use a tool like ngrok to expose your local server to the internet and receive webhooks. Or use a site like webhook.site to test webhooks.