Plex.tv - Get Resources

This API endpoint will return a list of all resources.

URL

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

Parameters

NameDescription
plex_tokenThe Plex token.

Return Status

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

Response

XML string value that lists the resources:

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="3">
    <Device name="PlexServer" product="Plex Media Server" productVersion="1.40.4.8679-424562606" platform="Windows" platformVersion="10.0 (Build 19045)" device="PC" clientIdentifier="56c3281a85646683be8051dfb8c6a0964c0b04f1" createdAt="1449974814" lastSeenAt="1720814465" provides="server" owned="1" accessToken="Ds4gHEeLtH8nzj1t_dqG" publicAddress="XXX.XXX.XXX.XXX" httpsRequired="0" synced="0" relay="0" dnsRebindingProtection="0" publicAddressMatches="1" presence="1">
        <Connection protocol="http" address="192.168.2.120" port="32400" uri="http://192.168.2.120:32400" local="1"/>
    </Device>
    <Device name="Android" product="Plexamp" productVersion="4.10.1" platform="Android" platformVersion="14" device="Android" clientIdentifier="37e1b9c1-f87d-4c37-92c3-84657d636f7b" createdAt="1667934149" lastSeenAt="1720646785" provides="client,player,pubsub-player" owned="1" publicAddress="XXX.XXX.XXX.XXX" publicAddressMatches="0" presence="0">
        <Connection protocol="http" address="192.168.2.164" port="32500" uri="http://192.168.2.164:32500" local="1"/>
    </Device>
    <Device name="Desktop" product="Plexamp" productVersion="4.10.1" platform="Windows" platformVersion="10.0.19045" device="Windows" clientIdentifier="d8908091-f886-4e75-bcf4-79fbfd57a673" createdAt="1715866437" lastSeenAt="1720803362" provides="client,player,pubsub-player" owned="1" publicAddress="XXX.XXX.XXX.XXX" publicAddressMatches="1" presence="0">
        <Connection protocol="http" address="192.168.2.100" port="32500" uri="http://192.168.2.100:32500" local="1"/>
        <Connection protocol="http" address="192.168.56.1" port="32500" uri="http://192.168.56.1:32500" local="1"/>
    </Device>
</MediaContainer>

The XML returned provides a list of the resources. The root is the MediaContainer element. This element contains a single attribute that is the number of resources returned..

MediaContainer Attributes
AttributeDescription
sizeThe number of resources.

Within the MediaContainer there are one or more Device child elements. Each Device element represents one resource.

Device Attributes
AttributeDescription
nameThe name of the resource.
productThe name of the product associated with the resource.
productVersionThe version of the product.
platformThe platform of the resource.
platformVersionThe version of the platform.
deviceThe type of resource.
clientIdentifierThe unique identifier of the resource.
createdAtWhen the resource was associated to the Plex account.
lastSeenAtWhen the resource last connected to the account.
providesThe functionality the resource provides.
ownedFlag indicating if the resource is owned.
0 - the resource is not owned.
1 - the resource is owned.
accessTokenThe token associated with the resource.
publicAddressThe public IP address of the resource.
publicAddressMatchesUnique identifier for the resource.
httpsRequiredFlag indicating https is required when connecting to the resource.
0 - https is not required.
1 - https is required.
syncedFlag indicating the resource is synced.
0 - the resource is not synced.
1 - the resource is synced.
relayFlag indicating that the Plex relay is enabled for the resource.
0 - relay is not enabled.
1 - relay is enabled.
dnsRebindingProtectionDNS rebinding protection is enabled for the resource.
0 - DNS rebinding protection is not enabled.
1 - DNS rebinding protection is enabled.
publicAddressMatchesUnique identifier for the resource.
presenceFlag indicating the resource is currently active and present.
0 - the resource is not active or present.
1 - the resource is active and present.

There could be on or more Connection child elements within each Device element. Each Connection element lists a URL associated to the resource.

Connection Attributes
AttributeDescription
protocolThe protocol used to connect to the resource.
addressThe address assigned to the resource.
portThe port used to connect to the resource.
uriThe full URL to the resource.
localFlag indicating if the resource is local.
0 - the resource is not local.
1 - the resource is local.

Examples

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

response = requests.get(plex_url)

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

Write-Output $response

Subscribe
Display