Plex.tv - Get a Server

A Plex account can have multiple Plex servers associated with it. This API request will return some information on a single server associated with a Plex account.

URL

GET https://plex.tv/api/servers/{machine_identifier}?X-Plex-Token={plex_token}

Parameters

NameDescription
plex_tokenThe Plex token.
machine_identifierThe ProcessedMachineIdentifier for the Plex server. You can get this identifier from the Plex advanced settings.

Return Status

HTTP CodeDescription
200Success - The request was successful.
401Unauthorized - The Plex token provided was not valid or was not provided.
404Not Found - The server associated with the machine identifier does not exist.

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="c080de7e0168d1da7027f8b218adb769bd1d6c6c" size="4">
    <Server name="MyPlexServer" address="XXX.XXX.XXX.XXX" port="32401" version="1.30.2.6563-3d4dc0cce" scheme="http" host="XXX.XXX.XXX.XXX" localAddresses="192.168.1.100" machineIdentifier="93c418a691854d3be47ead674134d86a3f5e00f4" createdAt="1690834837" updatedAt="1722366657" owned="1" synced="0">
        <Section id="XXXXXXXXX" key="2" type="movie" title="Movies"/>
        <Section id="XXXXXXXXX" key="1" type="artist" title="Music"/>
        <Section id="XXXXXXXXX" key="22" type="photo" title="Photos"/>
        <Section id="XXXXXXXXX" key="8" type="show" title="TV Shows"/>
    </Server>
</MediaContainer>

The XML returned provides information about a server associated with a Plex account. The root is the MediaContainer element. This element contains several attributes for the server.

MediaContainer Attributes
AttributeDescription
friendlyNameThe name of the Plex server.
identifierThe type of item.
machineIdentifierUnique identifier for the server.
sizeThe number of media sections available on the server.

Within the MediaContainer is a Server element that contains information about the server.

Server Attributes
AttributeDescription
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.

Each library section available on the server is represented by one Section element within the Server element.

Section Attributes
AttributeDescription
idThe identifier for the section.
keyThe key for the section.
typeThe type of section.
titleThe title of the section.

Examples

curl -X GET https://plex.tv/api/servers/{machine_identifier}?X-Plex-Token={plex_token}
import requests
plex_url = https://plex.tv/api/servers/{machine_identifier}?X-Plex-Token={plex_token}

response = requests.get(plex_url)

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

Write-Output $response
Subscribe
Display