Using API to download closed group library

72 views
Skip to first unread message

Rainer Krug

unread,
Jul 25, 2023, 4:17:01 PM7/25/23
to zotero-dev
Hi

In general, I would like to download complete (some closed, some open) group libraries to my computer. The aim is:

1) to analyse the library further for bibliographic analysis in R
2) to make regular backups of the (mission critical) group libraries.

As I did not find a library in R to use the Zotero API, I think I have to implement it myself.

My question:

How can I download a whole group to process it further (i.e. in a well kn own format) and / or for backup purposes (i.e., ideally, I would be able to upload it again to restore the group.)

I have a bit of experience of translating the api calls into R, so if I would have the http API calls, I could take it from there.

Thanks,

Rainer

Dan Stillman

unread,
Jul 25, 2023, 10:22:27 PM7/25/23
to zoter...@googlegroups.com
I'm not sure what you're looking for beyond the main API documentation. For maintaining a complete mirror of all data from a Zotero library, you'd want to follow the syncing process.

But I'm not sure why you wouldn't just use the desktop app for both of these things. For a local backup, you would certainly want to just sync the desktop app periodically and back up the data directory, and that's also the best way to generate an export from an entire library in any of the standard formats Zotero supports (instead of needing to make many separate requests via the API).

Rainer Krug

unread,
Jul 26, 2023, 2:41:09 AM7/26/23
to zotero-dev
Thanks for the reply.
I am not an API expert, so the documentation is difficult to understand for me and I thought, tat I could get some more info how I can achieve this. And by the way, the tip with syncing helped, but It would be great, if I could get an example on how I could do that.

Re backup: A backup is only useful if it is done automatic. If it is manual, one forgets it, it gets out of sync, risk of data loss increases. As far as I can see, there is no way of doing a proper backup of Zotero, as I could do a manual backup and shutting down Zotero before, or an automated backup of the Zotero folder, but then Zotero has to run to download updates to the group databases. So it would be an option to script Zotero to update the group databases, after finished stop the syncing, backup the Zotero folder, and re-enable syncing. But I did not find an option to do this from the command line. In this case, the approach to do it as you suggested would be perfect.

Re for analysis: the analysis should use the up-to-date version of the Zotero group -and running Zotero manually to update, is sub-optimal. So I am looking for a solution which I can script.

Hope this clarifies y question,

Rainer

Dan Stillman

unread,
Jul 26, 2023, 2:52:26 AM7/26/23
to zoter...@googlegroups.com
I mean, it's API documention — it's for developers. If that's not you, then it's not for you.

The desktop app syncs automatically by default. You can leave it running and the data directory will be in sync, and any regular, automated system backup would back it up along with the rest of your system. Or you can script Zotero opening, waiting long enough for an auto-sync, and closing. How you back up your own system is really up to you, but we provide a desktop app that syncs reliably and stores data locally — I'm not sure what more you want from us.

Sorry, but I don't think we're going to be able to help you further here.
--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/a352b722-a51f-4976-84b6-364d769ab75dn%40googlegroups.com.

Rainer Krug

unread,
Jul 26, 2023, 3:04:19 AM7/26/23
to zotero-dev
In advance: I am looking into improving an essential aspect of Zotero for our needs - I am looking for help here asZotero fulfils our needs except of the backup aspect (I will focus on for now).

Can you give me a link to the manual pages on how I can script Zotero? I did not find anything. Thanks.

Also: on https://www.zotero.org/support/dev/web_api/v3/syncing it says "If you really want to back up your Zotero data specifically, locate your Zotero data, close Zotero,...". This is not done during non-manual backups.

I am working regularly with sqlite, and as far as I know, an sqlite database backup can be corrupted when a backup is done during a write process. So Zotero should be closed during a backup, which I have to script.

As I said, please point me to some info on how I can script Zotero, and it should work.

And: not all developers are API experts...

Dan Stillman

unread,
Jul 26, 2023, 3:10:23 AM7/26/23
to zoter...@googlegroups.com
Just make a regular, incremental backup of the whole data directory and you'll have all your data. It's fine.

Again, we can't help you further here.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages