PlexAPI
Python bindings for the Plex API.
What it is and what it does
PlexAPI is an unofficial Python wrapper around the Plex media server API, letting you automate interactions with Plex servers from Python code. It depends only on requests and works with Python 3.10 and later. You can use it to navigate and search libraries, perform server maintenance tasks like scanning and analyzing, remotely control playback on connected clients (including Sonos speakers with appropriate setup), and subscribe to server notifications.
The library is designed to match the capabilities of the official Plex Web Client. It reads XML documents from the Plex server and exposes them as Python objects with camelCase naming to match the underlying API structure. The project has been maintained since 2014, is actively developed, and has no known security vulnerabilities.
Use it for:
- Automatically find and list unwatched content in your Plex library for batch operations or reporting.
- Build a custom remote control interface to play media on specific Plex clients from a Python application.
- Automate library maintenance tasks like scanning for new media, analyzing metadata, or emptying trash.
- Create integrations that respond to Plex server events by listening to notifications.
- Query and manage playlists, ratings, and playback state across your Plex server programmatically.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Unofficial Python bindings for the Plex API that let you programmatically control Plex servers, search libraries, manage playback on connected clients, and listen to server notifications.
Yes. PlexAPI is actively maintained, has no known vulnerabilities, installs cleanly with minimal dependencies, and supports current Python versions. It's well-suited for anyone needing to automate Plex server operations or build custom integrations. The BSD-3-Clause license is permissive. The only gotcha is that you need network access to a running Plex Server and a valid auth token to use it.
Install
plexapi on PyPI
pip
pip install plexapiuv
uv add plexapipoetry
poetry add plexapiInstalling PlexAPI
Before you install
Low install friction with a single runtime dependency (requests). Active maintenance: last commit 2026-08-04, 1289 repository stars, and release within 35 days. Requires Python 3.10 or later.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions, provided you retain the license notice.
Quickstart
pip install plexapi
from plexapi.server import PlexServer
baseurl = 'http://plexserver:32400'
token = 'your_auth_token'
plex = PlexServer(baseurl, token)
movies = plex.library.section('Movies')
for video in movies.search(unwatched=True):
print(video.title)
Requires Python 3.10 or later; you must have network access to a running Plex Server instance and a valid authentication token.
Verify before relying
- Whether optional dependencies for alert and JWT features are stable and well-maintained.
- Compatibility with all current Plex Server versions and whether breaking changes are documented.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — requests |
| Maintenance | actively maintained — 35 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 408,596/month — #6,876 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: plexapi-4.18.2-py3-none-any.whl
Keywords: plex, api
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
plexwebsocketAsync library that connects to Plex media…
permissive · top 15,000 on PyPI
plexauthHandles authorization flow to obtain tokens…
permissive · top 15,000 on PyPI
aiopyarrAsync Python client library for Lidarr, Radarr,…
permissive · top 15,000 on PyPI
roonapiPython client library for the Roon music server…
permissive · top 15,000 on PyPI
pyforked-daapdA Python client library for communicating with…
permissive · top 15,000 on PyPI
casttubeInteract with YouTube on Chromecast devices by…
permissive · top 15,000 on PyPI
sonos-websocketAsync Python library for communicating with…
permissive · top 15,000 on PyPI
ytmusicapiytmusicapi lets you programmatically interact…
permissive · top 15,000 on PyPI
python-vlcPython ctypes-based bindings to libvlc that let…
copyleft · top 15,000 on PyPI
pyps4-2ndscreenUnofficial Python library to control…
copyleft · top 15,000 on PyPI