Skip to content

GOKORURI007/zotero-api-plus

Repository files navigation

Zotero API Plus

zotero target version License: AGPL-3.0-or-later

English | 简体中文

A Zotero plugin that extends Zotero's local API with additional functionality.

Features

  • Extends Zotero's local API with custom endpoints
  • Add items to Zotero by identifier (DOI, ISBN, PMID, etc.) via API
  • Health check endpoint to verify plugin status
  • Easy integration with other tools and scripts

API Endpoints

Health Check

GET /api/plus

Returns a simple message indicating the API is running.

Response

Zotero Local API Plus is running.

Add Item by Identifier

POST /api/plus/add-item-by-id
Content-Type: application/json

Adds items to Zotero using identifiers like DOI, ISBN, PMID, etc.

Request Body

{
  "identifier": "10.1038/nature12373", // Required: DOI, ISBN, PMID, etc.
  "collectionKey": "ABC123" // Optional: Collection key to add items to
}

Response

{
  "status": "success",
  "addedCount": 1,
  "titles": ["Article Title"]
}

Get Selected Collection

GET /api/plus/selected-collection

Returns information about the currently selected collection in Zotero.

Response

{
  "name": "My Collection",
  "key": "ABC123"
}

Error Response

No Collection selected.

Installation

  1. Download the latest release from the GitHub Releases page.
  2. In Zotero, go to Tools > Add-ons.
  3. Click the gear icon and select Install Add-on From File....
  4. Select the downloaded .xpi file.
  5. Restart Zotero.

Usage

  1. Ensure Zotero's local API is enabled (go to Edit > Preferences > Advanced > Files and Folders > Show Data Directory, then edit prefs.js and add user_pref("extensions.zotero.httpServer.enabled", true);).
  2. Use the API endpoints as described above.

Development

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

npm install
npm run start

Build

npm run build

Lint

npm run lint:check

License

AGPL-3.0-or-later

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

A Zotero plugin that extends Zotero's local API with additional functionality.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors