Zotero API question to retrieve all items in Library

200 views
Skip to first unread message

rka...@umrpc.com

unread,
May 24, 2021, 12:23:48 AM5/24/21
to zotero-dev
What is the API Syntax to retrieve all items in a library, including items inside collections and nested collections?

I tried this and I am only seeing a few top level items but none of the items within collections

https://api.zotero.org/users/XXXXXX/items?format=json&key=XXXXXXXXXXXX&v=3

Dan Stillman

unread,
May 24, 2021, 12:30:15 AM5/24/21
to zoter...@googlegroups.com
That's how you do it. Assuming you're looking at the right library, most likely you're not accounting for pagination [1] and are only looking at the first 25 items (and are overlooking child items in the response, since getting only top-level items is a different endpoint).

While you can use the API directly if you're comfortable doing so, for most projects using a client library [2] such as pyzotero will make things easier.

[1] https://www.zotero.org/support/dev/web_api/v3/basics#sorting_and_pagination
[2] https://www.zotero.org/support/dev/web_api/v3/start#client_libraries
Reply all
Reply to author
Forward
0 new messages