YepAPI
YouTube API

Playlist

Get playlist details and all videos in a YouTube playlist.

POST/v1/youtube/playlist
$0.01/call

Usage

const res = await fetch('https://api.yepapi.com/v1/youtube/playlist', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ id: 'PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf' }),
});
const { data } = await res.json();
console.log(data.meta, data.data);
curl -X POST https://api.yepapi.com/v1/youtube/playlist \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id": "PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf"}'

Request Body

ParameterTypeRequiredDescriptionDefault
idstringYesYouTube playlist ID
tokenstringNoContinuation token for pagination

Response

{
  "ok": true,
  "data": {
    "meta": {
      "playlistId": "PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",
      "title": "Coding Challenges",
      "channelTitle": "The Coding Train",
      "channelId": "UCvjgXvBlbQiydffZU7m1_aw",
      "channelHandle": "@TheCodingTrain",
      "description": "Is it the gravy train or a train wreck? Watch me take on some viewer submitted coding projects!",
      "videoCount": 245,
      "videoCountText": "245 videos",
      "viewCount": 2704837,
      "viewCountText": "2,704,837 views",
      "lastUpdated": "Last updated on Aug 18, 2024"
    },
    "continuation": "4qmF...",
    "data": [
      {
        "videoId": "17WoOqgXsRM",
        "title": "Coding Challenge 1: Starfield Simulation",
        "channelTitle": "The Coding Train",
        "channelId": "UCvjgXvBlbQiydffZU7m1_aw",
        "channelHandle": "@TheCodingTrain",
        "index": "1",
        "isPlayable": true,
        "lengthSeconds": "834",
        "lengthText": "13:54",
        "viewCount": 1300000,
        "viewCountText": "1.3M views",
        "videoInfo": "1.3M views \u2022 10 years ago",
        "publishDate": "2016-04-13",
        "publishedAt": "2016-04-13T00:00:00Z",
        "publishedTimeText": "10 years ago",
        "thumbnail": [
          { "url": "https://i.ytimg.com/vi/17WoOqgXsRM/hqdefault.jpg", "width": 168, "height": 94 }
        ]
      }
    ]
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
data.metaobjectPlaylist metadata
data.meta.playlistIdstringUnique YouTube playlist identifier
data.meta.titlestringPlaylist title
data.meta.channelTitlestringName of the channel that created the playlist
data.meta.channelIdstringChannel ID of the playlist creator
data.meta.channelHandlestringChannel handle (e.g. @TheCodingTrain)
data.meta.descriptionstringPlaylist description text
data.meta.videoCountnumberTotal number of videos in the playlist
data.meta.videoCountTextstringFormatted video count (e.g. 245 videos)
data.meta.viewCountnumberTotal view count across all playlist videos
data.meta.viewCountTextstringFormatted view count (e.g. 2,704,837 views)
data.meta.lastUpdatedstringWhen the playlist was last updated
data.continuationstringToken to fetch the next page of playlist videos
data.dataobject[]Array of playlist video objects
data.data[].videoIdstringUnique YouTube video identifier
data.data[].titlestringVideo title as displayed on YouTube
data.data[].channelTitlestringName of the video's channel
data.data[].channelIdstringChannel ID of the video uploader
data.data[].indexstringPosition of the video within the playlist
data.data[].isPlayablebooleanWhether the video is currently playable
data.data[].lengthSecondsstringVideo duration in seconds
data.data[].lengthTextstringVideo duration in H:MM:SS or MM:SS format
data.data[].viewCountnumberTotal view count for this video
data.data[].viewCountTextstringFormatted view count (e.g. 1.3M views)
data.data[].videoInfostringCombined view count and publish time (e.g. 1.3M views * 10 years ago)
data.data[].publishDatestringPublish date in YYYY-MM-DD format
data.data[].publishedAtstringPublish date as ISO 8601 timestamp
data.data[].publishedTimeTextstringRelative publish time (e.g. 10 years ago)
data.data[].thumbnailobject[]Video thumbnail images at various resolutions

Use the continuation token from the response to paginate through large playlists.

On this page