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
Name | Description |
---|---|
ip_address | The IP address of the Plex Media server. |
plex_token | The Plex token. |
id | The 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 Code | Description |
---|---|
200 | Success - The request was successful. |
401 | Unauthorized - 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.
Attribute | Description |
---|---|
size | The number of libraries. |
allowSync | 1 - allow syncing content. 0 - don't allow syncing content. |
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. |
nocache | 1 - cache the library. 0 - do not cache the library. |
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. |
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.
Attribute | Description |
---|---|
ratingKey | A key associated with the music artist. |
key | The relative URL of the information for the music artist. |
guid | The unique identifier for the music artist. |
type | The type of item represented by this Directory element. |
title | The name of the music artist. |
summary | Information about the music artist. |
index | Unknown. |
lastViewedAt | The date and time the music artist was last viewed. |
thumb | The thumbnail for the music artist. |
art | The background artwork used to represent the music artist. |
addedAt | The date and time the music artist was added to the library. |
updatedAt | The 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.
Attribute | Description |
---|---|
tag | A genre of the music artist. |
Attribute | Description |
---|---|
tag | A 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