List collections

Collections and subcollections of the library with their keys and item counts.

GET https://cotlet.dev/api/v1/zotero/collections

read

Returns the collection tree with each key, its parent and the number of items directly in it. Collection names are not unique in Zotero, so use the key and the parent to tell two collections apart.

Parameters

Parameters: list_collections
NameTypeDescription
library string string 'me' for My Library (default) or a group library ID from list_libraries.

Request

cURL
curl https://cotlet.dev/api/v1/zotero/collections \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("zotero", "list_collections")
Node.js
const result = await cotlet.call('zotero', 'list_collections');
CLI
cotlet call zotero list_collections

Example response

JSON

{
  "collections": [
    {
      "collection_key": "C4T8WZ2N",
      "name": "Thesis: related work",
      "parent": null,
      "item_count": 2
    },
    {
      "collection_key": "M2D7FQ4S",
      "name": "Chapter 2",
      "parent": "C4T8WZ2N",
      "item_count": 0
    }
  ]
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.