Plex.tv - Get Servers

A Plex account can have multiple Plex servers associated with it. This API request will return a list of all servers for the Plex account.

URL

GET https://plex.tv/servers.xml?includeLite=1&X-Plex-Token={plex_token}

Parameters

NameDescription
plex_tokenThe Plex token.
includeLite(Optional) Gets a simple list of servers. Without this parameter, the list of servers will be limited to those that have remote access enabled.

Return Status

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

Response

XML string value that lists the servers for the associated Plex account. An example of the XML returned from the request is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer friendlyName="myPlex" identifier="com.plexapp.plugins.myplex" machineIdentifier="df3d7a630a9dde6445c90385077e981ba914876f" size="1">
    <Server accessToken="Hs2vG4eNtR7nzq1t_cGR" name="PlexServer" address="" port="0" version="1.40.4.8679-424562606" scheme="http" host="" localAddresses="XXX.XXX.XXX.XXX" machineIdentifier="fc8678129e6bdc8668b658c39820e45fbe276467" createdAt="1422640063" updatedAt="1422640063" owned="1" synced="0"/>
</MediaContainer>

The XML returned provides a list of all servers associated with a Plex account. The root is the MediaContainer element. This element contains several attributes for the servers.

MediaContainer Attributes
AttributeDescription
friendlyNameThe name of the Plex server.
identifierThe type of item.
machineIdentifierUnique identifier for the server.
sizeThe number of servers.

Within the MediaContainer there are one or more Server child elements. Each Server element represents one sever.

Server Attributes
AttributeDescription
accessTokenThe token associated with the server.
nameThe name of the server.
addressThe IP address of the server.
portThe Plex Media Server port.
versionThe version of Plex Media Server that is installed.
schemeThe scheme used to connect to the server.
hostThe host name of the server. If there is no host name associated with the server then the IP address is displayed.
localAddressesThe local addresses for the server.
machineIdentifierUnique identifier for the server.
createdAtThe timestamp when the server was created.
updatedAtThe timestamp when the server was updated.
ownedFlag indicating if the server is owned.
0 - the server is not owned.
1 - the server is owned.
syncedFlag indicating if the server is synced.
0 - the server is not synced.
1 - the server is synced.

Remarks

includeLite Parameter

This parameter is optional and will return a simple list of servers. If this parameter is excluded, then only servers with remote access enabled will be returned.

Examples

curl -X GET https://plex.tv/servers.xml?includeLite=1&X-Plex-Token={plex_token}
import requests
plex_url = https://plex.tv/servers.xml?includeLite=1&X-Plex-Token={plex_token}

response = requests.get(plex_url)

print(response.text)
$response = Invoke-RestMethod 'https://plex.tv/servers.xml?includeLite=1&X-Plex-Token={plex_token}' -Method 'GET'

Write-Output $response
Subscribe
Display