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 Genres of library media
Retrieves a list of all the genres that are found for the media in this library.
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->library->getGenresLibrary(
sectionKey: 9518,
type: Operations\GetGenresLibraryQueryParamType::TvShow
);
if ($response->object !== null) {
// handle response
}
{
"MediaContainer": {
"size": 50,
"allowSync": false,
"art": "/:/resources/show-fanart.jpg",
"content": "secondary",
"identifier": "com.plexapp.plugins.library",
"mediaTagPrefix": "/system/bundle/media/flags/",
"mediaTagVersion": 1734362201,
"nocache": true,
"thumb": "/:/resources/show.png",
"title1": "TV Series",
"title2": "By Starring Actor",
"viewGroup": "secondary",
"Directory": [
{
"fastKey": "/library/sections/10/all?genre=89",
"key": "89",
"title": "Action",
"type": "genre"
}
]
}
}
Authorizations
Plex Authentication Token
Headers
application/json
, application/xml
"application/json"
Path Parameters
The unique key of the Plex library. Note: This is unique in the context of the Plex server.
9518
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
Number of media items returned in this response.
50
Indicates whether syncing is allowed.
false
URL for the background artwork of the media container.
"/:/resources/show-fanart.jpg"
The content type or mode.
"secondary"
An plugin identifier for the media container.
"com.plexapp.plugins.library"
The prefix used for media tag resource paths.
"/system/bundle/media/flags/"
The version number for media tags.
1734362201
Specifies whether caching is disabled.
true
URL for the thumbnail image of the media container.
"/:/resources/show.png"
The primary title of the media container.
"TV Series"
The secondary title of the media container.
"By Starring Actor"
Identifier for the view group layout.
"secondary"
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->library->getGenresLibrary(
sectionKey: 9518,
type: Operations\GetGenresLibraryQueryParamType::TvShow
);
if ($response->object !== null) {
// handle response
}
{
"MediaContainer": {
"size": 50,
"allowSync": false,
"art": "/:/resources/show-fanart.jpg",
"content": "secondary",
"identifier": "com.plexapp.plugins.library",
"mediaTagPrefix": "/system/bundle/media/flags/",
"mediaTagVersion": 1734362201,
"nocache": true,
"thumb": "/:/resources/show.png",
"title1": "TV Series",
"title2": "By Starring Actor",
"viewGroup": "secondary",
"Directory": [
{
"fastKey": "/library/sections/10/all?genre=89",
"key": "89",
"title": "Action",
"type": "genre"
}
]
}
}