YouTube Music API
by Casper Tech Kenya · Built on Innertube
A fully free REST API built on YouTube Music's Innertube API. No API keys. No rate limits. No account needed. Search songs, albums, artists, playlists — fetch lyrics, metadata, and trending feeds — download or stream audio directly from YouTube's own CDN.
Base URL
https://apis.xcasper.space
Auth
None required
Rate Limit
None
Format
JSON
All Endpoints
Click an endpoint to jump to its documentation
| Method | Path |
|---|---|
| GET | /api/search/youtube-music |
| GET | /api/search/youtube-music/lyrics |
| GET | /api/search/youtube-music/metadata |
| GET | /api/search/youtube-music/trending |
| GET | /api/search/youtube-music/channel |
| GET | /api/downloader/ytmusic |
| GET | /api/proxy/ytmusic-stream |
| GET | /api/proxy/yt-video-stream |
/api/search/youtube-musicSearch
Search YouTube Music for songs, videos, albums, artists, playlists, or get autocomplete suggestions. Returns rich metadata including thumbnails, play counts, and track listings.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
q | string | required | Search querye.g. Burna Boy Last Last |
type | string | optional | Result type — songs · videos · top · albums · artists · playlists · suggestionse.g. songs |
Code Examples
curl "https://apis.xcasper.space/api/search/youtube-music?q=Burna+Boy+Last+Last&type=songs"Example Response
{
"success": true,
"query": "Burna Boy",
"type": "songs",
"count": 20,
"results": [
{
"type": "song",
"title": "Last Last",
"artist": "Burna Boy",
"album": "Love, Damini",
"duration": "3:55",
"plays": "241M plays",
"video_id": "SiUCHbOSXjI",
"thumbnail": "https://lh3.googleusercontent.com/...",
"youtube_url": "https://www.youtube.com/watch?v=SiUCHbOSXjI"
},
"..."
]
}/api/search/youtube-music/lyricsLyrics
Fetch full synchronized lyrics from YouTube Music. Works by song name or by YouTube video ID for precise lookup.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
q | string | optional | Song name or artist + titlee.g. Rema Calm Down |
videoId | string | optional | YouTube video ID (overrides q)e.g. SiUCHbOSXjI |
Code Examples
curl "https://apis.xcasper.space/api/search/youtube-music/lyrics?q=Rema+Calm+Down"Example Response
{
"success": true,
"title": "Calm Down",
"artist": "Rema",
"video_id": "WcIcVapfqXw",
"source": "YouTube Music",
"youtube_music_url": "https://music.youtube.com/watch?v=WcIcVapfqXw",
"lyrics": "Calm down, calm down\nShe tell me calm down, calm down..."
}/api/search/youtube-music/metadataMetadata
Get rich metadata for a song or artist — view counts, release date, producer, record label, composer, ISRC data, keywords, artist bio, monthly listeners, and popular songs.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
q | string | required | Song name, artist name, or YouTube video IDe.g. Burna Boy Last Last |
Code Examples
curl "https://apis.xcasper.space/api/search/youtube-music/metadata?q=Burna+Boy+Last+Last"Example Response
{
"success": true,
"type": "song",
"title": "Last Last",
"artist": "Burna Boy",
"views": 241000000,
"views_formatted": "241M views",
"duration_formatted": "3:55",
"released": "May 13, 2022",
"producer": "P2J",
"rights": "Atlantic Records",
"composer_lyricist": "Damini Ebunoluwa Ogulu",
"keywords": [
"Burna Boy",
"Last Last",
"Love Damini",
"Afrobeats"
],
"thumbnail": "https://lh3.googleusercontent.com/...",
"youtube_music_url": "https://music.youtube.com/watch?v=SiUCHbOSXjI"
}/api/search/youtube-music/trendingTrending Feed
Fetch YouTube Music's live home and explore feed. Returns multiple carousels of trending content including songs, albums, playlists, artists, and more — exactly what you see on music.youtube.com.
Code Examples
curl "https://apis.xcasper.space/api/search/youtube-music/trending"Example Response
{
"success": true,
"sections": [
{
"title": "Top songs",
"items": [
{
"type": "song",
"title": "Espresso",
"subtitle": "Sabrina Carpenter",
"position": 1,
"video_id": "eVli-tstM5E",
"thumbnail": "https://..."
},
"..."
]
},
{
"title": "New releases",
"items": [
"..."
]
}
]
}/api/search/youtube-music/channelChannel / Artist Page
Browse an artist's full YouTube Music channel. Returns name, subscriber count, monthly listeners, biography, and all page sections (Singles & EPs, Videos, Fans might also like, etc.) with full item metadata.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | required | YouTube channel ID (starts with UC…)e.g. UCuzBOMDciFy6Iot18xvEMCQ |
Example Request
Code Examples
curl "https://apis.xcasper.space/api/search/youtube-music/channel?id=UCuzBOMDciFy6Iot18xvEMCQ"Example Response
{
"success": true,
"name": "Phany Love",
"thumbnail": "https://lh3.googleusercontent.com/...",
"subscribers": "112K subscribers",
"monthly_listeners": "1.2M monthly audience",
"sections_count": 3,
"sections": [
{
"title": "Singles & EPs",
"items": [
{
"title": "Huyu",
"subtitle": "Single • 2026",
"browse_id": "MPREb_...",
"thumbnail": "https://..."
},
"..."
]
},
{
"title": "Videos",
"items": [
{
"title": "Phany Love Huyu",
"subtitle": "Phany Love • 687K views",
"video_id": "Dd0hv-L14hk",
"thumbnail": "https://..."
}
]
}
]
}/api/downloader/ytmusicMusic Downloader
Download any YouTube Music (or YouTube) track as M4A audio. Returns rich metadata — title, artist, album, duration, view count, max-res thumbnail — plus direct download URLs backed by YouTube's own CDN. No third-party converters.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string | required | YouTube Music or YouTube URL (music.youtube.com or youtube.com/watch?v=)e.g. https://music.youtube.com/watch?v=SiUCHbOSXjI |
Example Request
Code Examples
curl "https://apis.xcasper.space/api/downloader/ytmusic?url=https://music.youtube.com/watch?v=SiUCHbOSXjI"Example Response
{
"success": true,
"source": "youtube-music-cdn",
"track": {
"id": "SiUCHbOSXjI",
"title": "Last Last",
"artist": "Burna Boy",
"duration": "3:55",
"duration_s": 235,
"view_count": "241083691",
"thumbnail": "https://i.ytimg.com/vi/SiUCHbOSXjI/maxresdefault.jpg",
"youtube_url": "https://www.youtube.com/watch?v=SiUCHbOSXjI",
"music_url": "https://music.youtube.com/watch?v=SiUCHbOSXjI"
},
"downloads": [
{
"quality": "high",
"format": "m4a",
"codec": "aac",
"description": "Best available audio quality (direct from YouTube CDN)",
"url": "https://apis.xcasper.space/api/proxy/ytmusic-stream?v=SiUCHbOSXjI&q=high&fn=last_last.m4a"
},
{
"quality": "low",
"format": "m4a",
"codec": "aac",
"description": "Lower audio quality (direct from YouTube CDN)",
"url": "https://apis.xcasper.space/api/proxy/ytmusic-stream?v=SiUCHbOSXjI&q=low&fn=last_last.m4a"
}
]
}/api/proxy/ytmusic-streamAudio Stream (CDN Proxy)
Streams M4A audio directly from YouTube's own CDN servers. Pass a YouTube video ID and get back a live audio byte stream — no expiry issues, no third-party middlemen. Used internally by the Music Downloader endpoint.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
v | string | required | YouTube video ID (11 characters)e.g. SiUCHbOSXjI |
q | string | optional | Quality — high (default) · lowe.g. high |
fn | string | optional | Download filename suggestione.g. last_last.m4a |
Example Request
Code Examples
# Stream and save to file:
curl -o last_last.m4a \
"https://apis.xcasper.space/api/proxy/ytmusic-stream?v=SiUCHbOSXjI&q=high&fn=last_last.m4a"Example Response
{
"note": "This endpoint streams raw audio bytes (Content-Type: audio/mp4). Use it directly as an <audio> src or fetch with stream mode.",
"headers": {
"Content-Type": "audio/mp4",
"Content-Disposition": "attachment; filename=\"last_last.m4a\"",
"Transfer-Encoding": "chunked",
"X-API-Provider": "CASPER TECH"
}
}/api/proxy/yt-video-streamVideo Stream (Proxy)
Streams a 360p MP4 video (video + audio combined) directly from YouTube's CDN via a server-side proxy. No third-party services — uses yt-dlp with YouTube's android player client to get a progressive MP4 stream the browser can play natively in a <video> element.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
v | string | required | YouTube video ID (11 characters)e.g. KB_ly4MO_Tw |
q | string | optional | Quality hint — high (default) · low · 720 · 480 · 360e.g. high |
Code Examples
# Stream and save as MP4:
curl -o video.mp4 \
"https://apis.xcasper.space/api/proxy/yt-video-stream?v=KB_ly4MO_Tw&q=high"Example Response
{
"note": "This endpoint streams raw video bytes (Content-Type: video/mp4). Use it directly as a <video> src — no pre-fetch needed.",
"headers": {
"Content-Type": "video/mp4",
"Transfer-Encoding": "chunked",
"Cache-Control": "no-store",
"X-API-Provider": "CASPER TECH",
"X-Video-Id": "KB_ly4MO_Tw"
}
}