Where are playlists stored?

I have a very large library and I wanted to make playlists programmatically. Is there a config file or db where this reference is stored for the application? I can't reasonably go through the UI and allocate these.

I planned to write a script that assigns movies to playlists I create based on various criteria ie playlist for rotten tomatoes score higher than x% based on a program I wrote. I saw a settings db, but couldn't open it.

Use the api visible in browser network inspector

perfect, I found it and it worked perfectly. Thank you!