Skip to main content
POST
Python
Extract key and BPM (beats per minute) from an input audio file with optional webhook callback for asynchronous updates.

Endpoint

This endpoint analyzes an audio file to determine its musical key and BPM. You can upload the audio file or provide a URL. Optionally, supply a webhook_url to receive asynchronous results.

Request Parameters

💡 Note: Either audio_url or audio_file must be provided — one is required.
content-type: multipart/form-data

Sample Request

cURL

Python

🔐 Replace {path_to_your_audio_file}, api_key, and webhook_url before executing.

Sample Response

Success (200 OK)


Common Errors

  • 422 Unprocessable Entity: Both audio_url and audio_file cannot be None.
  • 500 Internal Server Error: A server error occurred during processing.

Webhook Response

Once key and BPM extraction is completed, the webhook receives:

Output Fields

  • key_changes: A mapping of time ranges to identified keys.
  • dominant_key: The most prominent key throughout the audio.
  • bpm: Estimated beats per minute.
  • conversion_path: Path to the original input audio file.
  • conversion_path_wav: Path to the .wav version of the input file.

Payload and Request Formation

Authorizations

Authorization
string
header
required

Body

multipart/form-data
audio_url
string
required

Input audio URL (supported format: YouTube URL).

Example:

"https://www.youtube.com/watch?v=example123"

audio_file
file

Audio file to upload and process directly.

webhook_url
string

Callback URL for async processing results.

Example:

"http://your-webhook-url.com/callback"

Response

Successfully initiated key/bpm extraction

success
boolean
task_id
string
conversion_id
string
eta
integer
credit_estimate
number<float>
message
string