Get All TV Shows

A library, such as movies or TV shows, can contain many items. This API command will return all TV shows for a specific library that is available on the Plex server.


GET http://[IP address]:32400/library/sections/[TV Shows Library ID]/all?X-Plex-Token=[PlexToken]


IP addressThe IP address of the Plex Media server.
PlexTokenThe temporary authentication Plex token.
TV Shows Library IDThe key associated with a TV shows library. This key can be found by calling the Libraries API command and looking for a TV shows library.

Return Status

HTTP CodeDescription
200Success - The request was successful.
401Unauthorized - The Plex token provided was not valid.


XML string value that lists the all the TV shows in the library. An example of the XML returned from the request is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="11" allowSync="1" art="/:/resources/show-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="4" librarySectionTitle="TV Shows" librarySectionUUID="3bbbe6f7-628f-4983-ae5d-7c05779c4c28" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1641342384" nocache="1" thumb="/:/resources/show.png" title1="TV Shows" title2="All Shows" viewGroup="show" viewMode="65592">
    <Directory ratingKey="1161" key="/library/metadata/1161/children" guid="com.plexapp.agents.thetvdb://74205?lang=en" studio="HBO" type="show" title="Band of Brothers" contentRating="TV-MA" summary="The miniseries follows Easy Company, an army unit during World War II, from their initial training at Camp Toccoa to the conclusion of the war. The series is based on the book written by the late Stephen E. Ambrose. Band of Brothers is executive produced by Steven Spielberg and Tom Hanks, the series won 6 Emmy Awards. " index="1" rating="9.5" viewCount="14" lastViewedAt="1468515134" year="2001" thumb="/library/metadata/1161/thumb/1487294876" art="/library/metadata/1161/art/1487294876" banner="/library/metadata/1161/banner/1487294876" theme="/library/metadata/1161/theme/1487294876" duration="3600000" originallyAvailableAt="2001-09-09" leafCount="10" viewedLeafCount="10" childCount="1" addedAt="1420683142" updatedAt="1487294876">
        <Genre tag="Action" />
        <Genre tag="Adventure" />
        <Role tag="Ron Livingston" />
        <Role tag="Damian Lewis" />
        <Role tag="Matthew Settle" />


The XML returned provides a list of the all TV shows in a library that are available on the Plex server. The root is the MediaContainer element. This element contains a few attributes that provide overall information about the TV shows on the server.

MediaContainer Attributes for TV Shows
sizeThe number of TV shows in the library.
allowSync1 - allow syncing content from this library.
0 - don't allow syncing content from this library.
artBackground artwork used to represent the library.
identifierThe type of item.
librarySectionIDThe unique key associated with the library.
librarySectionTitleThe title of the library.
librarySectionUUIDUnique GUID identifier for the library.
mediaTagPrefixPrefix for the media tag.
mediaTagVersionMedia tag version.
Note: This could be a date and time value.
nocache1 - cache the library.
0 - do not cache the library.
thumbThe thumbnail for the library.
title1The title of the library item.
Note: This appears to be internally created, and can't be changed by the server owner.
title2A description title for the library.
viewGroupThe group type used to view the library.
viewModeUnknown integer value.

Within the MediaContainer there are one or more Directory child elements. Each Directory element represents one TV show series available on the Plex server.

Directory Attributes
ratingKeyA key associated with the TV show.
keyThe relative URL of the TV show information.
guidThe unique identifier comprised of the Plex agent and TV show identifier for the agent.
studioThe name of the studio that create the TV show.
titleThe title of the TV show.
contentRatingThe content rating associated with the TV show.
summaryA summary of the TV show.
ratingThe rating for the TV show.
viewCountThe number of times the TV show was viewed.
lastViewedAtThe date and time the show was last viewed.
yearThe year the TV show was released.
thumbThe thumbnail for the TV show.
artThe background artwork used to represent the TV show.
bannerThe banner artwork use to represent the TV show.
themeThe musical theme for the TV Show.
durationThe length of the TV show in milliseconds.
originallyAvailableAtThe original release date of the TV show.
leafCountThe number of items in the TV show.
viewedLeafCountThe number of the TV show items that have been viewed.
childCountThe number of child items.
addedAtThe date and time the TV show was added to the library.
updatedAtThe date and time the TV show was updated in the library.

Also within the Directory element there are multiple additional child elements that provide more details about the TV show. These child elements include Genre and Role.

Within each of these child elements is a single tag attribute that provides the information for the element. There could be multiple of the same child element within the Directory, as each TV show can be in multiple genres and list multiple actors.


Example 1

Get the list of all TV shows from the library associated with ID 4 on the Plex Media Server located at the IP address of