Skip to main content


This unofficial app installation guide is provided for your convenience. The guide is provided as-is and may not be updated or maintained by Unofficial support may be offered via Discord only and at the sole discretion of staff. Use at your own risk and only proceed if you are comfortable managing the application on your own.

Python-PlexAPI is a utility tool with intent of performing actions on your Plex instance by interacting with the Plex API. Included features are library actions such as scan, analyze, empty trash among many other things.

  • More information can be found here.


  • Python version 3.5 or above. See here.
  • Plex instance installed on your service.


Do note, Python-PlexAPI requires some familiarity with the Linux terminal and scripting in general. If you are new to this, you should start by reading Your Shell - A Beginner's Guide.

  • Connect to your service via SSH
  • Once connected, execute the following command:
pip install plexapi
  • Once the installation has completed, you can begin using the utility tool.
  • In this guide, we will use our pre-made script that lists all your media titles in a .txt file.
    • However, this is just one of many usecases. Other examples can be found here.
  • Start by downloading the script to your Ultra service with the following command.
  • Next, open the file in the Nano editor.
  • Before you can use the script, you need to edit the plex_url, plex_token and the library names of your Plex server.

    • You can find your Plex IP in the Plex webUI. Navigate to Settings > Remote Access and copy the Private IP. It will be in the format of Do note, if Plex is restarted/upgraded, the private IP might change, and you will need to update your script with the new IP.
    • You can find your Plex token by following the instructions in this link.
    • Additionally, you must edit the script to reflect your library names instead of 4K Movies, 1080p Movies and TV Shows.
      • The file.write row represents what is written to the file by the script.
      • The plex.library.section row is the name of the Plex library the script should look for.
  • Once you have edited the script with your Plex server details and library names, you can save and exit the editor.

    • To save and exit, press CTRL+X and Y, then press ENTER to confirm.
  • To run the script, execute the following command:

  • Depending on the size of your library, it may take some time to execute.
  • If the execution of the script was successful, you should see the following output in your terminal.
ultradocs@spica:~$ python
Media titles with release year have been written to plex_media_titles_with_year.txt
  • You can find your media titles listed in plex_media_titles_with_year.txt