# Plex 9 remote API

**URL:** <https://forums.plex.tv/t/plex-9-remote-api/4520>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [August 31, 2010, 10:55am UTC](https://forums.plex.tv/t/plex-9-remote-api/4520 "2010-08-31T10:55:57Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![topherfangio](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/topherfangio/32/114759_2.png) [@topherfangio](https://forums.plex.tv/u/topherfangio)\
**Post date:** [September 14, 2010, 5:13pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/21 "2010-09-14T17:13:02Z")

</div>

Looks like this is a duplicate of [http://forums.plexapp.com/index.php?/topic/15850-plex-9-remote-api/](http://forums.plexapp.com/index.php?/topic/15850-plex-9-remote-api/)  
  
  
  
Thanks!

---

<div class="post-metadata">

**Author:** ![MakoNakor](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@MakoNakor](https://forums.plex.tv/u/MakoNakor)\
**Post date:** [September 14, 2010, 5:20pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/22 "2010-09-14T17:20:53Z")

</div>

Merged duplicate threads

---

<div class="post-metadata">

**Author:** ![topherfangio](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/topherfangio/32/114759_2.png) [@topherfangio](https://forums.plex.tv/u/topherfangio)\
**Post date:** [September 14, 2010, 5:26pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/23 "2010-09-14T17:26:38Z")

</div>

> [@](#):
>
> Merged duplicate threads

  
  
Ha ha...I was a bit confused how that happened. I was actually about to make a post in here, but I don't think its necessary.

---

<div class="post-metadata">

**Author:** ![unicorn\_latte](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/unicorn_latte/32/1208_2.png) [@unicorn\_latte](https://forums.plex.tv/u/unicorn_latte)\
**Post date:** [September 18, 2010, 9:36pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/24 "2010-09-18T21:36:03Z")

</div>

> [@](#):
>
> Hi guys  
>   
> I have all the control codes working via the HTTP/etc on the Philips pronto. but how do i start PELX via a http call?

  
  
Got it working in CommandFusion today. I had to add carriage return (the "\x0D") to the new line ("\x0A"). Eg. the following is to send the "Pause" command:  
"GET /system/players//playback/pause HTTP/1.1\x0D\x0AHost: :32400\x0D\x0A\x0D\x0A "  
  
You ought to be able to create an AppleScript that starts Plex. I'm gonna try that next. [See http://applescript.tv/linktrigger/].  
  
Alternatively, or as a backup, if you have a dedicated PlexMini, just set Plex as a startup item, and set that computer to restart every day at 4AM (or whenever suits your schedule.)

---

<div class="post-metadata">

**Author:** ![atomjack](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/atomjack/32/1272_2.png) [@atomjack](https://forums.plex.tv/u/atomjack)\
**Post date:** [September 21, 2010, 4:04am UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/25 "2010-09-21T04:04:16Z")

</div>

Has anyone been able to get PlayMedia to work? I had no problem with the navigation and pulling MediaContainers for all my movies and shows, but the PlayMedia part has me stumped.   
  
  
  
Is the path always supposed to be of the form /library/sections// ? after drilling down into that, I eventually get a PMS URL like /library/metadata/8383/children, which describes all the different media files for the first season of one of the shows I have. I’ve tried constructing the PlayMedia URL using all kinds of combinations but nothing seems to work.  
  
  
  
Something like /system/players//application/playMedia?path=/library/metadata/8383/children&key=7566 - 7566 is the id for the tag describing the actual file I am trying to play. This causes my client to pause for a second or two, and the HTTP Headers I receive are HTTP/1.1 200 OK, but then the client just resumes scrolling the newsfeed on the main screen just like it had been before loading the URL. I’ve also tried passing the ‘key’ parameter from the tag (which has the filename url-encoded at the end of it) but that doesn’t even produce a pause in the client. Any chance of a working example?

---

<div class="post-metadata">

**Author:** ![Mus20](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mus20/32/1465_2.png) [@Mus20](https://forums.plex.tv/u/Mus20)\
**Post date:** [September 22, 2010, 4:48am UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/26 "2010-09-22T04:48:03Z")

</div>

> [@](#):
>
> Got it working in CommandFusion today. I had to add carriage return (the "\x0D") to the new line ("\x0A"). Eg. the following is to send the "Pause" command:  
> "GET /system/players//playback/pause HTTP/1.1\x0D\x0AHost: :32400\x0D\x0A\x0D\x0A "  
>   
> You ought to be able to create an AppleScript that starts Plex. I'm gonna try that next. [See http://applescript.tv/linktrigger/].  
>   
> Alternatively, or as a backup, if you have a dedicated PlexMini, just set Plex as a startup item, and set that computer to restart every day at 4AM (or whenever suits your schedule.)

  
  
  
Quick question for you. I followed the wiki to the letter and still seem to be having issues. Here is what I have done.  
  
Setup: Plex Server and iviewer  
  
1. When I enter http://10.0.1.12:32400/system/players/Michael-Tathams-Mac-mini.local/navigation/moveDown into my browser it works and the cursor moves down.   
  
2. I follwed the above HTTP Request Commands and came up with the following settings:   
  
System Manager:  
  
System Name: Plex Server  
IP Address: 10.0.1.12  
Port & Port Origin: 32400  
TCP: selected  
  
everything else is left blank  
  
  
Command Properties  
  
System: Plex Server 10.0.1.12  
Command Name: Down  
Command Value:   
GET /system/players/Michael-Tathams-Mac-mini.local/navigation/moveUp HTTP/1.1\x0D\x0AHOST: 10.0.1.12:32400\x0D\x0A\x0D\x0A   
  
everything else is left blank  
  
3. I then went on to drag and drop the command to the appropriate button.  
  
4. Saved and uploaded file.  
  
5. No good ):  
  
Any thoughts?

---

<div class="post-metadata">

**Author:** ![Mus20](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mus20/32/1465_2.png) [@Mus20](https://forums.plex.tv/u/Mus20)\
**Post date:** [September 22, 2010, 2:06pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/27 "2010-09-22T14:06:28Z")

</div>

> [@](#):
>
> Quick question for you. I followed the wiki to the letter and still seem to be having issues. Here is what I have done.  
>   
> Setup: Plex Server and iviewer  
>   
> 1. When I enter http://10.0.1.12:32400/system/players/Michael-Tathams-Mac-mini.local/navigation/moveDown into my browser it works and the cursor moves down.   
>   
> 2. I follwed the above HTTP Request Commands and came up with the following settings:   
>   
> System Manager:  
>   
> System Name: Plex Server  
> IP Address: 10.0.1.12  
> Port & Port Origin: 32400  
> TCP: selected  
>   
> everything else is left blank  
>   
>   
> Command Properties  
>   
> System: Plex Server 10.0.1.12  
> Command Name: Down  
> Command Value:   
> GET /system/players/Michael-Tathams-Mac-mini.local/navigation/moveUp HTTP/1.1\x0D\x0AHOST: 10.0.1.12:32400\x0D\x0A\x0D\x0A   
>   
> everything else is left blank  
>   
> 3. I then went on to drag and drop the command to the appropriate button.  
>   
> 4. Saved and uploaded file.  
>   
> 5. No good ):  
>   
> Any thoughts?

  
  
  
Never mind got it working. The file had not uploaded to my ipad correctly...had a weak signal.

---

<div class="post-metadata">

**Author:** ![Mus20](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mus20/32/1465_2.png) [@Mus20](https://forums.plex.tv/u/Mus20)\
**Post date:** [September 22, 2010, 2:56pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/28 "2010-09-22T14:56:39Z")

</div>

> [@](#):
>
> As I'm sure you can appreciate, we're a bit swamped right now with bug reports & queries about all the recent news & updates, so it'll take a little while before all the new goodies are fully documented. I'll try to explain the brief concepts behind the new remote API.  
>   
> Commands take the following form:  
>   
> 
> ```auto
> 
> http://{server}:32400/system/players/{player}/{controller}/{command}
> 
> ```
> 
>   
>   
> [list]  
> [\*]\*\*server\*\* - the IP address or host name of the media server  
> [\*]\*\*player\*\* - the name of the computer running a Plex client you want to issue the remote command to. You can get a list of computers running Plex on the network by hitting /clients on the current server.  
> [\*]\*\*controller\*\* - the command controller you wish to use  
> [\*]\*\*command\*\* - the command to issue  
> [/list]  
>   
> The following controllers and commands are available:  
>   
> \*\*Navigation controller\*\*  
> [list]  
> [\*]moveUp  
> [\*]moveDown  
> [\*]moveLeft  
> [\*]moveRight  
> [\*]pageUp  
> [\*]pageDown  
> [\*]nextLetter  
> [\*]previousLetter  
> [\*]select  
> [\*]back  
> [\*]contextMenu  
> [\*]toggleOSD  
> [/list]  
>   
> \*\*Playback controller\*\*  
> [list]  
> [\*]play  
> [\*]pause  
> [\*]stop  
> [\*]rewind  
> [\*]fastForward  
> [\*]stepForward  
> [\*]bigStepForward  
> [\*]stepBack  
> [\*]bigStepBack  
> [\*]skipNext  
> [\*]skipPrevious  
> [/list]  
>   
> \*\*Application controller\*\*  
> [list]  
> [\*]playFile  
> [\*]playMedia (accepts args: path, key, userAgent (optional), httpCookies (optional), viewOffset (optional))  
> [\*]screenshot (accepts args: width=480&height=270&quality=75)  
> [\*]sendString (accepts args: text=xyz)  
> [\*]sendKey (accepts args: code=01)  
> [\*]sendVirtualKey (accepts args: code=01)  
> [/list]  
>   
> So, for example:  
>   
> 
> ```auto
> 
> http://MacPro.local:32400/system/players/mac-mini.local/navigation/moveDown
> 
> ```
> 
>   
>   
> The one that might need a bit more explanation is the PlayMedia command. This differs from the old XBMC PlayFile command in that it requires two arguments - the path and the key. The path should be a PMS URL that returns a MediaContainer describing a directory, e.g. /library/sections/2/... The key should be the key 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 OSD, relationships between tracks within albums are maintained, etc.)  
>   
> Hope that's enough information to get you started!

  
  
How would one go about sending a keyboard letter stroke? would it be /sendKey/a/?

---

<div class="post-metadata">

**Author:** ![atomjack](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/atomjack/32/1272_2.png) [@atomjack](https://forums.plex.tv/u/atomjack)\
**Post date:** [September 22, 2010, 4:40pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/29 "2010-09-22T16:40:05Z")

</div>

> [@](#):
>
> How would one go about sending a keyboard letter stroke? would it be /sendKey/a/?

  
No, I'm pretty sure it would be like http://{server}:32400/system/players/{player}/application/sendString?text=a  
  
I was able to get the screenshot thing to work with width and height specified using the same format, so I'm pretty sure that's how you'd do it.  
  
Looks like sendKey takes a code, maybe ascii character code?

---

<div class="post-metadata">

**Author:** ![ryanwillden\_gmail.com](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@ryanwillden\_gmail.com](https://forums.plex.tv/u/ryanwillden_gmail.com)\
**Post date:** [September 23, 2010, 1:59am UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/30 "2010-09-23T01:59:03Z")

</div>

> [@](#):
>
> Thanks alot guys. That was really helpful. Got it working. Now just need to get it to work in crestron. I am trying to work on a crestron module for the new plex. I get it to work from within a browser but not from crestron. Something on crestron's end.

  
  
  
I finally got the basic commands working in Crestron. Now I just need help generating the correct html request to navigate to sections like music, and movies, and TV shows. Any ideas?  
  
I tried sending the following command hoping that it would get me to the TV Shows folder:  
  
http://{server}:32400/system/players/{player}/application/playMedia?/library/sections/2/  
  
It didn't work however. Any advice would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![ryanwillden\_gmail.com](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@ryanwillden\_gmail.com](https://forums.plex.tv/u/ryanwillden_gmail.com)\
**Post date:** [September 23, 2010, 7:31pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/31 "2010-09-23T19:31:49Z")

</div>

Also, Is there a list of sendKey commands somewhere? I just sent the command “http://{server}:32400/system/players/{player}/application/sendKey?code=13” and it effectively worked the same as pressing the select key.  
  
  
  
I did it by accident thinking it would be the same as sending the letter S in ascii from the keyboard. It’s nice to know that the sendKey command works, but it would be nice to have a list of the available sendKey commands to work from.  
  
  
  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![atomjack](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/atomjack/32/1272_2.png) [@atomjack](https://forums.plex.tv/u/atomjack)\
**Post date:** [September 23, 2010, 9:52pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/32 "2010-09-23T21:52:06Z")

</div>

> [@](#):
>
> Also, Is there a list of sendKey commands somewhere? I just sent the command "http://{server}:32400/system/players/{player}/application/sendKey?code=13" and it effectively worked the same as pressing the select key.  
>   
> I did it by accident thinking it would be the same as sending the letter S in ascii from the keyboard. It's nice to know that the sendKey command works, but it would be nice to have a list of the available sendKey commands to work from.  
>   
> Thanks in advance!

  
Well if you look at http://www.asciitable.com/, decimal 13 is the ascii code for carriage return, so it looks like it really is using an ascii code. The ascii code for lowercase s is 115, so try sending that instead.  
  
I'm still hoping someone can figure out playMedia. I'll keep at it but I haven't had any luck yet. I'm almost positive you need to specify the arguments like so: playMedia?path=&key=.

---

<div class="post-metadata">

**Author:** ![ryanwillden\_gmail.com](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@ryanwillden\_gmail.com](https://forums.plex.tv/u/ryanwillden_gmail.com)\
**Post date:** [September 23, 2010, 10:29pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/33 "2010-09-23T22:29:15Z")

</div>

That makes more sense. I would also like more info on the playMedia command.

---

<div class="post-metadata">

**Author:** ![Mus20](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mus20/32/1465_2.png) [@Mus20](https://forums.plex.tv/u/Mus20)\
**Post date:** [September 24, 2010, 2:57am UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/34 "2010-09-24T02:57:54Z")

</div>

> [@](#):
>
> No, I'm pretty sure it would be like http://{server}:32400/system/players/{player}/application/sendString?text=a  
>   
> I was able to get the screenshot thing to work with width and height specified using the same format, so I'm pretty sure that's how you'd do it.  
>   
> Looks like sendKey takes a code, maybe ascii character code?

  
  
for those interested here is what I eventually got working for the keyboard code- all ASCii  
  
  
http://{server}:32400/system/players/{player}/application/sendVirtualKey?code=  
  
8=delete  
27=esc  
32=space  
  
48=0  
49=1  
50=2  
51=3  
52=4  
53=5  
54=6  
55=7  
56=8  
57=9  
  
97=a  
98=b  
99=c  
100=d  
101=e  
102=f  
103=g  
104=h  
105=i  
106=j  
107=k  
108=l  
109=m  
110=n  
111=o  
112=p  
113=q  
114=r  
115=s  
116=t  
117=u  
118=v  
119=w  
120=x  
121=y  
122=z

---

<div class="post-metadata">

**Author:** ![ryanwillden\_gmail.com](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@ryanwillden\_gmail.com](https://forums.plex.tv/u/ryanwillden_gmail.com)\
**Post date:** [September 24, 2010, 3:22am UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/35 "2010-09-24T03:22:49Z")

</div>

Good deal. Thanks for sharing that. I might go back and change the protocol that I created for using the keyboard to match this. Much more efficient since it includes basic keyboard commands as well.

---

<div class="post-metadata">

**Author:** ![jam](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jam/32/186050_2.png) [@jam](https://forums.plex.tv/u/jam)\
**Post date:** [September 24, 2010, 10:26am UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/36 "2010-09-24T10:26:13Z")

</div>

Here’s an example of using the PlayMedia command. Atomjack got it almost right, but missed a couple of things, probably because I rushed my previous explanation 🙂  
  
  
  
[list]  
  
[_]The ‘path’ argument needs to be a full HTTP URL, since the command is quite flexible (for example, it can be sent to computer A, instructing computer B to play a piece of media stored on computer C)_  
  
_[_]The ‘key’ argument is the key of the element, not the   
  
[\*]Both arguments need to be URL encoded to escape the forward slashes & colons  
  
[/list]  
  
  
  
So, if I wanted to play a piece of media on my iMac stored on my Mac Mini, after browsing to the Recently Added TV Shows menu at “/library/sections/3/recentlyAdded” with the key “/library/metadata/3435”, I’d send the following request:

```auto

http://mac-mini.local:32400/system/players/imac.local/application/playMedia?path=http%3A%2F%2Fmac-mini.local%3A32400%2Flibrary%2Fsections%2F3%2FrecentlyAdded&key=%2Flibrary%2Fmetadata%2F3435

```

---

<div class="post-metadata">

**Author:** ![topherfangio](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/topherfangio/32/114759_2.png) [@topherfangio](https://forums.plex.tv/u/topherfangio)\
**Post date:** [September 24, 2010, 2:41pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/37 "2010-09-24T14:41:44Z")

</div>

Jam, thanks for that description. Makes a lot more sense now!

---

<div class="post-metadata">

**Author:** ![ryanwillden\_gmail.com](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@ryanwillden\_gmail.com](https://forums.plex.tv/u/ryanwillden_gmail.com)\
**Post date:** [September 24, 2010, 5:18pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/38 "2010-09-24T17:18:46Z")

</div>

Is it possible to issue a similar command to navigate to a specific folder, but not to play anything? In other words… From a control system like Crestron, can I send a command that would instantly navigate the Mac Mini in Plex to the Recently Added folder in movies, or to the Music plugin?

---

<div class="post-metadata">

**Author:** ![anville](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/anville/32/83050_2.png) [@anville](https://forums.plex.tv/u/anville)\
**Post date:** [September 27, 2010, 7:55am UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/39 "2010-09-27T07:55:40Z")

</div>

This interface is great! How can I send a fullscreen toggle? If I were to type it, I would use Cmd-F. Not sure how that would map to a virtual key code, though…  
  
--------------------------  
  
Update: Just did a run through of codes: Did it with:  
  
  
  
http:// {server}:32400/system/players/{player}/application/sendVirtualKey?code=236  
  
  
  
  
  
😃

---

<div class="post-metadata">

**Author:** ![ryanwillden\_gmail.com](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@ryanwillden\_gmail.com](https://forums.plex.tv/u/ryanwillden_gmail.com)\
**Post date:** [September 27, 2010, 5:18pm UTC](https://forums.plex.tv/t/plex-9-remote-api/4520/40 "2010-09-27T17:18:22Z")

</div>

> [@](#):
>
> This interface is great! How can I send a fullscreen toggle? If I were to type it, I would use Cmd-F. Not sure how that would map to a virtual key code, though...  
> --------------------------  
> Update: Just did a run through of codes: Did it with:  
>   
> http:// {server}:32400/system/players/{player}/application/sendVirtualKey?code=236  
>   
>   
> :D

  
  
  
Is there a list of codes like this available for Plex?  
  
I know there was a similar list for XBMC: http://xbmc.svn.sourceforge.net/viewvc/xbmc/trunk/guilib/Key.h?view=markup  
  
I know the devs are busy with the new rollout, but it would be awesome if there were a list of commands available to work from.

[Previous page](https://forums.plex.tv/t/plex-9-remote-api/4520.md?page=1)

[Next page](https://forums.plex.tv/t/plex-9-remote-api/4520.md?page=3)
