API Documentation
Developer documentation for the Kaemit download API, lyrics API, and website token access.
Download API
Download audio or video from a YouTube URL in your chosen format and quality.
Lyrics API
Retrieve synchronized or plain lyrics by song title with an optional artist filter.
Website Tokens
Log in on the website to bypass site limits. Tokens are not accepted by the public API.
Website Tokens
Token login is browser-session based and only affects downloads made through the Kaemit website UI.
Valid tokens are managed server-side and are used only for browser-session login.
When logged in, website requests bypass Flask-Limiter download limits and the 50-track playlist download cap. API requests do not support token headers, bearer tokens, or token parameters.
Download API
Downloads audio or video from YouTube and returns the converted file as a binary attachment. Accepts a JSON body.
Request Body
| Parameter | Type | Description | |
|---|---|---|---|
| url | string | required | YouTube video URL (youtube.com or youtu.be) |
| type | string | optional | audio (default) or video |
| format | string | optional |
Audio: flac (default), mp3, aac, wav, ogg, opus, m4aVideo: mp4, mkv, webm, mov, avi
|
| naming | string | optional | title (default), artist_title, title_artist, title_id, or artist_title_id |
| filename | string | optional | Exact custom filename for single downloads only. Any supplied extension is replaced with the selected output format. |
Rate limit: 5/minute and 20/hour. Website token login does not apply to direct API clients.
Example
On success the binary file is returned. On error:
Lyrics API
Returns raw LRC-format lyrics or plain text from available lyric sources. Lyrics are also automatically embedded into audio file metadata on download.
Query Parameters
| Parameter | Type | Description | |
|---|---|---|---|
| q | string | required | Song title or alias |
| artist | string | optional | Filter by artist name — improves search accuracy |
Example
Returns the raw lyrics text — LRC format when synced is available, plain text otherwise. 404 when not found.
Rate limit: 30/minute. Website tokens do not apply to this endpoint.
Error Codes
| Code | Meaning |
|---|---|
| 400 | Bad Request — missing or invalid parameters |
| 404 | Not Found — lyrics not found for the given query |
| 422 | Unprocessable — video unavailable, age-restricted, or private |
| 429 | Too Many Requests — public API or free website rate limit exceeded |
| 500 | Server Error — FFmpeg missing or unexpected failure |