Waveform image
A play button alone tells a listener nothing about where the loud moment is or how long a track runs; the waveform is what turns a flat audio file into something you can see and scrub through. This waveform generator API takes an audio file and returns either a rendered image or the raw peaks JSON behind it, whichever your player needs.
Run it online
Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.
Why players lean on a picture of sound
Sound has no shape until someone draws it: the jagged line you see in a podcast player or a DAW is a visual summary of thousands of amplitude samples compressed down to something a screen can render at a glance. Interface designers building a custom audio player, podcast platforms wanting a scrubbable preview, and voice-note apps showing a recording in progress all rely on some version of this image, and computing it from raw samples on every page load is wasteful when it can be generated once and cached.
Two outputs for two different needs
You submit the audio file to POST /audio/waveform and choose whether you want a rendered waveform image, ready to drop directly into an interface, or the underlying peaks JSON, the numeric amplitude values a front-end library like a canvas-based player can draw itself with full control over color and style. The task queues asynchronously and returns a task_id; the finished image or JSON is then delivered by signed webhook or a signed link valid for 24 hours.
From oscilloscopes to on-screen scrubbers
The waveform display traces back to the oscilloscope, an instrument built to make an electrical signal visible as a moving line; audio software adapted the same idea to give a static file a shape you could look at and click into. Peaks JSON is the modern, lightweight descendant of that same idea, a compact array of amplitude values instead of a picture, which is why so many web audio players fetch peaks data rather than an image when they want a waveform they can restyle on the fly.
Where waveforms show up in a pipeline
Podcast hosting platforms generate a waveform once at upload time rather than in the listener's browser, editing tools use peaks data to let a user click precisely on a loud section, and voice-message features in messaging apps show a live-looking waveform that was actually pre-rendered. Pricing is $0.077 per request plus $0.0045 per minute of source audio, so generating a waveform for a short voice note costs a small fraction of one for an hour-long episode, and a task that fails after automatic retries is never billed.
Access and current status
The endpoint requires prepaid balance, same as the rest of the API; without one, requests return HTTP 402. This endpoint is currently in deployment and will begin accepting jobs soon. Source audio and generated waveform data are retained only for the delivery window and are never used to train models.
What you can do with it
Podcast player preview
Generate a waveform image once at upload time so a podcast player can show a scrubbable visual instead of a blank progress bar.
Custom web audio player styling
Fetch peaks JSON so a front-end canvas player can draw the waveform in the app's own color scheme instead of a fixed image.
Voice message previews
Render a waveform for a recorded voice message so a chat interface can display it before playback starts.
Editing tool click targets
Use peaks data to let editors click directly on a loud or quiet section of a track for precise navigation.
FAQ
How do I generate a waveform image from audio?
Send the file to POST /audio/waveform and request the image output; the task returns the rendered waveform via webhook or a signed link.
Can I get raw peaks data instead of an image?
Yes, the same endpoint can return peaks JSON, the numeric amplitude values, so a front-end player can draw its own custom-styled waveform.
Is there a free plan for the waveform API?
There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.
How much does generating a waveform cost?
It costs $0.077 per request plus $0.0045 per minute of source audio, so cost scales with the length of the file.
Is the waveform generator API live yet?
It is currently in deployment and will start accepting jobs soon; the image and peaks JSON output described here is what will ship.
What image format does the waveform come in?
The endpoint renders a standard image format suitable for embedding directly in a web or app interface.
Can I use this for a large batch of audio files?
Yes, submit one request per file; each is queued and priced independently, so a catalog of episodes or clips can be processed in parallel.
Does the waveform image reflect the actual audio content?
Yes, both the image and the peaks JSON are computed directly from the amplitude of the audio you submit, not a placeholder or approximation.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/audio/waveform \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"audio":"https://ejemplo.com/audio.mp3"}'const res = await fetch("https://api.kit.forhosting.com/audio/waveform", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"audio": "https://ejemplo.com/audio.mp3"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/audio/waveform",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"audio": "https://ejemplo.com/audio.mp3"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/audio/waveform", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"audio":"https://ejemplo.com/audio.mp3"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"audio":"https://ejemplo.com/audio.mp3"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/audio/waveform", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"audio": "https://ejemplo.com/audio.mp3"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "audio.waveform",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_mb | 200 |
max_minutes | 180 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |