Skip to content
clumsyCoder00 edited this page Mar 7, 2023 · 11 revisions

API Endpoints

Descriptions from Python PlexAPI

Base URL: http://<MEDIA SERVER IP>:<MEDIA SERVER PORT>(typically 32400)

Navigation Commands

These commands navigate around the user-interface.

Call URL Description
GET /player/navigation/back Navigate back one position.
GET /player/navigation/contextMenu Open the context menu on the client.
GET /player/navigation/home Go directly to the home screen.
GET /player/navigation/moveDown Move selection down a position.
GET /player/navigation/moveLeft Move selection left a position.
GET /player/navigation/moveRight Move selection right a position.
GET /player/navigation/moveUp Move selection up a position.
GET /player/navigation/music Go directly to the playing music panel.
GET /player/navigation/nextLetter Jump to next letter in the alphabet.
GET /player/navigation/pageDown Move selection down a full page.
GET /player/navigation/pageUp Move selection up a full page.
GET /player/navigation/previousLetter Jump to previous letter in the alphabet.
GET /player/navigation/select Select element at the current position.
GET /player/navigation/toggleOSD Toggle the on screen display during playback.

Playback Commands

These commands control the playback of media.
Most of the playback commands take a mandatory commandID which is incremented for every command sent during a continuous browser session, but appears to accept '0' as a default value. Most of the playback commands take a mandatory mtype (music, photo, video) parameter to specify which media type to apply the command to, (except for playMedia). This is in case there are multiple things happening (e.g. music in the background, photo slideshow in the foreground).

Call URL Description Parameters
GET /player/playback/pause Pause the currently playing media type. mtype
commandID
GET /player/playback/play Start playback for the specified media type. mtype
commandID
GET /player/playback/playMedia Start playback of the specified media item. media (movie, music, photo, playlist, playqueue)
offset
commandID
GET /player/playback/refreshPlayQueue Refresh the specified Playqueue. playQueueID
mtype
commandID
GET /player/playback/seekTo Seek to the specified offset (ms) during playback. offset
mtype
commandID
GET /player/playback/skipNext Skip to the next playback item. mtype
commandID
GET /player/playback/skipPrevious Skip to previous playback item. mtype
commandID
GET /player/playback/skipTo Skip to the playback item with the specified key. key
mtype
commandID
GET /player/playback/stepBack Step backward a chunk of time in the current playback item. mtype
commandID
GET /player/playback/stepForward Step forward a chunk of time in the current playback item. mtype
commandID
GET /player/playback/stop Stop the currently playing item. mtype
commandID
GET /player/playback/setParameters Set multiple playback parameters at once.
ex: /setParameters?volume=47?&shuffle=1&repeat=2
volume (0-100)
shuffle (0/1)
repeat (0/1/2)
mtype
commandID
GET /player/playback/setStreams Select multiple playback streams at once.
ex: /player/playback/setStreams?audioStreamID=X&subtitleStreamID=Y&videoStreamID=Z
audioStreamID
subtitleStreamID
videoStreamID
mtype
commandID

Example of request to playback specified media with minimal parameters

http://IP:PORT/player/playback/playMedia?key=/library/metadata/<MEDIA ID>&machineIdentifier=<SERVER ID>&address=<SERVER IP>&port=<SERVER PORT>

Example of request to start playback of current music item.

http://IP:PORT/player/playback/play?type=music&commandID=0&X-Plex-Target-Client-Identifier=<_media player_ machineIdentifier>

Example of request to adjust volume to 45%

http://IP:PORT/player/playback/setParameters?type=music&volume=45&commandID=0&X-Plex-Target-Client-Identifier=<_media player_ machineIdentifier>  

Request Headers

Header Value Description
X-Plex-Target-Client-Identifier (UUID, serial number, or other number unique media player) This value can be found by sending a request to http://IP:PORT/clients to see a list of media players connected to that particular server. Look for the media player wished to be controlled. The value of machineIdentifier is used here in the URL to specify which media player is to be controlled.
machineIdentifier (UUID, serial number, or other number unique per server) This value can be found by sending a request to http://IP:PORT/ to see information about that particular server. The value of machineIdentifier is used here in the URL to specify which server is being addressed.
Clone this wiki locally