# Extract audio from video

Pull audio tracks as MP3, AAC, or other formats

Pull the audio track from a video — for podcasts, audio-only playback, or when you need audio without the video overhead.

## API

<CodeGroup labels={["CLI", "TypeScript", "Python", "curl"]}>
```bash
ittybit audio \
  -i https://example.com/video.mp4
```

```typescript
const task = {
  input: 'https://example.com/video.mp4',
  kind: 'audio',
};

const res = await fetch('https://api.ittybit.com/jobs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.ITTYBIT_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(task),
});
const data = await res.json();
```

```python

task = {
    "input": "https://example.com/video.mp4",
    "kind": "audio",
}

res = requests.post(
    "https://api.ittybit.com/jobs",
    headers={"Authorization": f"Bearer {api_key}"},
    json=task,
)
data = res.json()
```

```bash
TASK='{
  "input": "https://example.com/video.mp4",
  "kind": "audio"
}'

curl -X POST https://api.ittybit.com/jobs \
  -H "Authorization: Bearer $ITTYBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$TASK"
```

</CodeGroup>

Default is MP3. For AAC:

```json
{ "input": "https://...", "kind": "audio", "options": { "format": "aac" } }
```

## CLI

```bash
ittybit audio \
  -i video.mp4 \
  -o audio.mp3

ittybit audio \
  -i video.mp4 \
  -o audio.flac \
  --format flac
```

## Trimming

```bash
ittybit audio \
  -i video.mp4 \
  -o clip.mp3 \
  --start 60 \
  --end 120
```

## Formats

| Format | Notes                             |
| ------ | --------------------------------- |
| `mp3`  | Universal, lossy                  |
| `aac`  | Better quality per bit            |
| `opus` | Best compression, modern browsers |
| `wav`  | Lossless, large                   |
| `flac` | Lossless, compressed              |
| `ogg`  | Vorbis, open format               |

## S3 input/output

Extract audio from S3-hosted video using [connections](/cli/connections):

```bash
ittybit audio \
  -i s3://uploads/interview.mp4 \
  -o s3://audio/interview.mp3 \
  --connection my-s3
```

## See also

- [API `POST /jobs`](/api/create-job) with `kind: "audio"` — extract audio via HTTP
- [CLI `audio`](/cli/audio) — full reference for audio flags and options
- [Convert uploads for web playback](/guides/convert-uploads-for-web-playback) — process the video itself
- [Extract thumbnails](/guides/extract-thumbnails-from-video) — pull poster frames from the same video