Skip to content
Skillpedia
Automations51k · #1957

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

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pyzotero/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pyzotero/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
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 pyzotero

Or download just the file:

curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/pyzotero/SKILL.md -o SKILL.md
Technical 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:

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 Zotero instance is bound to a single library (user or group). All methods operate on that library.
  • Item data lives in item['data']. Access fields like item['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, while create_items() returns per-item creation status. Inspect its failed, successful (full saved objects), success (legacy keys), and unchanged mappings 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

repo: K-Dense-AI/scientific-agent-skills

Popularity

GitHub stars
51k
Ranking position
#1957
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills