> ## Documentation Index
> Fetch the complete documentation index at: https://docs.musicmint.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Waveform Data

> Get waveform amplitude data for audio visualization

## Endpoint

```http theme={null}
GET /api/v1/music/waveform?clip_id={clip_id}
```

**Synchronous.** Returns waveform data immediately.

Returns amplitude data points for a clip, suitable for rendering audio waveform visualizations in your UI.

## Query parameters

| Parameter | Type   | Required | Description                                                                                                                                                |
| --------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clip_id` | string | **Yes**  | Clip ID to retrieve waveform for. Obtain from [Upload Audio](/api-reference/music/upload) (`data.clipId`) or a completed generation task (`results[].id`). |

## Response

```json theme={null}
{
  "code": 0,
  "message": "ok",
  "request_id": "req-1710000000000",
  "data": [0.12, 0.45, 0.78, 0.56, 0.34, ...]
}
```

The `data` field contains an array of normalized amplitude values (0.0 to 1.0) sampled at regular intervals across the clip duration.

## Example

```bash theme={null}
curl "https://api.example.com/api/v1/music/waveform?clip_id=abc123def456" \
  -H "Authorization: Bearer sk-mm-your-key"
```

## Use case: waveform player

Render a visual waveform using the amplitude array:

```javascript theme={null}
function drawWaveform(canvas, amplitudes) {
  const ctx = canvas.getContext('2d');
  const w = canvas.width, h = canvas.height;
  amplitudes.forEach((amp, i) => {
    const x = (i / amplitudes.length) * w;
    const barH = amp * h;
    ctx.fillRect(x, (h - barH) / 2, 1, barH);
  });
}
```
