Get All Movies
A library, such as movies or TV shows, can contain many items. This API command will return all movies for a specific library that is available on the Plex server.
GET http://[IP address]:32400/library/sections/[Movies Library ID]/all?X-Plex-Token=[PlexToken]&[Filter]
|IP address||The IP address of the Plex Media server.|
|PlexToken||The authentication Plex token.|
|Movies Library ID||The key associated with a movies library. This key can be found by calling the Libraries API command and looking for a movies library.|
|Filter||The filter to apply to the response.|
|200||Success - The request was successful.|
|401||Unauthorized - The Plex token provided was not valid.|
XML string value that lists the all the movies in the library. An example of the XML returned from the request is shown below:
<?xml version="1.0" encoding="UTF-8"?> <MediaContainer size="217" allowSync="1" art="/:/resources/movie-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="Movies" librarySectionUUID="493a64e7-b541-4667-b050-d702beebf2f6" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1641342384" sortAsc="1" thumb="/:/resources/movie.png" title1="Movies" title2="All Movies" viewGroup="movie" viewMode="131624"> <Video ratingKey="65547" key="/library/metadata/65547" guid="com.plexapp.agents.imdb://tt0103639?lang=en" studio="Walt Disney Pictures" type="movie" title="Aladdin" contentRating="G" summary="Princess Jasmine grows tired of being forced to remain in the palace, so she sneaks out into the marketplace, in disguise, where she meets street-urchin Aladdin. The couple falls in love, although Jasmine may only marry a prince. After being thrown in jail, Aladdin becomes embroiled in a plot to find a mysterious lamp, with which the evil Jafar hopes to rule the land." rating="9.5" audienceRating="9.2" skipCount="1" year="1992" tagline="Wish granted!" thumb="/library/metadata/65547/thumb/1607616868" art="/library/metadata/65547/art/1607616868" duration="5423772" originallyAvailableAt="1992-11-25" addedAt="1450147195" updatedAt="1607616868" audienceRatingImage="rottentomatoes://image.rating.upright" chapterSource="mixed" ratingImage="rottentomatoes://image.rating.ripe"> <Media id="73681" duration="5423772" bitrate="2412" videoProfile="high"> <Part id="73812" key="/library/parts/73812/1450141780/file.mkv" duration="5423772" file="M:\Media\Movies\Aladdin (1992)\Aladdin (1992) [480p h.264][AAC AC3].mkv" size="1639520577" container="mkv" videoProfile="high" /> </Media> <Genre tag="Animation" /> <Genre tag="Adventure" /> <Director tag="Ron Clements" /> <Director tag="John Musker" /> <Writer tag="Ted Elliott" /> <Writer tag="Terry Rossio" /> <Country tag="USA" /> <Collection tag="Disney" /> <Role tag="Scott Weinger" /> <Role tag="Robin Williams" /> <Role tag="Linda Larkin" /> </Video> ... </MediaContainer>
The XML returned provides a list of the all movies 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 movies on the server.
|size||The number of libraries.|
|allowSync||1 - allow syncing content from this library.|
0 - don't allow syncing content from this library.
|art||Background artwork used to represent the library.|
|identifier||The type of item.|
|librarySectionID||The unique key associated with the library.|
|librarySectionTitle||The title of the library.|
|librarySectionUUID||Unique GUID identifier for the library.|
|mediaTagPrefix||Prefix for the media tag.|
|mediaTagVersion||Media tag version.|
Note: This could be a date and time value.
|sortAsc||1 - the library is sorted in ascending order.|
0 - the library is sorted in descending order.
|thumb||The thumbnail for the library.|
|title1||The title of the library.|
Note: This appears to be internally created, and can't be changed by the server owner.
|title2||A descriptive title for the library.|
|viewGroup||The group type used to view the library.|
|viewMode||Unknown integer value.|
MediaContainer there are one or more
Video child elements. Each
Video element represents one movie available on the Plex server.
|ratingKey||A key associated with the item.|
|key||The relative URL of the item information.|
|guid||The unique identifier comprised of the Plex agent and item identifier for the agent.|
|studio||The name of the item studio.|
|type||The type of media.|
|title||The title of the item.|
|contentRating||The content rating associated with the item.|
|summary||A summary of the item.|
|rating||The rating for the item.|
|audienceRating||The audience rating for the item.|
|skipCount||The skip count.|
|year||The year the item was released.|
|tagline||The tagline associated with the item.|
|thumb||The thumbnail for the item.|
|art||The background artwork used to represent the item.|
|duration||The length of the item in milliseconds.|
|originallyAvailableAt||The original release date of the item.|
|addedAt||The date and time, in Unix time, the item was added to the library.|
|updatedAt||The date and time in Unix time, the item was updated in the library.|
|audienceRatingImage||The image associated with the audience rating.|
|chapterSource||The chapter source type.|
|ratingImage||The image associated with the rating.|
Video there are one or more
Media child elements. Each
Media element represents one media file of the movie available on the Plex server.
If there are two media files associated with the movie, such as a 1080p and 480p version, then there would be two
Media child elements in the
|id||Unique ID associated with the item.|
|duration||The length of the item in milliseconds.|
|bitrate||The bitrate of the item.|
|videoProfile||The video profile of the media.|
Media there are one or more
Part child elements. Each
Part element represents one part of the movie. If the movie has been added to the Plex server as a multi-part movie, then each of those parts will be represented by one
Part child element.
|id||Unique ID associated with the part.|
|key||The unique relative path for the part that is used at its key.|
|duration||The length of the part in milliseconds.|
|file||The file associated with the part.|
|size||The file size of the part.|
|container||The type of media container.|
|videoProfile||The video profile associated with the video part.|
Also within the
Video element there are multiple additional child elements that provide more details about the movie. These child elements include
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
Video, such as multiple directors or writers.
|tag||A genre of the movie.|
|tag||A director of the movie.|
|tag||A writer for the movie|
|tag||A country of origin for the movie.|
|tag||The name of a collection containing the movie.|
|tag||The name of a person with a role in the movie.|
To reduce the number of items returned, you can filter the API response to only return items that meet a specific criteria.
For more information, check out the Filter page.
Get the list of all movies from the library associated with ID 2 on the Plex Media Server located at the IP address of 192.168.1.4: