A tiny, single-user API that takes the song you're playing in Apple Music and drops it into a fixed YouTube playlist.
POSTs to this site's API with a shared secret.POST/api/add-song
Header: Authorization: Bearer <SHORTCUT_TOKEN>
Request body:
{ "title": "Blinding Lights", "artist": "The Weeknd" }
Success response:
{
"ok": true,
"videoId": "abc123",
"videoTitle": "The Weeknd - Blinding Lights",
"playlistItemId": "xyz789",
"alreadyInPlaylist": false
}
Failures return { "ok": false, "error": "..." } with a non-2xx status.
The playlist owner mints a YouTube refresh token once via /api/oauth/start, then stores these as Cloudflare Pages secrets:
SHORTCUT_TOKEN — shared secret gating the APIYOUTUBE_CLIENT_ID, YOUTUBE_CLIENT_SECRETYOUTUBE_REFRESH_TOKENYOUTUBE_PLAYLIST_IDUntil those are set, the API responds with a configuration error.