Python wrapper for the Zotero API, enabling programmatic access to Zotero libraries for managing research references, collections, and items. It's currently at version 1.11.0 and typically releases new versions every few months, often including bug fixes and minor enhancements.
pip install pyzoteroVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes the Zotero client and fetches the first few collections and items from your library. It demonstrates accessing nested data fields and uses environment variables for secure credential management.
Always access item or collection properties via `item['data']['title']` or `collection['data']['name']`.
To retrieve all items or collections, use the `all_items()` or `all_collections()` methods (e.g., `zot.all_items()`). Alternatively, implement manual pagination using `limit` and `start` parameters.
Before making API calls, verify that your Zotero API key has the required permissions configured in your Zotero account settings (https://www.zotero.org/settings/keys).
Access fields via `item['data']['title']` or `collection['data']['name']`. The Zotero API response structure always wraps core data in a 'data' field.
Double-check your `library_id`, `api_key`, and ensure the `library_type` matches your Zotero setup. Verify that the API key has the necessary permissions (e.g., read access for fetching data) in your Zotero account.
For comprehensive lists, use `zot.all_items()` or `zot.all_collections()`. These methods handle pagination internally to retrieve all available entries. Alternatively, use the `limit` and `start` parameters on `zot.items()` for manual pagination.