---
title: "SEARCH: Search documents from the collection"
method: GET
path: "/{collection}"
tags: ["generic"]
---

# SEARCH: Search documents from the collection

`GET /{collection}`

General search operation through documents of one collection, matching the specified filtering criteria. You can apply&#58;

1) filtering - combining any number of filtering parameters

2) ordering - using `sort` or `sort$desc` parameter

3) paging - using `limit` and `skip` parameters

If successful, HTTP 200 code is returned with JSON array of matching documents as a response content (it may be empty).

This operation requires `read` permission for the API and the collection (e.g. `*:*:read`, `api:*:read`, `*:treatments:read`, `api:treatments:read`).

The only exception is the `settings` collection which requires `admin` permission (`api:settings:admin`), because the settings of each application should be isolated and kept secret. You need to know the concrete identifier to access the app's settings.

## Query parameters

- `filter_parameters` string
- `sort` string
- `sort$desc` string
- `limit` integer
- `skip` integer
- `fields` string

## Response `200`

Successful operation returning array of documents matching the filtering criteria

- object
  - `status` integer
  - `result` DocumentArray — unresolved $ref

## Other responses

- `400` — The request is malformed. There may be some required parameters missing or there are unrecognized parameters present.
- `401` — The request was not successfully authenticated using JWT, so that the request cannot continue due to the security policy.
- `403` — Insecure HTTP scheme used or the request has been successfully authenticated, but the security subject is not authorized for the operation.
- `404` — The collection or document specified was not found.
- `406` — The requested content type (in `Accept` header) is not supported.

## Changes

- **2026-07-17** `5b0d424433e1` — 1 info
  - the endpoint scheme security `accessToken` was removed from the API
- **2021-01-07** `8252719e8e34` — 2 breaking, 11 info
  - the response's body type/format changed from `object`/`` to ``/`` for status `200`
  - removed the success response with the status `204`
  - the endpoint scheme security `accessToken` was added to the API
  - the endpoint scheme security `jwtoken` was added to the API
  - …9 more
- **2020-01-12** `4f4eedb269d0` — 3 info
  - added the media type `application/xml` for the response with the status `200`
  - added the media type `text/csv` for the response with the status `200`
  - added the non-success response with the status `406`
- **2019-11-02** `6b2eb690f4ab` — 6 info
  - added the optional property `oneOf[#/components/schemas/DeviceStatusArray]/items/allOf[#/components/schemas/DocumentBase]/isReadOnly` to the response with the `200` status
  - added the optional property `oneOf[#/components/schemas/EntryArray]/items/allOf[#/components/schemas/DocumentBase]/isReadOnly` to the response with the `200` status
  - added the optional property `oneOf[#/components/schemas/FoodArray]/items/allOf[#/components/schemas/DocumentBase]/isReadOnly` to the response with the `200` status
  - added the optional property `oneOf[#/components/schemas/ProfileArray]/items/allOf[#/components/schemas/DocumentBase]/isReadOnly` to the response with the `200` status
  - …2 more
- …earlier changes not shown

[Full history](https://skmtc.dev/nightscout/apis/nightscout-api/changes/:collection/get.md)

---

[API](https://skmtc.dev/nightscout/apis/nightscout-api.md) · [All operations](https://skmtc.dev/nightscout/apis/nightscout-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nightscout/nightscout-api/revisions/5b0d424433e1/schema)
