
Pyzotero
Connect an agent to your Zotero library with pyzotero using env-based credentials to search, fetch, and manage citations during research.
Overview
Pyzotero is an agent skill most often used in Idea (also Build docs) that configures the pyzotero client and Zotero API credentials for agent-driven bibliography workflows.
Install
npx skills add https://github.com/k-dense-ai/scientific-agent-skills --skill pyzoteroWhat is this skill?
- Authenticate with ZOTERO_LIBRARY_ID, ZOTERO_API_KEY, and optional ZOTERO_LIBRARY_TYPE via python-dotenv
- Credential map for user ID, API key creation paths, and group library ID from group URLs
- Personal user libraries and group libraries with integer group ID as library_id
- Security guidance: never hardcode API keys; use .env scoped to ZOTERO_* only
- Official pyzotero Zotero client initialization pattern for agents
- 3 Zotero credential fields documented (user ID, API key, group library ID)
Adoption & trust: 551 installs on skills.sh; 27.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want your agent to read or update Zotero items but lack a safe, repeatable auth and library-type setup.
Who is it for?
Solo builders, indie researchers, and scientific agents automating citations from a personal or group Zotero library.
Skip if: Teams without a Zotero account, offline-only workflows, or projects that only need static BibTeX files with no API sync.
When should I use this skill?
Agent workflows need read/write access to Zotero personal or group libraries via pyzotero with secure credential loading.
What do I get? / Deliverables
You have env-based Zotero credentials and a working Zotero() client for user or group libraries ready for downstream search and item operations.
- Configured Zotero API client
- Documented library_type (user vs group)
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Idea/research is the primary shelf because the skill centers on bibliographic library access before and during product or thesis discovery. research covers literature libraries, API keys, and personal vs group Zotero collections—not app frontend work.
Where it fits
Initialize a user-library Zotero client to list recent items while exploring a product niche.
Attach a group library ID to pull shared papers your cofounder curated on a market segment.
Fetch tagged collections from Zotero to justify feature inclusion in a lean PRD.
Reuse stored references when the agent drafts technical documentation with linked sources.
How it compares
Zotero API setup via pyzotero—not a paper PDF scraper or generic web research skill.
Common Questions / FAQ
Who is pyzotero for?
Developers and researchers using agentic coding tools who store sources in Zotero and need programmatic library access with proper key handling.
When should I use pyzotero?
In Idea research while gathering literature; in Build docs when agents must pull citations into specs or READMEs; in Validate scope when evidence from your library informs what to build.
Is pyzotero safe to install?
It instructs API key use via environment variables—never commit keys; review the Security Audits panel on this Prism page before installing.
SKILL.md
READMESKILL.md - Pyzotero
# Authentication & Setup > **Security:** Never hardcode API keys in source code or commit them to version control. Use environment variables or a `.env` file scoped to `ZOTERO_*` keys only. Placeholder values like `ABC1234XYZ` below are illustrative — substitute your real credentials from env vars. ## Credentials Obtain from https://www.zotero.org/settings/keys (or create a key at https://www.zotero.org/settings/keys/new): | Credential | Where to Find | |-----------|---------------| | **User ID** | "Your userID for use in API calls" section | | **API Key** | Create new key at /settings/keys/new, or via Settings → Security → Applications → "Create new key" at https://www.zotero.org/settings/security | | **Group Library ID** | Integer after `/groups/` in group URL (e.g. `https://www.zotero.org/groups/169947`) | ## Environment Variables (recommended) Store in `.env` or export in shell: ``` ZOTERO_LIBRARY_ID=436 ZOTERO_API_KEY=your_api_key_here ZOTERO_LIBRARY_TYPE=user ``` Load in Python: ```python import os from dotenv import load_dotenv from pyzotero import Zotero load_dotenv() 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'], ) ``` ## Library Types ```python import os # Personal library zot = Zotero( os.environ['ZOTERO_LIBRARY_ID'], 'user', os.environ['ZOTERO_API_KEY'], ) # Group library — use the group ID as library_id zot = Zotero('169947', 'group', os.environ['ZOTERO_API_KEY']) ``` **Important**: A `Zotero` instance is bound to a single library. To access multiple libraries, create multiple instances. ## Local Mode (Read-Only) Connect to your local Zotero installation without an API key. Only supports read requests. ```python zot = Zotero(library_id='436', library_type='user', local=True) items = zot.items(limit=10) # reads from local Zotero ``` For Zotero 7, enable local API access: Settings → Advanced → "Allow other applications on this computer to communicate with Zotero". See [cli.md](cli.md) and [mcp.md](mcp.md) for richer local access. ## Optional Parameters ```python zot = Zotero( library_id=os.environ['ZOTERO_LIBRARY_ID'], library_type='user', api_key=os.environ['ZOTERO_API_KEY'], preserve_json_order=True, # use OrderedDict for JSON responses locale='en-US', # localise field names (e.g. 'fr-FR' for French) ) ``` ## Key Permissions Check what the current API key can access: ```python info = zot.key_info() # Returns dict with user info and group access permissions ``` Check accessible groups: ```python groups = zot.groups() # Returns list of group libraries accessible to the current key ``` ## API Key Scopes When creating an API key at https://www.zotero.org/settings/keys/new, choose appropriate permissions: - **Read Only**: For retrieving items and collections - **Write Access**: For creating, updating, and deleting items - **Notes Access**: To include notes in read/write operations - **Files Access**: Required for uploading attachments # Command-Line Interface The pyzotero CLI connects to your **local Zotero 7 installation** (not the remote Web API). It requires a running Zotero desktop app with local API access enabled: **Zotero → Settings → Advanced → Allow other applications on this computer to communicate with Zotero** ## Installation ```bash uv add "pyzotero[cli]" # or run without installing: uvx --from "pyzotero[cli]" pyzotero search -q "your query" ``` ## Searching ```bash # Search titles and metadata pyzotero search -q "machine learning" # Full-text search (includes PDF content) pyzotero search -q "climate change" --fulltext # Filter by item type pyzotero search -q "methodology" --itemtype journalArticle --itemtype book # Filter by tags (AND logic) pyzotero search -q "evolution" --tag "reviewed" --tag "high-priority" # Search within a collection pyzotero search --collection ABC123 -q "test" # Paginate res