Get Server List
This API command is used to get all the servers that are found on the local network. All servers, regardless if the token used has access to the server, will be returned in the list.
URL
GET http://{ip_address}:32400/servers?X-Plex-Token={plex_token}
Parameters
Name | Description |
---|---|
ip_address | The IP address of the Plex Media server. |
plex_token | The Plex token. |
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 all servers available. An example of the XML returned from the request is shown below:
<MediaContainer size="2"> <Server name="PlexServer" host="192.168.1.20" address="192.168.1.20" port="32400" machineIdentifier="426a344045c33cf5a6695a6b7fe6ced812ba41b5" version="1.30.2.6563-3d4dc0cce" /> <Server name="PlexServer2" host="192.168.1.30" address="192.168.1.30" port="32400" machineIdentifier="4b556027a56abd6dcdf72484464db7467d837430" version="1.40.1.8227-c0dd5a73e" /> </MediaContainer>
The XML returned contains a root MediaContainer
element. This element contains only a size
attribute that indicates the total number of servers in the list.
Attribute | Description |
---|---|
size | The number of servers. |
Within the MediaContainer
element there are multiple additional child elements that provide more details about each server. These child elements are listed using multiple Server
elements.
Attribute | Description |
---|---|
name | The name of the server. |
host | The host name of the server. If there is no host name associated with the server then the IP address is displayed. |
address | The IP address of the server. |
port | The Plex Media Server port. |
machineIdentifier | Unique identifier for the server. |
version | The version of Plex Media Server that is installed. |
Remarks
As mentioned above, servers that the token used in this command can't access will be returned in the response.
Examples
curl -X GET http://{ip_address}:32400/servers?X-Plex-Token={plex_token}
import requests plex_url = http://{ip_address}:32400/servers?X-Plex-Token={plex_token} response = requests.get(plex_url) print(response.text)
$response = Invoke-RestMethod 'http://{ip_address}:32400/servers?X-Plex-Token={plex_token}' -Method 'GET' Write-Output $response