leepeuker / plex-api

Repository from Github https://github.comleepeuker/plex-apiRepository from Github https://github.comleepeuker/plex-api

A php wrapper for the plex rest api


Installing via Composer

composer require leepe/plex-api

Example use

$client = new \PlexApi\Client(
    [
        'host' => '192.168.1.42',
        'username' => 'coolUsername',
        'password' => 'bestPassword',
    ]
);
$result = $client->getLibrarySections();

print_r($result);

Plex Authentication

You need an authentication token from Plex to talk with the api.

Either add your username and password to the client configuration, so the script can request a token from plex for you, or add a token directly instead. You can read how to find/create a token yourself here.

Configuration

All available configuration options (with default values)

$config = [
    'host' => '127.0.0.1',
    'port' => '32400,
    'ssl' => true,
    'username' => null,
    'password' => null,
    'token' => null,
    'device' => 'php-plex-api',
    'clientId' => 'eacd33c9-ee06-4454-9e21-19cf4c467515',
    'product' => 'php-plex-api',
    'version' => '1.0',
    'platform' => PHP_OS,
    'platformVersion' => PHP_VERSION,
];

$client = new \PlexApi\Client($config);

About


Languages

Language:PHP 99.6%Language:Makefile 0.4%