Search and read items from the user's Zotero library via the Zotero Web API v3. Use when the user mentions Zotero, references, bibliography, citations, papers, or asks to find/search/list items in their reference library.
Query the user's Zotero library using the Zotero Web API v3.
Credentials are in environment variables ZOTERO_USER_ID and ZOTERO_API_KEY.
Base URL: https://api.zotero.org
All requests must include:
Zotero-API-Key: $ZOTERO_API_KEY
Zotero-API-Version: 3
Use curl -s for all requests.
curl -s -H "Zotero-API-Key: $ZOTERO_API_KEY" -H "Zotero-API-Version: 3" \
"https://api.zotero.org/users/$ZOTERO_USER_ID/items?q=SEARCH_TERM&limit=10&format=json"
curl -s -H "Zotero-API-Key: $ZOTERO_API_KEY" -H "Zotero-API-Version: 3" \
"https://api.zotero.org/users/$ZOTERO_USER_ID/items/top?limit=25&sort=dateModified&direction=desc&format=json"
curl -s -H "Zotero-API-Key: $ZOTERO_API_KEY" -H "Zotero-API-Version: 3" \
"https://api.zotero.org/users/$ZOTERO_USER_ID/items/ITEM_KEY?format=json"
curl -s -H "Zotero-API-Key: $ZOTERO_API_KEY" -H "Zotero-API-Version: 3" \
"https://api.zotero.org/users/$ZOTERO_USER_ID/collections?format=json"
curl -s -H "Zotero-API-Key: $ZOTERO_API_KEY" -H "Zotero-API-Version: 3" \
"https://api.zotero.org/users/$ZOTERO_USER_ID/collections/COLLECTION_KEY/items/top?format=json&limit=25"
curl -s -H "Zotero-API-Key: $ZOTERO_API_KEY" -H "Zotero-API-Version: 3" \
"https://api.zotero.org/users/$ZOTERO_USER_ID/items?tag=TAG_NAME&format=json&limit=25"
curl -s -H "Zotero-API-Key: $ZOTERO_API_KEY" -H "Zotero-API-Version: 3" \
"https://api.zotero.org/users/$ZOTERO_USER_ID/tags?limit=100&format=json"
q=TERM — full-text searchqmode=titleCreatorYear — restrict search to title, creator, yeartag=NAME — filter by tag (repeat for AND: tag=a&tag=b)itemType=journalArticle — filter by type (book, conferencePaper, thesis, etc.)sort=dateAdded|dateModified|title|creator|date — sort fielddirection=asc|desc — sort directionlimit=N — max results (1-100, default 50)start=N — offset for paginationWhen presenting items to the user, extract and display:
data.titledata.creators[] (each has firstName, lastName, creatorType)data.datedata.publicationTitle or data.bookTitledata.DOIdata.urldata.tags[].tagdata.abstractNotedata.key (for follow-up queries)Format authors as "LastName, FirstName" and present results in a readable way. Mention the item key so the user can ask for more details on specific items.
Total-Results header if you need counts. Use start param to page through large result sets./users/$ZOTERO_USER_ID/ with /groups/GROUP_ID/.