# Populating database with data from webscraper

**URL:** <https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204>\
**Category:** Dev/API Corner\
**Created:** [July 31, 2018, 12:52pm UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204 "2018-07-31T12:52:22Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![plexomat\_svm](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@plexomat\_svm](https://forums.plex.tv/u/plexomat_svm)\
**Post date:** [July 31, 2018, 12:52pm UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/1 "2018-07-31T12:52:22Z")

</div>

Hi,

I’ve built a webscraper to get metadata like title, tags etc from the web.  
I couldn’t find documentation on how to get this data into the plex database. Is there a documentation somewhere on for example which tables I need to populate in the sqlite database in order to import my scraped tags?

Or is there even an API to import metadata from e.g. json?

Thanks!

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [July 31, 2018, 3:00pm UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/2 "2018-07-31T15:00:20Z")

</div>

Unfortunately no.  
The only access to the DB now is through the API and there is no external API to perform this task.  
It only exists internal to the server software itself

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [July 31, 2018, 8:05pm UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/3 "2018-07-31T20:05:28Z")

</div>

And adding here to @ChuckPa

You could write your scraper as an agent, since that’s the way to get it in there

Might wanna take a peak at other agents avail, like:

> [@Metadata agents for exported XBMC library](https://forums.plex.tv/t/metadata-agents-for-exported-xbmc-library/15430):
>
> If you already have metadata in XBMC, and would like to use that in Plex. I took the [code posted by Harley Hooligan](http://forums.plexapp.com/index.php/topic/16293-nfo-agent/page\_\_view\_\_findpost\_\_p\_\_97610), and changed it to work with my files. In XBMC, go in Settings \> Videos \> Library \> Export Video Library. Choose Separate files & Export Thumbnails and fanart, and optionally overwrite existing files. This will create .nfo & .jpg files for your TV Shows and Movies, in the appropriate di…

---

<div class="post-metadata">

**Author:** ![ZeroQI](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/zeroqi/32/6522_2.png) [@ZeroQI](https://forums.plex.tv/u/ZeroQI)\
**Post date:** [August 2, 2018, 8:21am UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/4 "2018-08-02T08:21:53Z")

</div>

also, TV Series agent template here: [https://github.com/ZeroQI/Hama.bundle/releases/download/v1.0/Empty\_Agent\_template.bundle.7z](https://github.com/ZeroQI/Hama.bundle/releases/download/v1.0/Empty_Agent_template.bundle.7z)

---

<div class="post-metadata">

**Author:** ![plexomat\_svm](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@plexomat\_svm](https://forums.plex.tv/u/plexomat_svm)\
**Post date:** [August 6, 2018, 8:04pm UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/5 "2018-08-06T20:04:10Z")

</div>

thanks for your answers so far. I used the unoffical python plex api to at least add tags. I would build a agent, but I couldn’t find any documentation for the API…

Would be great if the plex team could work on a small python package with documentation.

---

<div class="post-metadata">

**Author:** ![plexomat\_svm](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@plexomat\_svm](https://forums.plex.tv/u/plexomat_svm)\
**Post date:** [August 6, 2018, 8:20pm UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/6 "2018-08-06T20:20:15Z")

</div>

I‘ve downloaded all the posters. I‘d really wish there was a way to add all the posters to the files in python. any suggestions?

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [August 6, 2018, 8:39pm UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/7 "2018-08-06T20:39:47Z")

</div>

We need to see code here

Post your Github repo url

---

<div class="post-metadata">

**Author:** ![plexomat\_svm](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@plexomat\_svm](https://forums.plex.tv/u/plexomat_svm)\
**Post date:** [August 7, 2018, 7:08am UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/8 "2018-08-07T07:08:59Z")

</div>

There is nothing to see. I’ve built a webscraper. Scraping and interfacing with plex are two different steps at the moment. The crucial part (getting things into plex) isn’t written yet. and I don’t really know where to start. I’ve looked at several agent implementations. They inherit from some agent class and write a search and an update method. If there just was some documentation…

The tags I’ve added utilized the unoffical plex api. Unfortunately the API is very limited in what it can do. Adding posters is not possible.

I don’t necessarily need an agent, it would suffice to build something that only runs once.

---

<div class="post-metadata">

**Author:** ![ZeroQI](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/zeroqi/32/6522_2.png) [@ZeroQI](https://forums.plex.tv/u/ZeroQI)\
**Post date:** [August 10, 2018, 3:14pm UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/9 "2018-08-10T15:14:10Z")

</div>

you mean like this documentation? [Plex Framework Documentation 2.1.1.pdf.7z](https://global.discourse-cdn.com/plex/original/3X/e/2/e24553d60b91a0cca26cb567f8dd66088854cadc.7z) (750.8 KB)

---

<div class="post-metadata">

**Author:** ![plexomat\_svm](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@plexomat\_svm](https://forums.plex.tv/u/plexomat_svm)\
**Post date:** [August 10, 2018, 3:25pm UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/10 "2018-08-10T15:25:51Z")

</div>

thanks, is there a link to this documentation?

---

<div class="post-metadata">

**Author:** ![ZeroQI](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/zeroqi/32/6522_2.png) [@ZeroQI](https://forums.plex.tv/u/ZeroQI)\
**Post date:** [August 11, 2018, 7:29am UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/11 "2018-08-11T07:29:12Z")

</div>

[https://us.v-cdn.net/6025034/uploads/editor/rg/jxvpxxxt63r6.pdf](https://us.v-cdn.net/6025034/uploads/editor/rg/jxvpxxxt63r6.pdf)

> [@READ ME FIRST: About Plugin-dev](https://forums.plex.tv/t/read-me-first-about-plugin-dev/277617):
>
> This Tag is for channel development, in other words to help people who are interested in programming their own channels (or fixing up existing channels). NOTE: Please post all of your channel requests in the [Plex Plugin forum](https://forums.plex.tv/c/third-party/plugins). NOTE 2: To ask questions about an already existing plugin, go [here](https://forums.plex.tv/t/273971) Before you start a new thread here, please read ahead! [Plex Plugin Development Walkthrough](https://forums.plex.tv/t/9909)[Plugin Development Documentation](https://forums.plex.tv/t/107751)[Known Plex player app and PMS issues supporting Plugin Framework](https://forums.plex.tv/t/209092)[Channel Pl…](https://forums.plex.tv/t/183891)

---

<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:** [November 9, 2018, 7:29am UTC](https://forums.plex.tv/t/populating-database-with-data-from-webscraper/290204/12 "2018-11-09T07:29:12Z")

</div>

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