As >>6146 says, I would like to write an API, but I don't have time to start it now.
But the hydrus database is all SQLite. If your language can handle that, it can talk to it. And if you can do python, you can talk to my HydrusTagArchive interface very easily. You would be able to export the entire PTR to an HTA and then talk to it in plain english using HydrusTagArchive.py (in the include folder of any regular install).
The db has some messy parts and everything is held together with duct tape across the program, so if you want to connect with any of this stuff, please don't hesitate to grab me here or on discord and I'll walk you through anything confusing!