Spotify is sorted. Now we go to YouTube's side.
The goal of this chapter is simple: get a YouTube API key and find the ID of the YouTube playlist we want to mirror. Two things. That's it.
A Quick Word on the YouTube API
YouTube is owned by Google, so the YouTube API lives inside Google's developer platform. Don't let that intimidate you — you're logging in with the same Google account you use for Gmail or Google Drive. Nothing new to create.
The YouTube Data API has a free tier that gives you 10,000 units per day. Reading a playlist of 100 songs costs about 200 units. So unless you're syncing 50 playlists a day, you'll never hit the limit. We're well within free territory.
Step 1: Go to Google Cloud Console
Open your browser and go to and open the playlist you want to mirror on Spotify.
Look at the URL in your browser's address bar. It will look something like this:
https://www.youtube.com/playlist?list=PLGBuKfnErZlAkaUUy57-mR97f8SBgMNHh
The part after list= is your Playlist ID. In this example, that's PLGBuKfnErZlAkaUUy57-mR97f8SBgMNHh. That's the 70's Music Hits Playlist - Best of 70s Music Classics by Redlist Decades — the one we'll be using throughout this series.
Copy that. That's all you need from YouTube.
One thing to note: the playlist needs to be public or unlisted for the API to read it. If it's set to private, the script won't be able to see it. You can change the visibility in YouTube Studio under your playlist settings.
What You Have Now
Between Chapters 2 and 3, you've collected everything the script needs to run. Here's the full list:
| Variable | What it is | Where you got it |
|---|---|---|
CLIENT_ID | Spotify app ID | Spotify Developer Dashboard |
CLIENT_SECRET | Spotify app secret | Spotify Developer Dashboard |
REFRESH_TOKEN | Long-lived Spotify login token | curl/PowerShell command in Chapter 2 |
SPOTIFY_PLAYLIST_ID | Your Spotify playlist to write to | Spotify share link |
API_KEY | YouTube Data API key | Google Cloud Console |
YOUTUBE_PLAYLIST_ID | PLGBuKfnErZlAkaUUy57-mR97f8SBgMNHh | YouTube playlist URL |
Six values. That's the whole configuration. No more accounts, no more dashboards. From Chapter 4 onward, it's all code.
What's Next?
In Chapter 4, we write the script. We'll walk through each file — what it does, how it works, and why — in plain English. No assumed knowledge.
See you there.
SOCIAL SHARE CARD GENERATOR