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

MethodPath
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
GET/api/search/youtube-music/lyrics

Lyrics

Fetch full synchronized lyrics from YouTube Music. Works by song name or by YouTube video ID for precise lookup.

Parameters

NameTypeRequiredDescription
qstringoptionalSong name or artist + title
e.g. Rema Calm Down
videoIdstringoptionalYouTube video ID (overrides q)
e.g. SiUCHbOSXjI

Example Request

https://apis.xcasper.space/api/search/youtube-music/lyrics?q=Rema+Calm+Down

Code Examples

curl
curl "https://apis.xcasper.space/api/search/youtube-music/lyrics?q=Rema+Calm+Down"

Example Response

json
{
  "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..."
}
GET/api/search/youtube-music/metadata

Metadata

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

NameTypeRequiredDescription
qstringrequiredSong name, artist name, or YouTube video ID
e.g. Burna Boy Last Last

Example Request

https://apis.xcasper.space/api/search/youtube-music/metadata?q=Burna+Boy+Last+Last

Code Examples

curl
curl "https://apis.xcasper.space/api/search/youtube-music/metadata?q=Burna+Boy+Last+Last"

Example Response

json
{
  "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"
}
GET/api/search/youtube-music/channel

Channel / 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

NameTypeRequiredDescription
idstringrequiredYouTube channel ID (starts with UC…)
e.g. UCuzBOMDciFy6Iot18xvEMCQ

Example Request

https://apis.xcasper.space/api/search/youtube-music/channel?id=UCuzBOMDciFy6Iot18xvEMCQ

Code Examples

curl
curl "https://apis.xcasper.space/api/search/youtube-music/channel?id=UCuzBOMDciFy6Iot18xvEMCQ"

Example Response

json
{
  "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://..."
        }
      ]
    }
  ]
}
GET/api/downloader/ytmusic

Music 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

NameTypeRequiredDescription
urlstringrequiredYouTube Music or YouTube URL (music.youtube.com or youtube.com/watch?v=)
e.g. https://music.youtube.com/watch?v=SiUCHbOSXjI

Example Request

https://apis.xcasper.space/api/downloader/ytmusic?url=https://music.youtube.com/watch?v=SiUCHbOSXjI

Code Examples

curl
curl "https://apis.xcasper.space/api/downloader/ytmusic?url=https://music.youtube.com/watch?v=SiUCHbOSXjI"

Example Response

json
{
  "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"
    }
  ]
}
GET/api/proxy/ytmusic-stream

Audio 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

NameTypeRequiredDescription
vstringrequiredYouTube video ID (11 characters)
e.g. SiUCHbOSXjI
qstringoptionalQuality — high (default) · low
e.g. high
fnstringoptionalDownload filename suggestion
e.g. last_last.m4a

Example Request

https://apis.xcasper.space/api/proxy/ytmusic-stream?v=SiUCHbOSXjI&q=high&fn=last_last.m4a

Code Examples

curl
# 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

json
{
  "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"
  }
}
GET/api/proxy/yt-video-stream

Video 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

NameTypeRequiredDescription
vstringrequiredYouTube video ID (11 characters)
e.g. KB_ly4MO_Tw
qstringoptionalQuality hint — high (default) · low · 720 · 480 · 360
e.g. high

Example Request

https://apis.xcasper.space/api/proxy/yt-video-stream?v=KB_ly4MO_Tw&q=high

Code Examples

curl
# 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

json
{
  "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"
  }
}

Built and maintained by Casper Tech Kenya

This API wraps YouTube Music's internal Innertube protocol. Usage is subject to YouTube's Terms of Service.