Extract audio from video and get back an MP3 plus its duration.
POST a video URL, get an MP3 back — plus its duration. Fotovid runs the extraction on hosted infrastructure, so there's no binary and no pipeline in your stack.
curl -X POST https://api.fotovid.co/v1/video/extract-audio \
-H "Authorization: Bearer p6_YOUR_KEY_ID:YOUR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"source_url": "https://cdn.yoursite.com/talk.mp4"
}'Ripping audio out of video shouldn't require ffmpeg on your server
Pulling the audio track from a video is a one-line ffmpeg command — until you try to run it in a serverless function. The static ffmpeg binary is tens of megabytes, which blows past deploy size limits on Vercel, Netlify, and Lambda. Decoding video to re-encode an MP3 is CPU- and memory-hungry, so it trips function timeouts and cold-start limits on anything but the biggest instances. And you still have to download the source, shell out to a subprocess, capture the output file, and upload the result somewhere durable.
- ffmpeg static builds are too large to bundle in most serverless deploy artifacts
- Audio extraction re-encodes the whole track, so it hits CPU, memory, and timeout ceilings
- You need a place to host the resulting MP3 and hand back a URL your app can use
- Reach for this endpoint when you want the MP3 without owning any of the media plumbing
Request parameters
POST /v1/video/extract-audio
No params — post a source_url and get back an MP3 with its duration.
| Field | Type | Default | Description |
|---|---|---|---|
| source_url* | string (URL) | — | HTTPS URL of the source video (MP4, MOV, WebM, MKV, ...) |
Your first call in three steps
- 1Get a free API key
Sign up and create a key from the dashboard. Requests authenticate with an Authorization: Bearer p6_<key_id>:<secret> header. New keys start with free credits, and pricing is pure usage — $1 buys 100 credits and this operation costs about 1 credit per call, so there's nothing to commit to up front.
- 2POST the video to /v1/video/extract-audio
Send a request to https://api.fotovid.co/v1/video/extract-audio with the standard envelope: a source_url pointing at the HTTPS URL of your video, and an empty params object — audio extraction takes no parameters. Fotovid downloads the video, strips out the audio track, and encodes it to MP3 synchronously, returning as soon as the file is ready.
- 3Use the returned MP3 URL
The response is flat JSON: an id, a type, a fotovid-hosted url for the MP3, an expires_at, and the duration of the audio in seconds. Feed the url straight into a podcast feed, a transcription or AI pipeline, or a player. Because hosted results are temporary, download and store your own copy of the MP3 as part of your flow.
Frequently asked questions
Ship it with one API call
Grab a free key and make your first call in under five minutes.
