# How to retrieve actual media path using API

**URL:** https://forums.plex.tv/t/how-to-retrieve-actual-media-path-using-api/10907
**Category:** Dev/API Corner
**Tags:** other-dev
**Created:** [September 9, 2011, 1:31pm UTC](https://forums.plex.tv/t/how-to-retrieve-actual-media-path-using-api/10907 "2011-09-09T13:31:31Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![hidea](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hidea/32/96548_2.png) [@hidea](https://forums.plex.tv/u/hidea)
#### Post date: [September 9, 2011, 1:31pm UTC](https://forums.plex.tv/t/how-to-retrieve-actual-media-path-using-api/10907/1 "2011-09-09T13:31:31Z")

</div>

Hi Everybody  
  
  
  
I would like to build a client for a set top box. To achieve this, i need to retrieve data from the plex server, and export the result as an xml file with all associated resources. This should work fine for me.   
  
  
  
So I need to retrieve for each item all the information (just like the great Plex Export does) but i need mainly the actual media path on the system (C:\Video\Movietitle\movie.avi) (Plex export does not export the actual media path).   
  
  
  
Do you know how i can retrieve this info ? I cannot find anything about this on the forum ? Do you have any API documentation ?  
  
  
  
Thanks for the help !

---

<div class="post-metadata">

### Author: ![hippojay](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hippojay/32/41_2.png) [@hippojay](https://forums.plex.tv/u/hippojay)
#### Post date: [September 9, 2011, 7:40pm UTC](https://forums.plex.tv/t/how-to-retrieve-actual-media-path-using-api/10907/2 "2011-09-09T19:40:50Z")

</div>

Plex media server just generates XML output, which contains all this info. You retrieve the information per library section. So point your browser at:  
  
  
  
[http://plexmediaserver:32400/library/sections](http://plexmediaserver:32400/library/sections)  
  
  
  
Now pull out the numerical ‘key’ field for the section you want (let’s assume it’s 1). Now go to:  
  
  
  
[http://plexmediaserverip:32400/library/sections/1/all](http://plexmediaserverip:32400/library/sections/1/all)  
  
  
  
The resultant page will give you all the details about the library:  
  
  
  
\< video \>. - the video tag gives info about the actual file (plots, mpaa , etc)  
  
\< media \> - media tag gives info about the video’s media (duration, type, resolution)  
  
\< part \> - gives in for about the actual files. It has two main attributes:  
  
  
  
[list]  
  
[_] key - this is the path to use in conjunction with the PMS web server to get the file via http_  
  
_[_] file - this is the ptch to the media as seen by the plex media server  
  
[/list]  
  
  
  
It’s pretty easy to parse and understand once you’ve seen it.

---

<div class="post-metadata">

### Author: ![hidea](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hidea/32/96548_2.png) [@hidea](https://forums.plex.tv/u/hidea)
#### Post date: [September 11, 2011, 8:42am UTC](https://forums.plex.tv/t/how-to-retrieve-actual-media-path-using-api/10907/3 "2011-09-11T08:42:48Z")

</div>

Thank you !   
  
I’ve tried in my browser but there is no result, just blank page. I’ve two sections : I’ve tried [http://localhost:32400/library/sections/1/all](http://localhost:32400/library/sections/1/all) and [http://localhost:32400/library/sections/2/all](http://localhost:32400/library/sections/2/all), nothing is displayed in the browser, just blank with no error. Any idea ?  
  
Thanks for the help

---

<div class="post-metadata">

### Author: ![hippojay](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hippojay/32/41_2.png) [@hippojay](https://forums.plex.tv/u/hippojay)
#### Post date: [September 11, 2011, 10:19pm UTC](https://forums.plex.tv/t/how-to-retrieve-actual-media-path-using-api/10907/4 "2011-09-11T22:19:42Z")

</div>

Some browsers won’t render the XML, such as safari on iPhone/iPad. I’ve used IE8 and Chrome before and both display the results.  
  
  
  
If you still have no luck, check the plex media server.log file, you should have an entry which matches your http request. If you haven’t then there is some communications problem.

---

<div class="post-metadata">

### Author: ![hidea](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hidea/32/96548_2.png) [@hidea](https://forums.plex.tv/u/hidea)
#### Post date: [September 12, 2011, 7:29am UTC](https://forums.plex.tv/t/how-to-retrieve-actual-media-path-using-api/10907/5 "2011-09-12T07:29:15Z")

</div>

Thanks, this works fine ! For the Movies, this works fine, i can find the actual file path, but for the TV Shows, it is different, :  
  
  
  
For example, i have this :  
  
  
  
  
  
  
  
  
  
Where can i find actual file path for TV shows ?  
  
  
  
Thanks !

---

<div class="post-metadata">

### Author: ![hippojay](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hippojay/32/41_2.png) [@hippojay](https://forums.plex.tv/u/hippojay)
#### Post date: [September 12, 2011, 7:58am UTC](https://forums.plex.tv/t/how-to-retrieve-actual-media-path-using-api/10907/6 "2011-09-12T07:58:25Z")

</div>

Yes, tv is slightly different as it has to cope with seasons. You just need to drill down a bit further.   
  
  
  
The ‘key’ attribute helps you to do this. For tv shows, simply follow the path shown in this value:   
  
  
  
[http://plexmediaseeverip:32400/library/metadata/7044/children](http://plexmediaseeverip:32400/library/metadata/7044/children)  
  
  
  
This will give you a view of seasons. You then need to drill down into the particular season, or choose to view all episodes.

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [December 20, 2019, 9:17pm UTC](https://forums.plex.tv/t/how-to-retrieve-actual-media-path-using-api/10907/7 "2019-12-20T21:17:03Z")

</div>

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