Two methods of talking to Zotero, either via the web API to "api.zotero.org", or via the local client.
A quick summary regarding the Zotero model, and how to interface with it:
Zotero loads a
HTTP server running by default on 127.0.0.1:23119/tcp, open by the main Zotero application.
Zotero Connector (as a browser extension) talks to the server at different
endpoints (full list of endpoints in the
source code, and of interest may be the
server itself that handles the requests).
The readme specified in Zotero connectors is very useful in giving a better overview. Zotero Better Bibtex also allows RPC using JSON.
LibreOffice also has a
dedicated server to talk to using a wire protocol, exposed at 127.0.0.1:23116/tcp.
Existing tools are outdated
Existing tools include:
Script to interface with Zotero locally, uses MozRepl dependency in Zotero to inject Javascript over HTTP (this is because the JS needs to be run from within Zotoer). Most of the toolchains specified in the comments by the author have been archived, and not working for Zotero 5.0.
An alternative exists with the "Better Bibtex" project using a
debug bridge that essentially does the same thing.
pyzotero-local, archived in 2022. This one interfaces directly with the SQL database, but not recommended by Zotero.
However, access to the SQLite database should be done only in a read-only manner. Modifying the database while Zotero is running can easily result in a corrupted database. A caching layer breaks the normal file-locking in SQLite that allows for safe concurrent file access, and even if Zotero is shut down before accessing the file, modifying the database directly bypasses the data validation and referential integrity checks performed by Zotero and the Zotero web
API that are required for Zotero to function properly. Generally, the SQLite database should be viewed as an internal database that has the benefit of being externally readable for people who want to get the data out in other ways. (
src)
Proxy link: https://www-nature-com.libproxy1.nus.edu.sg/articles/d41586-024-02392-8.pdf