PHPackages                             joserick/phplex - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. joserick/phplex

AbandonedArchivedLibrary[API Development](/categories/api)

joserick/phplex
===============

A PHP library for interacting with the Plex (https://www.plex.tv) HTTP Control API. (forked from https://github.com/joserick/phplex)

0.0.3.2(7y ago)211.5k↓62.5%1GPL-3.0PHPPHP &gt;=5.6

Since Apr 4Pushed 2y ago2 watchersCompare

[ Source](https://github.com/joserick/phplex)[ Packagist](https://packagist.org/packages/joserick/phplex)[ RSS](/packages/joserick-phplex/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

${\\color{red}This\\ repository\\ is\\ abandoned}$
==================================================

[](#colorredthis-repository-is-abandoned)

**Warning:** This project is no longer in active development and is considered abandoned. No updates or additional support will be provided.

Reason for abandonment
----------------------

[](#reason-for-abandonment)

Due to time and resource constraints, this project has been abandoned. Unfortunately, I no longer have the time to maintain it and give it the active development it deserves.

In addition, since the creation of this project, new alternatives and more advanced solutions have emerged that cover current needs more efficiently. I recommend exploring the following alternatives, which offer additional features and improvements:

Alternative
-----------

[](#alternative)

- [Plex API](https://github.com/jc21/plex-api): This alternative has an active community and continuous development. It offers more advanced functionalities and more intuitive commands.

We appreciate the interest and support this project has received thus far. If you have any questions or concerns, please do not hesitate to contact us, but please note that it is unlikely that you will receive an answer or solution.

PHPlex
======

[](#phplex)

PHPlex is a library for interacting with the [Plex Manager Server](https://www.plex.tv) thought its [API-HTTP](https://github.com/Arcanemagus/plex-api/wiki/Plex-Web-API-Overview).

Requirements
------------

[](#requirements)

- PHP &gt;= 5.6
- Curl PHP Extension
- XML PHP Extension
- JSON PHP Extension

What It Does
------------

[](#what-it-does)

Allows access to your Plex library so that you can retrieve your shows, seasons, episodes, movies, artists, albums, and tracks in a number of convenient ways.

Has simple commands for playback and navigation and also an interface for playing episodes, movies, and tracks.

What It Does Not Do
-------------------

[](#what-it-does-not-do)

Photos have not been implemented yet.

Playback is only implemented at the episode, movies, and track level. The plan is to implement passing a season or album to the application controller and have it play through the entire thing.

Paging has not been implemented for lists of items.

Installation
------------

[](#installation)

Use the package manager [Composer](https://getcomposer.org/) to install PHPlex.

```
composer require joserick/phplex
```

Documentation
-------------

[](#documentation)

You can see more function of PHPlex in [Github Wiki](https://github.com/joserick/phplex/wiki).

Also you can see all the classes, methods and properties in the [Documentation](https://joserick.com/docs/phplex/index.html).

Getting a PlexServer Instance
-----------------------------

[](#getting-a-plexserver-instance)

```
// include composer autoload
require 'vendor/autoload.php';

// import the Joserick Plex
use Joserick\PHPlex\Plex;

// build plex object with you account data.
$plex = new Plex('username', 'password', 'address');

// to finally create server instances
$server = $plex->getServer();
```

If you want add multiples servers with data more specifics.

```
$servers = array(
	'my_server' => array( // Name with which you want to identify the configuration of the server.
		'username' => 'username|email', // Username or email of the plex.tv account.
		'password' => 'password' // Password of the plex.tv account.
		'address' => '192.168.11.9', // Ip of the server, default localhost.
		'port' => '32401' // Ip port, default 32400.
		'token' => '********' // Connexion token, default phplex generate one.
	),
	// ...
);
$plex = new Plex();
$plex->registerServers($servers);
$server = $plex->getServer('my_server');
```

Examples
--------

[](#examples)

### Example 1: List all unwatched movies.

[](#example-1-list-all-unwatched-movies)

```
// First get a section of type movie.
$section = $server->getLibrary()->getSection('Movies');
$movies = $section->getUnwatched();
foreach ($movies as $movie){
	echo $movie->getTitle();
}
```

### Example 2: List all clients connected to the Server.

[](#example-2-list-all-clients-connected-to-the-server)

```
$clients = $plex->getAllClients();
foreach ($clients as $client){
	echo $client->getName();
}
// Get a client specific.
$client_version = $plex->getClient('Chrome')->version;
```

### Example 3: List all genres in a section of type movie.

[](#example-3-list-all-genres-in-a-section-of-type-movie)

```
$section = $server->getLibrary()->getSection('TV Shows')
foreach ($section->getGenres() as $genre){
	echo $genre->getName();
}
```

### Example 4: List all movies in a section with the word 'Terminator' in the title.

[](#example-4-list-all-movies-in-a-section-with-the-word-terminator-in-the-title)

```
$section = $server->getLibrary()->getSection('Movies');
foreach ($section->search('terminator') as $movie){
	echo $movie->getTitle();
}
```

### Example 5: List all file for the latest episode of 'Friends'.

[](#example-5-list-all-file-for-the-latest-episode-of-friends)

```
$last_episode = $server->getLibrary()->getSection('TV Shows')->get('Friends')->getEpisodes()[-1];
foreach ($last_episode->getMedia()->getFiles() as $file){
	echo $file->getPath();
}
```

### Example 6: List of the first character of each item of a section

[](#example-6-list-of-the-first-character-of-each-item-of-a-section)

```
$alphabet = $server->getLibrary()->getSection('TV Shows')->getAlphabet();
foreach ($alphabet as $letter){
	echo $letter;
}
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](https://github.com/joserick/phplex/blob/master/CHANGELOG.md) for more information what has changed recently.

Credits
-------

[](#credits)

- [Nick Bart](https://github.com/nickbart)
- [All Contributors](https://github.com/joserick/phplex/graphs/contributors)

License
-------

[](#license)

The GNU Public License (GPLv3). Please see [License File](https://github.com/joserick/phplex/blob/master/LICENSE) for more information.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

3

Last Release

2571d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2778cc9bdc5a22ad6f08a4141d4bcdad7198591d9167d7cd7643a78718dbb7f?d=identicon)[joserick](/maintainers/joserick)

---

Top Contributors

[![joserick](https://avatars.githubusercontent.com/u/15143699?v=4)](https://github.com/joserick "joserick (116 commits)")[![nickbart](https://avatars.githubusercontent.com/u/270633?v=4)](https://github.com/nickbart "nickbart (70 commits)")

---

Tags

apimediaplex

### Embed Badge

![Health badge](/badges/joserick-phplex/health.svg)

```
[![Health](https://phpackages.com/badges/joserick-phplex/health.svg)](https://phpackages.com/packages/joserick-phplex)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
