Skip to main content
GET
/
media
/
providers
PlexPHP
declare(strict_types=1);

require 'vendor/autoload.php';

use LukeHagar\Plex_API;

$sdk = Plex_API\PlexAPI::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();



$response = $sdk->server->getMediaProviders(
    xPlexToken: 'CV5xoxjTpFKUzBTShsaf'
);

if ($response->object !== null) {
    // handle response
}
{
  "MediaContainer": {
    "identifier": "<string>",
    "offset": 123,
    "size": 123,
    "totalSize": 123,
    "allowCameraUpload": true,
    "allowChannelAccess": true,
    "allowMediaDeletion": true,
    "allowSharing": true,
    "allowSync": true,
    "allowTuners": true,
    "backgroundProcessing": true,
    "certificate": true,
    "companionProxy": true,
    "countryCode": "<string>",
    "diagnostics": "<string>",
    "eventStream": true,
    "friendlyName": "<string>",
    "hubSearch": true,
    "itemClusters": true,
    "livetv": 7,
    "machineIdentifier": "<any>",
    "mediaProviders": true,
    "multiuser": true,
    "musicAnalysis": 2,
    "myPlex": true,
    "myPlexMappingState": "<any>",
    "myPlexSigninState": "<any>",
    "myPlexSubscription": true,
    "myPlexUsername": "<string>",
    "offlineTranscode": "<any>",
    "ownerFeatures": "<string>",
    "platform": "<string>",
    "platformVersion": "<string>",
    "pluginHost": true,
    "pushNotifications": true,
    "readOnlyLibraries": true,
    "streamingBrainABRVersion": 123,
    "streamingBrainVersion": 123,
    "sync": true,
    "transcoderActiveVideoSessions": 123,
    "transcoderAudio": true,
    "transcoderLyrics": true,
    "transcoderPhoto": true,
    "transcoderSubtitles": true,
    "transcoderVideo": true,
    "transcoderVideoBitrates": "<any>",
    "transcoderVideoQualities": "<string>",
    "transcoderVideoResolutions": "<any>",
    "updatedAt": 123,
    "updater": true,
    "version": "<string>",
    "voiceSearch": true,
    "Feature": [
      {
        "Directory": [
          {
            "title": "<string>",
            "type": "<string>",
            "art": "<string>",
            "content": true,
            "filter": "<string>",
            "hasPrefs": true,
            "hasStoreServices": true,
            "hubKey": "<string>",
            "identifier": "<string>",
            "key": "<string>",
            "lastAccessedAt": 123,
            "Pivot": [
              {
                "title": "<string>",
                "type": "<string>",
                "context": "<string>",
                "id": "<string>",
                "key": "<string>",
                "symbol": "<string>"
              }
            ],
            "share": 123,
            "thumb": "<string>",
            "titleBar": "<string>"
          }
        ],
        "key": "<string>",
        "type": "<string>"
      }
    ],
    "protocols": "<string>",
    "title": "<string>",
    "types": "<string>"
  }
}

Authorizations

X-Plex-Token
string
header
required

The token which identifies the user accessing the PMS. This can be either:

  • A traditional access token obtained from plex.tv
  • A JWT token obtained through the JWT authentication flow

JWT tokens provide better security with:

  • Short-lived tokens (7 days expiration)
  • Public-key cryptography (ED25519)
  • Better clock synchronization
  • Individual device revocation capability

Response

200 - application/json

OK

MediaContainer
object

MediaContainer is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable. Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination) The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the parentTitle attribute may appear on the MediaContainer rather than being repeated on each track.