Menu

3 YouTube Data API traps I hit building playlists in bulk
📰

3 YouTube Data API traps I hit building playlists in bulk

DEV Community: angular·Sam Wootton·10 days ago
#AjnC7xE2
#devtoangular#devto#dev#playlist#youtube
Long article (712 words) — no AI summary yet.
Reading 0:00
15s threshold

Most of us already have the videos for the playlist we want. They are just scattered: the workout videos in a playlist called "Saved for later", the recipes somewhere in Liked videos. On YouTube, building a new playlist from them means saving each video, one menu at a time.

I built TidyList, a web app for cleaning up big YouTube playlists, on the YouTube Data API v3, and building new playlists from old ones is half of what it does. Creating the playlist is one call. Filling it properly took three lessons.

The manual way

Find a video you want in one of your playlists.

Open its menu, choose Save and tick the new playlist.

Repeat for every video, keeping track yourself of which ones you have already added.

Trap 1: insert order is not the order you loop in

playlistItems.insert takes an optional snippet.position . Leave it out and each video is appended at the end, which is also where YouTube's own Save puts it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.