apyhub
Back
AUDIO PROCESSING · FILE CONVERSION

Audio Extractor from Video API

Hosted on ApyHub

What it does

The Extract Audio from Video API pulls the audio track out of a video. Upload a video (MP4, MKV, AVI, MOV, FLV, 3GP, or WebM, up to 100 MB) or send the URL of a video file, and get the audio back as a file or as a signed download link, in MP3, WAV, AAC, OGG, FLAC, WMA, or AC3.

Set full_audio to true to extract the whole soundtrack. Without it, the API returns a 2-second clip, which you can move and resize with start_time and duration.

Use it to prepare recordings for transcription with the Speech to Text API, turn video content into podcasts or audio clips, or process the audio from uploaded videos separately. The URL must point to a video file you have the right to use; links to pages on sites like YouTube aren't supported.

For long videos, use the Extract Audio from Video Job API, which processes them in the background.

You can start on ApyHub's free tier with no card required.

▣ ENDPOINT 01 / 04
POST
Extract audio from video (upload → download)
https://api.eu.apyhub.com/apyhub/extract-audio-from-video/multi-part/download

QUICKSTART

GUIDE

Quickstart

Upload a video file to extract audio from it.

curl -X POST "https://api.eu.apyhub.com/apyhub/extract-audio-from-video/multi-part/download" \
  -H "apy-token: $APY_TOKEN" \
  -F "video=@/path/to/video.mp4"

What you'll get back

Returns a binary file (string with format: binary) containing the extracted audio.

...audio bytes...
TRY ITLIVE · 550 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Video file (.mp4 .mkv .avi .mov .flv .3gp .webm)
Number of seconds to extract. Ignored when full_audio is true.
When true, extract the complete audio track.
Seek offset in seconds.

About this endpoint

What it does

Uploads a video file and returns the extracted audio as a binary file download. You can control the extraction length, start offset, whether to extract the full audio track, and the output audio format.

Request Body

ParameterTypeMandatoryDescription
videoStringYesVideo file to process. Supported formats: .mp4, .mkv, .avi, .mov, .flv, .3gp, .webm.
durationIntegerNoNumber of seconds to extract. Default: 2. Minimum: 0. Ignored when full_audio is true.
full_audioENUMNoWhether to extract the complete audio track. Allowed values: true, false, 1, 0. Default: false.
start_timeIntegerNoSeek offset in seconds. Default: 0. Minimum: 0.
output_formatENUMNoOutput audio format. Allowed values: mp3, wav, aac, ogg, flac, wma, ac3. Default: mp3.

Response

Returns a binary file download containing the extracted audio. The success response body is a single binary string, not a JSON object.

ParameterTypeMandatoryDescription
binaryStringYesThe extracted audio file content returned by the endpoint.

Notes

This endpoint returns raw binary output rather than JSON, so clients should handle the response as a file download or binary stream.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 04
POST
Extract audio from video (upload → cloud link)
https://api.eu.apyhub.com/apyhub/extract-audio-from-video/multi-part/link

QUICKSTART

GUIDE

Quickstart

Upload a video file to extract audio and return a signed download URL.

curl -X POST "https://api.eu.apyhub.com/apyhub/extract-audio-from-video/multi-part/link" \
  -H "apy-token: $APY_TOKEN" \
  -F "video=@/path/to/video.mp4"

What you'll get back

Returns a JSON object with a data string field containing a time-limited signed URL for download.

{
  "data": "https://..."
}
TRY ITLIVE · 550 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

Extracts audio from an uploaded video and returns a JSON object containing a time-limited signed URL for downloading the extracted audio.

Request Body

ParameterTypeMandatoryDescription
videoStringYesVideo file to process, sent as binary upload.
durationIntegerNoDuration in seconds to extract. Default: 2. Minimum: 0.
full_audioENUMNoWhether to extract the full audio track. Allowed values: true, false, 1, 0. Default: false.
start_timeIntegerNoStart time in seconds for the extraction. Default: 0. Minimum: 0.
output_formatENUMNoOutput audio format. Allowed values: mp3, wav, aac, ogg, flac, wma, ac3. Default: mp3.

Response

Returns a JSON object with a data string field containing a URI. The data value is a time-limited signed URL for downloading the extracted audio.

ParameterTypeMandatoryDescription
dataStringNoTime-limited signed URL for download.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 03 / 04
POST
Extract audio from video (URL → download)
https://api.eu.apyhub.com/apyhub/extract-audio-from-video/url/download

QUICKSTART

GUIDE

Quickstart

Download audio from a video URL using the required video_url field.

curl -X POST "https://api.eu.apyhub.com/apyhub/extract-audio-from-video/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://assets.apyhub.com/samples/sample.mp4"
  }'

What you'll get back

Returns the extracted audio as a binary file response.

TRY ITLIVE · 550 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Number of seconds to extract. Ignored when full_audio is true.
Seek offset in seconds (string).

About this endpoint

What it does

Extracts audio from a video provided by URL and returns the resulting audio as a binary file download. You can extract either a segment or the full audio, and choose the output format.

Request Body

ParameterTypeMandatoryDescription
video_urlStringYesVideo URL to extract audio from. Must be a URI.
durationStringNoNumber of seconds to extract. Default: 2. Ignored when full_audio is true.
full_audioBooleanNoWhether to extract the full audio. Default: false.
start_timeStringNoSeek offset in seconds. Default: 0.
output_formatENUMNoOutput audio format. Allowed values: mp3, wav, aac, ogg, flac, wma, ac3. Default: mp3.

Response

Returns a binary file download (string with binary format). The success response is the extracted audio file itself, not a JSON object.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.