Plex HTTP API

Hi,

 

You have very helpfully published the HTTP/API control here:

 

http://wiki.plexapp.com/index.php/HTTP_API/Control

 

I'm using this very successfully from iRule to control PLEX.

 

However looking at Remote Buddy, this program seems to have a far bigger list of control commands for Plex, as you can see from the enclosed screenshot taken from Remote Buddy. Felix must have got them from somewhere. Do you have details for more API commands?

 

Hope you can help.

 

Thanks,

 

Roland

 

I'm trying to find the http api call page I think is referenced above on the new support page and can't find it??

I'm trying to find the http api call page I think is referenced above on the new support page and can't find it??

Not there yet....Plex is still building up the new site.

Sadly though.....the old one is offline as well, so all I can add here is to be patiance

/T

Personally I like the new look; its cleaner and clearer, but I find that a odd deployment strategy that 'some' pages get converted and release it and then send a notification well after the fact and them some pages remain unported? Fortunately I had a static copy  of some bits in a note

HTTP API/Control

 

Contents

[edit]Basics

Plex allows for the control of some clients (notably, the Mac and Windows desktop "Plex Media Center" clients) via an HTTP Control API. Basically, by using properly-formatted HTTP requests, you can send commands to that client. This could let you do simple things like pause a currently-playing item or more advanced things like arbitrarily playing a particular item.

Commands take the following form:

http://{server}:32400/system/players/{player}/{controller}/{command}

[edit]Available Controllers and Commands

The following controllers and commands are available:

[edit]Navigation

[edit]Navigation Controller

This controller is accessed via the controller keyword "navigation" when sending commands.

http://MacPro.local:32400/system/players/mac-mini.local/navigation/moveDown

[edit]Navigation Commands

The following commands are available for the navigation controller:

[edit]Playback

[edit]Playback Controller

This controller is accessed via the controller keyword "playback" when sending commands.

http://MacPro.local:32400/system/players/mac-mini.local/playback/pause

[edit]Playback Commands

The following commands are available for the playback controller:

[edit]Application

[edit]Application Controller

This controller is accessed via the controller keyword "application" when sending commands.

http://MacPro.local:32400/system/players/mac-mini.local/application/sendKey?code=01

[edit]Application Commands

The following commands are available for the application controller:

Notes: The playMedia command needs a bit more explanation. This command requires two arguments - the path and the key - and has additional optional arguments. The path should be a PMS URL that returns a MediaContainer describing a directory, for example "http://localhost:32400/library/sections/2/". The key should be the ratingKey attribute of the item within that container that you wish to play. This method has the added benefit of giving Plex enough information to access the metadata of the item rather than just the media (posters and plots show up in the on-screen-display, relationships between tracks within albums are maintained, etc.).

See the examples below to see how some of them work in action.

[edit]Examples

A simple navigation command to move down in a list of item:

http://MacPro.local:32400/system/players/mac-mini.local/navigation/moveDown

 

Toggle the on-screen-display menu while watching some media:

http://192.168.1.4:32400/system/players/mac-mini.local/navigation/toggleOSD

 

Pause an actively-playing item:

http://MacPro.local:32400/system/players/192.168.1.6/playback/pause

 

Take a small jump back in time for an actively-playing item:

http://MacPro.local:32400/system/players/mac-mini.local/playback/stepBack

Set the volume to 100%:

http://MacPro.local:32400/system/players/mac-mini.local/application/setVolume?level=100

 

You can get a JPG image of the current client screen:

http://192.168.1.4:32400/system/players/mac-mini.local/application/screenshot?width=720&height=480&quality=75

 

This is a "dumb" command to simply play a particular library file. Note that it will have no metadata or other information associated with it.

http://MacPro.local:32400/system/players/192.168.1.6/application/playFile?path=http://mac-mini.local:32400/library/parts/438/file.m4v

 

Here's a more complicated example that will start playing a particular media item. It includes an offset (in milliseconds), which means that playback starts in the middle - in this case, around 36:33 into the movie.

http://MacPro.local:32400/system/players/mac-mini.local/application/playMedia?key=/library/metadata/147&path=http://mac-mini.local:32400/library/metadata/147&viewOffset=2193449

 

From <http://wiki.plexapp.com/index.php/HTTP_Control_API>  

    • server - The IP address or local host name (e.g. "mac-mini.local") of the media server
    • player - The computer running a Plex client to which you want to issue the remote command. You can get a list of computers running Plex on the network by hitting http://{server}:32400/clients on the current server. This can be the IP address or local host name (e.g. "mac-mini.local") of the computer.
    • controller - The command controller you wish to use
    • command - The command to issue
    • moveUp
    • moveDown
    • moveLeft
    • moveRight
    • pageUp
    • pageDown
    • nextLetter
    • previousLetter
    • select
    • back
    • contextMenu
    • toggleOSD
    • play
    • pause
    • stop
    • rewind
    • fastForward
    • stepForward
    • bigStepForward
    • stepBack
    • bigStepBack
    • skipNext
    • skipPrevious
    • playFile (accepts the following argument)
    • path
    • playMedia (accepts the following arguments)
    • path
    • key
    • userAgent (optional)
    • httpCookies (optional)
    • viewOffset (optional)
    • screenshot (accepts the following arguments) (does not appear to be working currently)
    • width (default 480)
    • height (default 270)
    • quality (default 75)
    • sendString (accepts the following argument)
    • text=xyz
    • sendKey (accepts the following argument) (does not appear to be working currently)
    • code=01
    • sendVirtualKey (accepts the following argument) (does not appear to be working currently)
    • code=01
    • setVolume (accepts the following argument)
    • level=100

Does anyone know where or how to find details on the new Plex Companion API? All I have figured out so far is that http://plex_ip:32400/clients yields a list of all currently connected clients. I am working on a little application that is mainly there to control PHT and for now I have been using the XBMC JSON-RPC protocol directly to PHT, but I would like to make this more universal and "plexy".

Hi

The links aren't opening. It takes me to the main Plex Page. 

The links aren't opening. It takes me to the main Plex Page. 

Try this: https://oldwiki.plexapp.com/index.php?title=HTTP_API/Control

The documentation is still lacking, and like the OP, there seems to be a much richer command set available.

Any update on when new documentation will be made available?  I've also noticed these commands don't seem to work on many client devices (eg Chromecast, Amazon Fire TV) - is this a limitation of the clients on those devices or am I missing something?  When hitting 32400/clients the only client device of mine I see is a Roku (even when actively watching content on another device)

I only get a 401 when I try to see my clients (when playing video from web/iphone on a localhost)

I only get a 401 when I try to see my clients (when playing video from web/iphone on a localhost)

You probably need to get a Plex Token.

Any Update?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.