---
title: "Search for collections"
method: GET
path: "/collections/search"
tags: ["Collections"]
---

# Search for collections

`GET /collections/search`

## Request

- Base URL: `https://api.pics.io`
- URL: `https://api.pics.io/collections/search`
- Auth: HTTP bearer

Finds collections whose name (last path segment) or description contains the query as a case-insensitive substring. Prefer `q` so `/` and `%` stay in the query string; `GET /collections/search/{query}` remains for the web UI. Name matching is limited to the last path segment. Description matching is a substring (e.g. europ matches European). Both queries use a slim projection. `hasChild` is computed at read time from direct children. When `limit` is set, Mongo sorts by last path segment and applies skip/limit; the response is `{ collections, total, offset, limit, has_more, archived_included }`. Without `limit` the response stays a full array for the web UI. `archived=all` is silently treated as `false` when the caller cannot view archives, and `archived_included` on the page wrapper reports the effective inclusion rather than the requested one. `archived=true` without archive access fails. Results are limited to collections the caller can access. Reads from MongoDB.

## Query parameters

- `q` string, required
- `archived` 'true' | 'false' | 'all'
- `limit` integer
- `offset` integer

## Response `200`

Ok

- union
  - Collection[]
    - unknown
  - object
    - `collections` Collection[]
      - unknown
    - `total` integer
    - `offset` integer
    - `limit` integer
    - `has_more` boolean
    - `archived_included` boolean: Effective archive inclusion for this page. `false` when `archived=all` was downgraded because the caller cannot view archives.

## Other responses

- `500`: Collection search error

---

[API](https://skmtc.dev/pics/apis/pics-io-rest-api.md) - [All operations](https://skmtc.dev/pics/apis/pics-io-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pics/apis/pics-io-rest-api/revisions/ea41cba5ac37?raw)
