ytm-extension

YTM Now Playing

A Chrome extension that tracks your YouTube Music listening activity and exposes it via a public API — perfect for “now playing” widgets on your portfolio, blog, or any website.

Think Spotify’s Now Playing API, but for YouTube Music.

How It Works

YouTube Music Tab → Extension (content script) → Supabase DB → Your Website
  1. The extension watches your YouTube Music browser tab
  2. It extracts the current song (title, artist, album art, progress, etc.)
  3. It writes the data to a Supabase database in real-time
  4. Your website reads from the database via a simple REST API

Setup

1. Install the Extension

2. Create an Account

3. Get Your User ID

4. Start Listening

Public API

Once you’re signed in and listening, anyone can fetch your current song via the REST API. No authentication required for reading.

Endpoint

GET https://uczcbonklkmgzdtqeulx.supabase.co/rest/v1/now_playing?user_id=eq.YOUR_USER_ID&select=*

Headers

apikey: sb_publishable_SS1XoSstAPQjgehDEvZfaw_QAmep2_a

Response

{
  "title": "Trumpet",
  "artist": "Seyi Vibez",
  "album": "NAAMij",
  "album_art": "https://lh3.googleusercontent.com/...",
  "is_playing": true,
  "duration": "3:45",
  "progress_ms": 45000,
  "duration_ms": 225000,
  "song_url": "https://music.youtube.com/watch?v=...",
  "updated_at": "2026-02-11T20:30:00.000Z"
}

Response Fields

Field Type Description
title string Song title
artist string Artist name
album string Album name
album_art string Album art URL
is_playing boolean Whether music is currently playing
duration string Song duration (formatted)
progress_ms integer Playback progress in milliseconds
duration_ms integer Total song duration in milliseconds
song_url string Link to the song on YouTube Music
updated_at string ISO timestamp of last update

📖 For integration guides with code snippets (React, Vue, vanilla JS, etc.), see Integration Docs

Project Structure

ytm-extension/
├── manifest.json          # Extension config (Manifest V3)
├── config.js              # Supabase credentials
├── content-ytm.js         # Content script (injected into YouTube Music)
├── background.js          # Service worker (auth + Supabase writes)
├── popup.html/css/js      # Extension popup UI
├── icons/                 # Extension icons
├── privacy-policy.md      # Privacy policy
├── integration-docs.md    # Developer integration guide
└── supabase-setup.sql     # Database schema

Privacy

This extension:

See the full Privacy Policy.

License

MIT