Audio Download
Download audio from a URL via HuntAPI and receive a job id.
Credit cost: 1 credit per request
Async: This endpoint runs asynchronously. Use the jobs endpoint to poll for results.
Authorization
ApiKeyAuth Your API key. Include it in the x-api-key header for every request.
In: header
Query Parameters
URL to download audio from.
Notes: Some audios cannot be downloaded for the following reasons:
-
Private content: If the content is set as private by its owner
-
Unavailable content: If the content has been deleted or is no longer accessible
-
Age restricted content: If the content is age restricted In these cases, the API will return an explanatory error message.
Desired download type. Supported values: audio (default).
"audio"Maximum duration of the downloaded content in seconds. If the audio is longer than this value, only the content up to this duration will be downloaded.
Desired audio quality.
Available options:
-
best: Best available quality (default) -
320kbps: High quality -
256kbps: Standard quality -
128kbps: Low quality
"best"Desired output format for the audio.
Available options:
-
mp3: MP3 format (default option) -
m4a: MPEG-4 Audio format -
wav: Waveform Audio File Format
Note: This is a format preference. While we will do our best to provide the requested format, due to technical limitations or conversion issues, the final output format may differ from the requested one.
"mp3"URL of the webhook where results will be sent. When specified, the system will attempt to send the response to this URL up to 3 times with a 5-second delay between each attempt. The results will be sent as a POST request.
The payload will be sent in JSON format with one of the following structures:
On success:
{
"id": "string", // the job id,
"status": "CompletedJob", // the job status,
"result": {
"metadata": {
// filtered metadata object
},
"response": "https://s3.huntapi.com/audios/audio_id.mp3"
}
}On error:
{
"id": "string", // the job id,
"status": "Error", // the job status,
"error": "string" // the error message (private, unavailable, age restricted, etc.)
}Authorization header for the webhook. This parameter allows you to add authentication to your webhook endpoint.
This value will be included in the Authorization header when making the webhook request to your server.
Example:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.huntapi.com/v1/audio/download?query=string"{
"job_id": "0193443f-fb80-9d19-29ba-82bc77c7cd85"
}{
"error": "Bad Request"
}{
"error": "Invalid API Key"
}{
"error": "Payment required"
}{
"error": "Rate limit exceeded for the API key: quota monthly"
}{
"error": "Internal Error"
}