pyzotero
Lets your agent manage reference libraries in Zotero. It's useful for organizing research and citations automatically.
What it does
This program helps you manage your bibliographic references in Zotero. You can automatically search, add, modify, or remove items, collections, and attachments.
When to use it
- ✓When you need to organize many scientific articles.
- ✓When exporting citations for academic work.
- ✓If you want to automate uploading PDFs to your references.
Example of what to ask your AI
“Search for all articles about artificial intelligence in my Zotero library and export them as BibTeX.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It connects to your Zotero account using your credentials. Then, you can give commands to read, write, or modify your references.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add K-Dense-AI/scientific-agent-skills --skill pyzoteroOr download just the file:
curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/pyzotero/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Pyzotero
Pyzotero is a Python wrapper for the Zotero API v3. Use it to programmatically manage Zotero libraries: read items and collections, create and update references, upload attachments, manage tags, and export citations.
Reviewed target: pyzotero 1.15.2 on 2026-09-30. Checked official SDK documentation, release source, and Web API contracts. Examples requiring a private library or running Zotero are illustrative; read-only public probes and isolated SDK contract checks do not establish authenticated write success.
Authentication Setup
For remote private reads and writes, get credentials from https://www.zotero.org/settings/keys:
- User ID: shown as "Your userID for use in API calls"
- API Key: create at https://www.zotero.org/settings/keys/new
- Library ID: for group libraries, the integer after
/groups/in the group URL
Store credentials in environment variables or a .env file:
ZOTERO_LIBRARY_ID=your_user_id
ZOTERO_API_KEY=your_api_key
ZOTERO_LIBRARY_TYPE=user # or "group"
See references/authentication.md for full setup details.
Installation
uv add "pyzotero==1.15.2" # Reviewed Web API client
uv add "pyzotero[cli]==1.15.2" # + local CLI
uv add "pyzotero[mcp]==1.15.2" # + MCP server
Quick Start
import os
from pyzotero import Zotero
zot = Zotero(
library_id=os.environ['ZOTERO_LIBRARY_ID'],
library_type=os.environ.get('ZOTERO_LIBRARY_TYPE', 'user'),
api_key=os.environ['ZOTERO_API_KEY'],
)
# Retrieve top-level items (returns 100 by default)
items = zot.top(limit=10)
for item in items:
print(item['data'].get('title', ''), item['data']['itemType'])
# Search by keyword
results = zot.items(q='machine learning', limit=20)
# Retrieve all items (use everything() for complete results)
all_items = zot.everything(zot.items())
Core Concepts
- A
Zoteroinstance is bound to a single library (user or group). All methods operate on that library. - Item data lives in
item['data']. Access fields likeitem['data']['title'],item['data']['creators']. - Pyzotero returns 100 items by default (API default is 25). Use
zot.everything(zot.items())to get all items. - Return types are method-specific:
update_item()reports Boolean success, whilecreate_items()returns per-item creation status. Inspect itsfailed,successful(full saved objects),success(legacy keys), andunchangedmappings and retain the input-index-to-key mapping. A truthy response dictionary does not establish that every item was created; report partial failures and retry only the failed inputs after reconciliation. See the write-method contracts.
Reference Files
| File | Contents |
|---|---|
| references/authentication.md | Credentials, library types, local mode |
| references/read-api.md | Retrieving items, collections, tags, groups |
| references/search-params.md | Filtering, sorting, search parameters |
| references/write-api.md | Creating, updating, deleting items |
| references/collections.md | Collection CRUD operations |
| references/tags.md | Tag access and management |
| references/files-attachments.md | File download and attachment uploads |
| references/exports.md | BibTeX, CSL-JSON, bibliography export |
| references/pagination.md | follow(), everything(), generators |
| references/full-text.md | Full-text content indexing and access |
| references/saved-searches.md | Saved search management |
| references/cli.md | Command-line interface (local Zotero) |
| references/mcp.md | MCP server for LLM clients (local Zotero) |
| references/error-handling.md | Errors and exception handling |
Common Patterns
Fetch and modify an item
item = zot.item('ITEMKEY')
item['data']['title'] = 'New Title'
zot.update_item(item)
…
FAQ
Do I need to have Zotero installed?
Yes, to use the local version, you need to have Zotero installed and configured.
How does the program know which library to use?
You need to provide your User ID, API Key, and library type (user or group) for it to connect correctly.
Can I add PDF files to my references?
Yes, the program allows uploading attachments, such as PDF files, to the items in your Zotero library.
Details
Original description by the author
Manages Zotero reference libraries using the pyzotero Python client: retrieves, creates, updates, and deletes items, collections, tags, and attachments via the Zotero Web API v3 or local API. Applies when working with Zotero libraries programmatically, managing bibliographic references, exporting citations, searching library contents, uploading PDF attachments, or building research automation work
Popularity
- GitHub stars
- 51k
- Ranking position
- #1957
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
13c-metabolic-flux
Estimates metabolic fluxes using carbon-13 isotope tracing data. It is useful for analyzing cellular metabolism and biochemical pathways.
K-Dense-AI/scientific-agent-skills
adaptyv
Designs protein characterization experiments using the Adaptyv API. It helps estimate costs, submit sequences, and monitor lab results.
K-Dense-AI/scientific-agent-skills
aeon
Performs machine learning tasks on time series data. It is useful for classifying, forecasting, detecting anomalies, and finding patterns in sequential data.
K-Dense-AI/scientific-agent-skills
alphagenome
Looks up precomputed genomic effects for genetic variants. It provides scores and explanations to understand the impact of variants on the genome.
K-Dense-AI/scientific-agent-skills
Similar skills
benchmark
Helps your agent measure code speed and performance. It's useful for ensuring things are fast and finding slowness issues.
affaan-m/ECC
content-hash-cache-pattern
Lets your agent use content hashes to cache file processing results. This avoids repeated processing and auto-invalidates the cache when content changes. Useful for speeding up slow tasks.
affaan-m/ECC
parallel-execution-optimizer
Makes your agent speed up complex tasks by breaking them into smaller parts and running them in parallel. It ensures everything is verified at the end.
affaan-m/ECC