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
Get library specific hubs
This endpoint will return a list of library specific hubs
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.Hubs.GetLibraryHubsAsync(
sectionId: 6728.76D,
count: 639.24D,
onlyTransient: QueryParamOnlyTransient.One
);
// handle response
{
"MediaContainer": {
"size": 7,
"allowSync": true,
"identifier": "com.plexapp.plugins.library",
"librarySectionID": 1,
"librarySectionTitle": "Movies",
"librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30",
"Hub": [
{
"key": "/library/sections/1/all?sort=lastViewedAt:desc&unwatched=0&viewOffset=0",
"title": "Recently Played Movies",
"type": "movie",
"hubIdentifier": "movie.recentlyviewed.1",
"context": "hub.movie.recentlyviewed",
"size": 6,
"more": true,
"style": "shelf",
"hubKey": "/library/metadata/66485,66098,57249,11449,5858,14944",
"Metadata": [
{
"ratingKey": "14944",
"key": "/library/metadata/14944",
"guid": "plex://movie/5d77686eeb5d26001f1eb339",
"studio": "Walt Disney Animation Studios",
"type": "movie",
"title": "Tangled",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG",
"summary": "The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is.",
"rating": 8.9,
"audienceRating": 8.7,
"viewCount": 1,
"lastViewedAt": 1704936047,
"year": 2010,
"tagline": "They're taking adventure to new lengths.",
"thumb": "/library/metadata/14944/thumb/1705739847",
"art": "/library/metadata/14944/art/1705739847",
"duration": 6017237,
"originallyAvailableAt": "2010-11-24T00:00:00.000Z",
"addedAt": 1589412494,
"updatedAt": 1705739847,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"primaryExtraKey": "/library/metadata/14952",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 38247,
"duration": 6017237,
"bitrate": 2051,
"width": 1920,
"height": 1080,
"aspectRatio": 1.78,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 1,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 38247,
"key": "/library/parts/38247/1589412494/file.mp4",
"duration": 6017237,
"file": "/movies/Tangled (2010)/Tangled (2010) Bluray-1080p.mp4",
"size": 1545647447,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Animation"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Nathan Greno"
}
],
"Role": [
{
"tag": "Donna Murphy"
}
],
"Writer": [
{
"tag": "Wilhelm Grimm"
}
],
"skipCount": 1,
"chapterSource": "media"
}
],
"promoted": true,
"random": true
}
]
}
}
Authorizations
Plex Authentication Token
Path Parameters
the Id of the library to query
Query Parameters
The number of items to return with each hub.
Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
0
, 1
Response
7
true
"com.plexapp.plugins.library"
1
"Movies"
"322a231a-b7f7-49f5-920f-14c61199cd30"
"/library/sections/1/all?sort=lastViewedAt:desc&unwatched=0&viewOffset=0"
"Recently Played Movies"
"movie"
"movie.recentlyviewed.1"
"hub.movie.recentlyviewed"
6
true
"shelf"
"/library/metadata/66485,66098,57249,11449,5858,14944"
"14944"
"/library/metadata/14944"
"plex://movie/5d77686eeb5d26001f1eb339"
"Walt Disney Animation Studios"
"movie"
"Tangled"
"Movies"
1
"/library/sections/1"
"PG"
"The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is."
8.9
8.7
1
1704936047
2010
"They're taking adventure to new lengths."
"/library/metadata/14944/thumb/1705739847"
"/library/metadata/14944/art/1705739847"
6017237
"2010-11-24T00:00:00.000Z"
1589412494
1705739847
"rottentomatoes://image.rating.upright"
"/library/metadata/14952"
"rottentomatoes://image.rating.ripe"
38247
6017237
2051
1920
1080
1.78
2
"aac"
"h264"
"1080"
"mp4"
"24p"
1
"lc"
false
"high"
"Animation"
"United States of America"
"Nathan Greno"
"Donna Murphy"
"Wilhelm Grimm"
1
"media"
true
true
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.Hubs.GetLibraryHubsAsync(
sectionId: 6728.76D,
count: 639.24D,
onlyTransient: QueryParamOnlyTransient.One
);
// handle response
{
"MediaContainer": {
"size": 7,
"allowSync": true,
"identifier": "com.plexapp.plugins.library",
"librarySectionID": 1,
"librarySectionTitle": "Movies",
"librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30",
"Hub": [
{
"key": "/library/sections/1/all?sort=lastViewedAt:desc&unwatched=0&viewOffset=0",
"title": "Recently Played Movies",
"type": "movie",
"hubIdentifier": "movie.recentlyviewed.1",
"context": "hub.movie.recentlyviewed",
"size": 6,
"more": true,
"style": "shelf",
"hubKey": "/library/metadata/66485,66098,57249,11449,5858,14944",
"Metadata": [
{
"ratingKey": "14944",
"key": "/library/metadata/14944",
"guid": "plex://movie/5d77686eeb5d26001f1eb339",
"studio": "Walt Disney Animation Studios",
"type": "movie",
"title": "Tangled",
"librarySectionTitle": "Movies",
"librarySectionID": 1,
"librarySectionKey": "/library/sections/1",
"contentRating": "PG",
"summary": "The magically long-haired Rapunzel has spent her entire life in a tower, but now that a runaway thief has stumbled upon her, she is about to discover the world for the first time, and who she really is.",
"rating": 8.9,
"audienceRating": 8.7,
"viewCount": 1,
"lastViewedAt": 1704936047,
"year": 2010,
"tagline": "They're taking adventure to new lengths.",
"thumb": "/library/metadata/14944/thumb/1705739847",
"art": "/library/metadata/14944/art/1705739847",
"duration": 6017237,
"originallyAvailableAt": "2010-11-24T00:00:00.000Z",
"addedAt": 1589412494,
"updatedAt": 1705739847,
"audienceRatingImage": "rottentomatoes://image.rating.upright",
"primaryExtraKey": "/library/metadata/14952",
"ratingImage": "rottentomatoes://image.rating.ripe",
"Media": [
{
"id": 38247,
"duration": 6017237,
"bitrate": 2051,
"width": 1920,
"height": 1080,
"aspectRatio": 1.78,
"audioChannels": 2,
"audioCodec": "aac",
"videoCodec": "h264",
"videoResolution": "1080",
"container": "mp4",
"videoFrameRate": "24p",
"optimizedForStreaming": 1,
"audioProfile": "lc",
"has64bitOffsets": false,
"videoProfile": "high",
"Part": [
{
"id": 38247,
"key": "/library/parts/38247/1589412494/file.mp4",
"duration": 6017237,
"file": "/movies/Tangled (2010)/Tangled (2010) Bluray-1080p.mp4",
"size": 1545647447,
"audioProfile": "lc",
"container": "mp4",
"has64bitOffsets": false,
"optimizedForStreaming": true,
"videoProfile": "high"
}
]
}
],
"Genre": [
{
"tag": "Animation"
}
],
"Country": [
{
"tag": "United States of America"
}
],
"Director": [
{
"tag": "Nathan Greno"
}
],
"Role": [
{
"tag": "Donna Murphy"
}
],
"Writer": [
{
"tag": "Wilhelm Grimm"
}
],
"skipCount": 1,
"chapterSource": "media"
}
],
"promoted": true,
"random": true
}
]
}
}