How to Export a YouTube Playlist to JSON
When the destination is a script, not a spreadsheet, you want structured data — not rows you have to parse.
Updated 1 September 2026 · 5 min readCSV is for people. JSON is for programs. If the next thing that touches this playlist data is a script, a static site build, a database import or an LLM prompt, you want it as a nested structure you can iterate over — not a flat file you have to split on commas and guess the types of.
This guide covers when JSON is worth choosing, why the official API route has more setup than the job deserves, the one-step export, and what you can do with the file once you have it.
When JSON is the right format
- You're feeding the playlist into a script or a build step that expects structured input.
- Fields like tags and thumbnails are naturally lists or objects — awkward in a CSV cell, clean in JSON.
- You want to preserve types: counts as numbers, dates as strings, not everything as text.
- You're passing the data to an API, a database, or a model that reads JSON directly.
If a human is going to open it in Excel, export CSV instead. JSON earns its place when code is the reader.
The API-key way, and its friction
You can get playlist JSON straight from the YouTube Data API. To do it you need a Google Cloud project, an enabled API, an API key, and code that calls playlistItems.list with pagination, then a second batched call to videos.list to get durations and statistics, then logic to merge the two.
That's the right approach if you're building a product on it. For a one-off export, or a script you run occasionally, it's a lot of scaffolding for a list of videos.
The one-step JSON export
Open the Playlist Export tool
Paste the playlist URL
list=.Choose the JSON format
Download the file
.json file with the whole playlist already merged and ordered.One run, many formats
What the file looks like
The export is an array of video objects in playlist order. Each object carries the fields the tool pulled — the title, the channel, the video ID and URL, the duration, the public counts, the publish date, the date it was added to the playlist, plus tags, description and thumbnail on paid plans.
Because it's already flat and merged, you don't deal with nextPageToken, contentDetails nesting, or the split between playlist items and video details — the parts of the raw API that make a simple task fiddly.
Using the JSON in code
- Load it with
JSON.parse/json.loadand iterate the array. - Filter or sort by any field — longest videos, most viewed, added this year.
- Map it into your own schema before a database insert.
- Pass it to a model as context — "here is the playlist, summarise the topics covered".
- Diff two exports taken weeks apart to see what was added or removed.
Three quick recipes
Once the playlist is a JSON array, the common tasks are one line each. Assuming the file is loaded as videos:
- Total runtime — sum the duration field:
videos.reduce((s, v) => s + v.durationSeconds, 0). - Longest videos first —
[...videos].sort((a, b) => b.durationSeconds - a.durationSeconds). - Just the watch links —
videos.map(v => v.url), then write to a text file.
To find what changed between two exports taken weeks apart, key each array by video ID and diff the sets — the IDs missing from the newer file are the videos the playlist lost, and the older file still has their titles.
Common problems
| Symptom | Cause | Fix |
|---|---|---|
| Array is shorter than the playlist | Free exports return a portion of a long playlist. | The file reports the count pulled against the total; a paid plan returns every video. |
| Some fields are missing on every object | Tags, descriptions and thumbnails are on the paid tier. | Free returns the core fields; upgrade for the full metadata set. |
| A few videos have null title / duration | Those entries are deleted or private — there's no data to include. | Filter them out, or use the Deleted Video Finder to recover what they were. |
| Duration is a string like "PT4M13S" | That's ISO 8601 duration, straight from YouTube. | Parse it once into seconds; most languages have a helper, or a short regex does it. |
| Private playlist won't export | A pasted URL can't read a private playlist. | Connect YouTube (read-only) for your own, or switch it to Unlisted temporarily. |
How MyFreshTools helps
What the tool does
The YouTube Playlist Export takes a playlist URL, calls the YouTube Data API for you, pages through the entire playlist, enriches each item with durations and public statistics, and returns one file in the format you choose — JSON among nine options.
Who it's for
- Developers who need playlist data without standing up an API project.
- Anyone scripting against a playlist occasionally rather than continuously.
- People piping playlist metadata into a database, a site build or a model.
How to use it
- Paste the playlist URL and choose JSON.
- Load the file in your language of choice and iterate the array.
Requirements and limits
- A free MyFreshTools account. No card, free credits on signup.
- 1 credit per 1,000 videos exported (most playlists are 1 credit).
- Free exports return part of a long playlist and the core fields; paid plans return every video and the full field set.
- Metadata only — never the video or audio files.
- Private playlists need Connect YouTube (read-only) or a temporary switch to Unlisted.
- It's an export, not a live API endpoint — re-run it when the playlist changes.
Frequently asked questions
Paste the playlist URL into a playlist exporter and choose the JSON format. You get a structured array of video objects — title, channel, duration, counts, dates, links — without needing a YouTube API key or a Google Cloud project.
Each video object includes the title, channel, video ID and URL, duration, view/like/comment counts, publish date, the date it was added to the playlist, tags, description and thumbnail. Free exports return the core fields; paid plans include the full set.
It's flatter and ready to use. The raw API returns paginated responses you'd have to stitch together and reshape. The export has already paged through the whole playlist and merged the video details into one clean array.
Yes, for your own playlists — connect YouTube with read-only access first. Public and unlisted playlists export straight from their URL.
It scales with the playlist. A few hundred videos is a small file. Free runs cover part of a very large playlist and report the count pulled; a paid plan exports the whole thing.
Yes, but it's easier to just export CSV in the first place — the tool offers both, plus Excel, XML, SQL and more, from the same run.
The takeaway
When code is the reader, JSON beats CSV — and a one-step export beats a Cloud project for anything short of a production integration. Paste the URL, pick JSON, and iterate.