use API to find item with a DOI/url

190 views
Skip to first unread message

John Kitchin

unread,
Apr 11, 2024, 12:54:08 AM4/11/24
to zotero-dev
Is it possible to search a Zotero database for an item with a specific DOI or url?

The reason I want to do this is I am updating a Zotero db with the API using results from an OpenAlex query, and I don't want to add duplicate items. Ideally I would check for the doi or the url (which is a unique identifier also) and update if it exists, or make a new one if it doesn't.

I tried this with pyzotero, but it doesn't seem to look in the doi or url fields. At the moment I use the title, but this isn't always unique.

Sebastian Karcher

unread,
Apr 11, 2024, 3:23:05 PM4/11/24
to zoter...@googlegroups.com
The relevant API documentation is https://www.zotero.org/support/dev/web_api/v3/basics#search_parameters_items_endpoints -- so no, you can't search specifically by DOI or URL and I'm not sure searching for a DOI in "everything" mode will actually be better than title, because it might give you items citing the DOI in their bibliography. As I understand, the equivalent of the client's "All fields and tags" mode (which would work well for this) will be available via the API in the future, but isn't currently.
Hth,
Sebastian

--
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/182231bf-11c1-461b-8093-41ddbf99d3b4n%40googlegroups.com.


--
Sebastian Karcher, PhD
www.sebastiankarcher.com

Joachim Herb

unread,
Apr 12, 2024, 10:58:30 AM4/12/24
to zotero-dev

This is a proof of concept using a "user script" + Zotero API Endpoint Add-on: https://github.com/zotero/zotero/issues/1007#issuecomment-1432300453

John Kitchin

unread,
Apr 14, 2024, 3:21:15 PM4/14/24
to zotero-dev
My solution to this is to get all the items in the library and then check against that. I don't love it, but it works fine.
Reply all
Reply to author
Forward
0 new messages