Get All Music Artists

A library, such as movies or TV shows, can contain many items. This API command will return all music artists 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}&includeGuids={include_guids}&limit={limit}&{filter}

Parameters

NameDescription
ip_addressThe IP address of the Plex Media server.
plex_tokenThe Plex token.
idThe key associated with a music library. This key can be found by calling the Libraries API command and looking for a music library.
include_guids(Optional) Returns the GUID values of the online metadata services associated to the media item.
limit(Optional) This parameter is an integer that indicates how many items to return in the response.
filter(Optional) The 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 all 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="99" allowSync="1" art="/:/resources/artist-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="9" librarySectionTitle="Music" librarySectionUUID="c68ad90f-dd6d-4ef7-82c9-a7a9b3e1193c" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1641342384" nocache="1" thumb="/:/resources/artist.png" title1="Music" title2="All Artists" viewGroup="artist" viewMode="65592">
    <Directory ratingKey="56654" key="/library/metadata/56654/children" guid="plex://artist/5d07bbfd403c6402904a6593" type="artist" title="ABBA" summary="The most commercially successful pop group of the 1970s, ABBA put Sweden on the map as a music mecca and influenced the sound of pop for decades to come. With their flamboyant fashion sense and two-couple membership, ..." art="/library/metadata/56654/art/1641034561" addedAt="1430697022" updatedAt="1641034561">
        <Genre tag="Pop/Rock" />
        <Country tag="Sweden" />
    </Directory>
    ...
</MediaContainer>

The XML returned provides a list of the all music artists 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 music artist 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.
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.

Within the MediaContainer there are one or more Directory child elements. Each Directory element represents one music artist available on the Plex server, which also represents a single artist folder on the server.

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

Also within the Directory element there are multiple additional child elements that provide more details about the music artist. These child elements include Genre and Country.

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 music artist.
Country Attributes
AttributeDescription
tagA country of origin for the music artist.

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.

Remarks

The limit can be used to specify the number of items to return in the response.

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