1.1.0 • Public • Published


Node.js command line app for exporting video data from a YouTube playlist to a JSON/CSV file.



This app lets you download the metadata of each video (e.g. video title, URL, uploader, and etc.) from a public/unlisted YouTube playlist and saves it to a JSON or CSV file.

🚨 This app does not download videos from a YouTube playlist. It only downloads text-based metadata of videos from a playlist.


⚠️ Requires Node v12 or higher.

  1. Install the app:

    $ npm install -g youtube-playlist-export
  2. Run the following command in Terminal to confirm that it's properly installed:

    $ ytpl-export --help
  3. Get a YouTube API v3 key for free:

  4. Run the following command and follow the on-screen instructions to register the YouTube API key:

    $ ytpl-export key


$ ytpl-export --help
Exports video data from a YouTube playlist to JSON/CSV file.

Usage: ytpl-export [options] [command]

  -V, --version              output the version number
  -h, --help                 display help for command

  id [options] <playlistId>  Export video metadata of a playlist by its playlist ID.
  key                        Manage your YouTube API key.
  config [options]           Edit configurations of this app.
  help [command]             display help for command

Export Playlist

Export a YouTube playlist given its playlist ID.

$ ytpl-export id <playlistId>

To find the playlist ID, head to the playlist homepage and copy the value of the list parameter in the URL ([playlistId]). For example, the Google Search Stories playlist has a playlist ID of PLBCF2DAC6FFB574DE.

Demo of "id" command


  • -d/--default - Skip all prompt questions and use the default configurations

Exportable Items

Item JSON/CSV Key Name
Position in the playlist¹ position
Title title
Uploader uploader
Uploader URL uploaderUrl
Description description
Video privacy videoPrivacy
Publish time (UTC) publishTime

¹ Playlist position starts from 0

Save Location

You can specify the absolute path of a folder where the files will be saved to. The default value is ~/ytpl-export. The folder will be created if it doesn't exist.

Since it requires an absolute path, here are same examples:

  • ✔️ C:\Users\User\Downloads (Windows)
  • ✔️ /usr/ytpl-export (Mac/Linux)
  • ../ytpl-export

Example Output

The app outputs the following when running ytpl-export id PLBCF2DAC6FFB574DE:

    "position": 0,
    "title": "Andrew Willis, Skatepark Engineer",
    "uploader": "Google Search Stories",
    "url": ""
    "position": 2,
    "title": "Mark Lesek: A New/Old Prosthetic",
    "uploader": "Google Search Stories",
    "url": ""
    "position": 4,
    "title": "Mark Kempton: Neighbors In Need",
    "uploader": "Google Search Stories",
    "url": ""
    "position": 5,
    "title": "Zack Matere: Growing Knowledge",
    "uploader": "Google Search Stories",
    "url": ""
    "position": 6,
    "title": "Mitch Dobrowner: Epic Storms",
    "uploader": "Google Search Stories",
    "url": ""
    "position": 7,
    "title": "The Tofino Riders: A 1,000 Year-Old-Wave",
    "uploader": "Google Search Stories",
    "url": ""
    "position": 8,
    "title": "David Kennedy: Ancient Ruins",
    "uploader": "Google Search Stories",
    "url": ""
    "position": 9,
    "title": "Caroline: Supernova 2008ha",
    "uploader": "Google Search Stories",
    "url": ""
    "position": 11,
    "title": "Erik-Jan Bos: A Letter from an Old Friend",
    "uploader": "Google Search Stories",
    "url": ""
    "position": 12,
    "title": "Cheryl and Morgan: Learning Independence",
    "uploader": "Google Search Stories",
    "url": ""
0,"Andrew Willis, Skatepark Engineer","Google Search Stories",""
2,"Mark Lesek: A New/Old Prosthetic","Google Search Stories",""
4,"Mark Kempton: Neighbors In Need","Google Search Stories",""
5,"Zack Matere: Growing Knowledge","Google Search Stories",""
6,"Mitch Dobrowner: Epic Storms","Google Search Stories",""
7,"The Tofino Riders: A 1,000 Year-Old-Wave","Google Search Stories",""
8,"David Kennedy: Ancient Ruins","Google Search Stories",""
9,"Caroline: Supernova 2008ha","Google Search Stories",""
11,"Erik-Jan Bos: A Letter from an Old Friend","Google Search Stories",""
12,"Cheryl and Morgan: Learning Independence","Google Search Stories",""


Register, modify, or delete your YouTube API key.

$ ytpl-export key

First-time users for registering YouTube API key:

Demo of "key" command for first-time users

After registering the API key:

Demo of "key" command after registered API key

✔️ Your API key will only be stored in your local computer.


Configure preferences of this app.

$ ytpl-export config

Demo of "config" command


  • -p/--path - Show the path of the where the config file is stored
  • -r/--reset - Reset all configurations to default values (see below)

Default Config

  • Items to export: Position in the playlist, Title, Uploader, URL
  • File extension: JSON
  • Save location: ~/ytpl-export
  • Notify updates: Enabled
  • Skip private/deleted videos: True



# 1. Install yarn if you haven't
$ npm install -g yarn

# 2. Install dependencies
$ yarn

# 3. Start the development server
$ yarn start

To run the app, open a new Terminal and run:

$ node dist/cli.js


All tests are written in Jest and they are located in the tests folder. To run all tests:

$ yarn test

# Alternatively, run this to generate a coverage report
$ yarn test:coverage

Note that clearMocks is set to true, which Jest will automatically clear mock calls and instances before every test.


This app uses YouTube API v3 under the hood. However, due to limitations of the API, it cannot perform the following actions:

  • Export your "Watch Later" playlist
  • Export private playlists
  • Export most metadata of deleted or private videos, such as the original video title and description
  • Download each video, not its metadata, in mp3, mp4, wmv, or other formats

Related Work

Package Sidebar


npm i youtube-playlist-export

Weekly Downloads






Unpacked Size

42.9 kB

Total Files


Last publish


  • ansonheung