Create Plex Libraries Programmatically

Hi all,
 
Been using Plex for ages now and just love it. I created a script ages ago, that allows me to move media files into my Plex libraries.
 
It auto detects TV, Movie, Music or Pictures and then asks me which Plex library to move the file (or files) into, then refreshes the Plex libraries from the command switches, using;
..\Plex Media Scanner.exe -l > C:\Temp\PlexLibraryList.txt
then it iterates the text file to find the appropriate library ID number of where I moved the file to and calls;
..\Plex Media Scanner.exe -s -r -c xxx
where xxx is the ID number of the Plex library to refresh
 
I now need to extend this script, to allow the "creation" of Plex libraries and was wondering if it was possible to create a Plex library from the command line?
 
The only things that I believe are necessary are;
- Type (ie: what type of media, eg: TV, Music, Movie, Picture)
- Plex library name
- Source folder of where the files are stored
 
The help on the command line switches makes it appear that you can't create Plex libraries, but are there alternate ways (such as an API call)?

You could look at the network activity in Firefox or Chrome and see what requests are being sent out when creating a library in the web app. That should help you get on the right track.

You could look at the network activity in Firefox or Chrome and see what requests are being sent out when creating a library in the web app. That should help you get on the right track.

Thanks heaps.

Added "Fiddler" to my chrome extensions and looks like it has the info to make this work.

Cheers...

I originally came in here to reply that, yes you can created them using the API (in fact anything the web client does can pretty much be done with the API) - but now I’ve posted this to say “thanks” for putting me onto ‘fiddler’.

I usually watch the server log files/sniff the network to decode the API calls - but this has just made it a hundred times easier… So THANKS!!