Get All Photos

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

URL

GET http://{ip_address}:32400/library/sections/{id}/all?X-Plex-Token={plex_token}&{filter}

Parameters

NameDescription
ip_addressThe IP address of the Plex Media server.
plex_tokenThe Plex token.
idThe key associated with a photo library. This key can be found by calling the Libraries API command and looking for a photo library.
filterThe filter to apply to the response.

Return Status

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

Response

XML string value that lists the information for the folder of all the photos in a library. An example of the XML returned from the request is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="25" allowSync="1" art="/:/resources/photo-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="1" librarySectionTitle="Photos" librarySectionUUID="fc948ea9-3fad-45e2-99ef-b461b2d746d2" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1641342384" nocache="1" sortAsc="1" thumb="/:/resources/photo.png" title1="Photos" title2="All Photos" viewGroup="photo" viewMode="458810">
<Directory ratingKey="3663" key="/library/metadata/3663/children" guid="local://3663" type="photo" title="2002" summary="" index="1" composite="/library/metadata/3663/composite/1611751196" thumb="/library/metadata/3663/thumb/1611751196" art="/library/metadata/3663/art/1611751196" addedAt="1430260593" updatedAt="1611751196"></Directory>
    ...
</MediaContainer>

The XML returned provides a list of the all photos 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 photos on the server.

MediaContainer Attributes
AttributeDescription
sizeThe number of libraries.
allowSync1 - allow syncing content.
0 - don't allow syncing content.
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.
sortAsc1 - the library is sorted in ascending order.
0 - the library is sorted in descending order.
thumbThe thumbnail for the library.
title1The title of the library.
Note: This appears to be internally created, and can't be changed by the server owner.
title2A descriptive title for the library.
viewGroupThe group type used to view the library.
viewModeUnknown integer value.

The size attribute represents the number of photo folders that are available in the library.

Within the MediaContainer there are one or more Directory child elements. Each Directory element represents one photo folder that has been associated with the Plex server.

Directory Attributes
AttributeDescription
ratingKeyA key associated with the photo folder.
keyThe relative URL of the information for the photo folder.
guidThe unique identifier for the photo folder.
typeThe type of item represented by this Directory element.
titleThe name of the photo folder.
summaryInformation about the photo folder.
indexUnknown.
compositeThe composite image associated with the photo folder.
thumbThe thumbnail for the photo folder.
artThe background artwork used to represent the photo folder.
addedAtThe date and time the photo folder was added to the library.
updatedAtThe date and time the photo folder was updated in the library.

Remarks

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.

Examples

curl -X GET http://{ip_address}:32400/library/sections/{id}/all?X-Plex-Token={plex_token}
import requests
plex_url = http://{ip_address}:32400/library/sections/{id}/all?X-Plex-Token={plex_token}
response = requests.get(plex_url)
print(response.text)
$response = Invoke-RestMethod 'http://{ip_address}:32400/library/sections/{id}/all?X-Plex-Token={plex_token}' -Method 'GET'
Write-Output $response
Subscribe
Display