Get All Music Albums for an Artist

A music artist can have one or more albums associated with them This API command will return all of the albums from the Plex server that are associated with an artist.

URL

GET http://{ip_address}:32400/library/sections/{library_id/all?artist.id={artist_id}&type=9&X-Plex-Token={plex_token}&includeGuids={include_guids}

Parameters

NameDescription
ip_addressThe IP address of the Plex Media server.
plex_tokenThe Plex token.
library_idThe key associated with a music library. This key can be found by calling the Libraries API command and looking for a music library.
artist_idThe key associated with the music artist. This key can be found by calling the Get All Music Artists API command and using the ratingKey attribute associated with the artist.
include_guids(Optional) Returns the GUID values of the online metadata services associated to the media item.

Return Status

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

Response

XML string value that lists all the albums for the music artists in the library. An example of the XML returned from the request is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="1" allowSync="1" art="/:/resources/artist-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="8" librarySectionTitle="Music" librarySectionUUID="b6031749-2969-4027-afee-64172b72b77d" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1682076900" nocache="1" thumb="/:/resources/artist.png" title1="Music" title2="All Artists" viewGroup="artist" viewMode="65592">
    <Directory ratingKey="218549" key="/library/metadata/218549/children" parentRatingKey="218548" guid="plex://album/5d07c182403c64029084e584" parentGuid="plex://artist/5d07bbfd403c6402904a6593" studio="Polydor" type="album" title="Gold: Greatest Hits" parentKey="/library/metadata/218548" parentTitle="ABBA" summary="ABBA's 19-song Gold collection was the first hits compilation prepared specifically for the CD format by the 1970s supergroup, and, appearing after a period of several years in which their music had been off the market, was a welcome addition to the catalog. It is still the simplest and most straightforward collection of the group's material that it is possible to buy. ~ Bruce Eder" index="1" rating="10.0" lastViewedAt="1646942889" year="1992" thumb="/library/metadata/218549/thumb/1685475601" art="/library/metadata/218548/art/1685475583" parentThumb="/library/metadata/218548/thumb/1685475583" originallyAvailableAt="1992-09-21" addedAt="1598373482" updatedAt="1685475601" loudnessAnalysisVersion="2" musicAnalysisVersion="1">
        <Genre tag="Pop/Rock" />
    </Directory>
    ...
</MediaContainer>

The XML returned provides a list of the all the albums associated with a music artist 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 albums on the server.

MediaContainer Attributes
AttributeDescription
sizeThe number of albums.
allowSync1 - allow syncing content.
0 - don't allow syncing content.
artBackground artwork used to represent the album.
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 album.
title1The title of the album.
Note: This appears to be internally created, and can't be changed by the server owner.
title2A descriptive title for the album.
viewGroupThe group type used to view the album.
viewModeUnknown integer value.

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

Directory Attributes
AttributeDescription
ratingKeyA key associated with the album.
keyThe relative URL of the information for the album.
parentRatingKeyA key associated with the artist.
guidThe unique identifier for the album.
parentGuidThe unique identifier associated with the artist.
studioThe name of the studio that created the album.
typeThe type of item represented by this Directory element.
titleThe name of the album.
parentKeyThe key associated with the artist.
parentTitleThe title associated with the artist.
summaryInformation about the album.
indexUnknown.
ratingThe rating for the album.
lastViewedAtThe date and time the album was last viewed.
yearThe year the album was released.
thumbThe thumbnail for the album.
artThe background artwork used to represent the album.
parentThumbThe studio associated with the artist.
originallyAvailableAtThe original release date of the album.
addedAtThe date and time the album was added to the library.
updatedAtThe date and time the album was updated in the library.
loudnessAnalysisVersionThe version of the loudness analyzer used.
musicAnalysisVersionThe version of the music analyzer used.

Also within the Directory element there are one or more Genre child elements that describes the genre of the albums. .

Within each of these child elements is a single tag attribute that provides the information for the element.

Genre Attributes
AttributeDescription
tagA genre of the album.

If the include_guids parameter was specified with the value of 1, then there would be a Guid element for each online metadata service associated with the item.

Examples

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