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.
GET http://[IP address]:32400/library/sections/[Music Library ID]/all?X-Plex-Token=[PlexToken]&[Filter]
|IP address||The IP address of the Plex Media server.|
|PlexToken||The authentication Plex token.|
|Music Library 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.|
|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 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.
|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.
|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.|
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..
|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 |
|title||The name of the music artist.|
|summary||Information about the music artist.|
|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
Within each of these child elements is a single
tag attribute that provides the information for the element.
|tag||A genre of the music artist.|
|tag||A country of origin for the music artist.|
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 music artists from the library associated with ID 8 on the Plex Media Server located at the IP address of 192.168.1.4: