Server
Media
Butler
Plex
Library
- GETGet Hash Value
- GETGet Recently Added
- GETGet All Libraries
- GETGet library details
- DELDelete library section
- GETGet library items
- GETGet all media of library
- GETRefresh Metadata Of The Library
- GETSearch library
- GETGet Genres of library media
- GETGet Countries of library media
- GETGet Actors of library media
- GETSearch All Libraries
- GETGet Media Metadata
- GETGet Items Children
- GETGet Top Watched Content
- GETGet On Deck
Watchlist
Playlists
Authentication
Sessions
Retrieve Playlist Contents
Gets the contents of a playlist. Should be paged by clients via standard mechanisms.
By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the type
parameter.
For example, you could use this to display a list of recently added albums vis a smart playlist.
Note that for dumb playlists, items have a playlistItemID
attribute which is used for deleting or moving items.
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;
var sdk = new PlexAPI(accessToken: "<YOUR_API_KEY_HERE>");
var res = await sdk.Playlists.GetPlaylistContentsAsync(
playlistID: 5004.46D,
type: GetPlaylistContentsQueryParamType.TvShow
);
// handle response
{
"MediaContainer": {
"size": 2,
"composite": "/playlists/95/composite/1705717521",
"duration": 282,
"leafCount": 2,
"playlistType": "video",
"ratingKey": "95",
"smart": true,
"title": "Smart Movie Playlist",
"Metadata": [
{
"ratingKey": "17",
"key": "/library/metadata/17",
"guid": "plex://movie/5d77683f6f4521001ea9dc53",
"studio": "Universal Pictures",
"type": "movie",
"title": "Serenity",
"titleSort": "Amazing Spider-Man 2",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG-13",
"summary": "Serenity continues the story of the TV series it was based upon (\"Firefly\"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job.",
"rating": 8.2,
"audienceRating": 9.1,
"year": 2005,
"tagline": "They aim to misbehave.",
"thumb": "/library/metadata/17/thumb/1705637165",
"art": "/library/metadata/17/art/1705637165",
"duration": 141416,
"originallyAvailableAt": "2005-09-29T00:00:00.000Z",
"addedAt": 1705637164,
"updatedAt": 1705637165,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"hasPremiumExtras": "1",
"hasPremiumPrimaryExtra": "1",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 15,
"duration": 141416,
"bitrate": 2273,
"width": 1920,
"height": 814,
"aspectRatio": 2.35,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 0,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 15,
"key": "/library/parts/15/1705637151/file.mp4",
"duration": 141416,
"file": "/movies/Serenity (2005)/Serenity (2005).mp4",
"size": 40271948,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": false,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Action"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Joss Whedon"
}
],
"Writer": [
{
"tag": "Joss Whedon"
}
],
"Role": [
{
"tag": "Gina Torres"
}
]
}
]
}
}
Authorizations
Plex Authentication Token
Path Parameters
the ID of the playlist
Query Parameters
The type of media to retrieve or filter by. 1 = movie 2 = show 3 = season 4 = episode E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
1
, 2
, 3
, 4
, 8
, 9
, 10
2
Response
2
"/playlists/95/composite/1705717521"
282
2
"video"
"95"
true
"Smart Movie Playlist"
"17"
"/library/metadata/17"
"plex://movie/5d77683f6f4521001ea9dc53"
"Universal Pictures"
"movie"
"Serenity"
"Amazing Spider-Man 2"
"Movies"
1
"/library/sections/1"
"PG-13"
"Serenity continues the story of the TV series it was based upon (\"Firefly\"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job."
8.2
9.1
2005
"They aim to misbehave."
"/library/metadata/17/thumb/1705637165"
"/library/metadata/17/art/1705637165"
141416
"2005-09-29T00:00:00.000Z"
1705637164
1705637165
"rottentomatoes://image.rating.upright"
"1"
"1"
"rottentomatoes://image.rating.ripe"
15
141416
2273
1920
814
2.35
2
"aac"
"h264"
"1080"
"mp4"
"24p"
0
"lc"
false
"high"
15
"/library/parts/15/1705637151/file.mp4"
141416
"/movies/Serenity (2005)/Serenity (2005).mp4"
40271948
"lc"
"mp4"
false
false
"high"
"United States of America"
"Joss Whedon"
"Joss Whedon"
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;
var sdk = new PlexAPI(accessToken: "<YOUR_API_KEY_HERE>");
var res = await sdk.Playlists.GetPlaylistContentsAsync(
playlistID: 5004.46D,
type: GetPlaylistContentsQueryParamType.TvShow
);
// handle response
{
"MediaContainer": {
"size": 2,
"composite": "/playlists/95/composite/1705717521",
"duration": 282,
"leafCount": 2,
"playlistType": "video",
"ratingKey": "95",
"smart": true,
"title": "Smart Movie Playlist",
"Metadata": [
{
"ratingKey": "17",
"key": "/library/metadata/17",
"guid": "plex://movie/5d77683f6f4521001ea9dc53",
"studio": "Universal Pictures",
"type": "movie",
"title": "Serenity",
"titleSort": "Amazing Spider-Man 2",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG-13",
"summary": "Serenity continues the story of the TV series it was based upon (\"Firefly\"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job.",
"rating": 8.2,
"audienceRating": 9.1,
"year": 2005,
"tagline": "They aim to misbehave.",
"thumb": "/library/metadata/17/thumb/1705637165",
"art": "/library/metadata/17/art/1705637165",
"duration": 141416,
"originallyAvailableAt": "2005-09-29T00:00:00.000Z",
"addedAt": 1705637164,
"updatedAt": 1705637165,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"hasPremiumExtras": "1",
"hasPremiumPrimaryExtra": "1",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 15,
"duration": 141416,
"bitrate": 2273,
"width": 1920,
"height": 814,
"aspectRatio": 2.35,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 0,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 15,
"key": "/library/parts/15/1705637151/file.mp4",
"duration": 141416,
"file": "/movies/Serenity (2005)/Serenity (2005).mp4",
"size": 40271948,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": false,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Action"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Joss Whedon"
}
],
"Writer": [
{
"tag": "Joss Whedon"
}
],
"Role": [
{
"tag": "Gina Torres"
}
]
}
]
}
}