---
title: "Count points"
method: POST
path: "/collections/{collection_name}/points/count"
tags: ["points"]
---

# Count points

`POST /collections/{collection_name}/points/count`

Count points which matches given filtering condition

## Path parameters

- `collection_name` string, required

## Query parameters

- `timeout` integer

## Request body

- CountRequest — Count Request Counts the number of points which satisfy the given filter. If filter is not provided, the count of all points in the collection will be returned.
  - `shard_key` union — Specify in which shards to look for the points, if not specified - look in all shards
    - union
      - union
        - string
        - integer
      - ShardKey[]
        - union
          - string
          - integer
    - unknown
  - `filter` union — Look only for points which satisfies this conditions
    - Filter
      - `should` union — At least one of those conditions should match
        - union
          - FieldCondition — All possible payload filtering conditions
            - `key` string, required — Payload key
            - `match` union — Check if point has field with a given value
              - …
            - `range` union — Check if points value lies in a given range
              - …
            - `geo_bounding_box` union — Check if points geo location lies in a given area
              - …
            - `geo_radius` union — Check if geo point is within a given radius
              - …
            - `geo_polygon` union — Check if geo point is within a given polygon
              - …
            - `values_count` union — Check number of values of the field
              - …
          - IsEmptyCondition — Select points with empty payload for a specified field
            - `is_empty` PayloadField, required — Payload field
              - …
          - IsNullCondition — Select points with null payload for a specified field
            - `is_null` PayloadField, required — Payload field
              - …
          - HasIdCondition — ID-based filtering condition
            - `has_id` ExtendedPointId[], required
              - …
          - NestedCondition
            - `nested` Nested, required — Select points with payload for a specified nested field
              - …
          - Filter — recursive
        - Condition[]
          - union
            - FieldCondition — All possible payload filtering conditions
              - …
            - IsEmptyCondition — Select points with empty payload for a specified field
              - …
            - IsNullCondition — Select points with null payload for a specified field
              - …
            - HasIdCondition — ID-based filtering condition
              - …
            - NestedCondition
              - …
            - Filter — recursive
        - unknown
      - `min_should` union — At least minimum amount of given conditions should match
        - MinShould
          - `conditions` Condition[], required
            - union
              - …
          - `min_count` integer, required
        - unknown
      - `must` union — All conditions must match
        - union
          - FieldCondition — All possible payload filtering conditions
            - `key` string, required — Payload key
            - `match` union — Check if point has field with a given value
              - …
            - `range` union — Check if points value lies in a given range
              - …
            - `geo_bounding_box` union — Check if points geo location lies in a given area
              - …
            - `geo_radius` union — Check if geo point is within a given radius
              - …
            - `geo_polygon` union — Check if geo point is within a given polygon
              - …
            - `values_count` union — Check number of values of the field
              - …
          - IsEmptyCondition — Select points with empty payload for a specified field
            - `is_empty` PayloadField, required — Payload field
              - …
          - IsNullCondition — Select points with null payload for a specified field
            - `is_null` PayloadField, required — Payload field
              - …
          - HasIdCondition — ID-based filtering condition
            - `has_id` ExtendedPointId[], required
              - …
          - NestedCondition
            - `nested` Nested, required — Select points with payload for a specified nested field
              - …
          - Filter — recursive
        - Condition[]
          - union
            - FieldCondition — All possible payload filtering conditions
              - …
            - IsEmptyCondition — Select points with empty payload for a specified field
              - …
            - IsNullCondition — Select points with null payload for a specified field
              - …
            - HasIdCondition — ID-based filtering condition
              - …
            - NestedCondition
              - …
            - Filter — recursive
        - unknown
      - `must_not` union — All conditions must NOT match
        - union
          - FieldCondition — All possible payload filtering conditions
            - `key` string, required — Payload key
            - `match` union — Check if point has field with a given value
              - …
            - `range` union — Check if points value lies in a given range
              - …
            - `geo_bounding_box` union — Check if points geo location lies in a given area
              - …
            - `geo_radius` union — Check if geo point is within a given radius
              - …
            - `geo_polygon` union — Check if geo point is within a given polygon
              - …
            - `values_count` union — Check number of values of the field
              - …
          - IsEmptyCondition — Select points with empty payload for a specified field
            - `is_empty` PayloadField, required — Payload field
              - …
          - IsNullCondition — Select points with null payload for a specified field
            - `is_null` PayloadField, required — Payload field
              - …
          - HasIdCondition — ID-based filtering condition
            - `has_id` ExtendedPointId[], required
              - …
          - NestedCondition
            - `nested` Nested, required — Select points with payload for a specified nested field
              - …
          - Filter — recursive
        - Condition[]
          - union
            - FieldCondition — All possible payload filtering conditions
              - …
            - IsEmptyCondition — Select points with empty payload for a specified field
              - …
            - IsNullCondition — Select points with null payload for a specified field
              - …
            - HasIdCondition — ID-based filtering condition
              - …
            - NestedCondition
              - …
            - Filter — recursive
        - unknown
    - unknown
  - `exact` boolean — If true, count exact number of points. If false, count approximate number of points faster. Approximate count might be unreliable during the indexing process. Default: true

## Response `200`

successful operation

- object
  - `time` number, float — Time spent to process this request
  - `status` string
  - `result` CountResult
    - `count` integer, required — Number of points which satisfy the conditions

## Other responses

- `default` — error
- `4XX` — error

## Changes

- **2024-08-13** `d530ad1be7de` — 9 breaking, 10 info
  - removed `subschema #1, subschema #2` from the `filter/anyOf[#/components/schemas/Filter]/min_should/anyOf[#/components/schemas/MinShould]/conditions/items/anyOf[#/components/schemas/HasIdCondition]/has_id/items/` request property `anyOf` list
  - removed `subschema #1, subschema #2` from the `filter/anyOf[#/components/schemas/Filter]/must/anyOf[#/components/schemas/Condition]/anyOf[#/components/schemas/HasIdCondition]/has_id/items/` request property `anyOf` list
  - removed `subschema #1, subschema #2` from the `filter/anyOf[#/components/schemas/Filter]/must/anyOf[subschema #2]/items/anyOf[#/components/schemas/HasIdCondition]/has_id/items/` request property `anyOf` list
  - removed `subschema #1, subschema #2` from the `filter/anyOf[#/components/schemas/Filter]/must_not/anyOf[#/components/schemas/Condition]/anyOf[#/components/schemas/HasIdCondition]/has_id/items/` request property `anyOf` list
  - …15 more
- **2024-05-29** `971f862f5823` — 6 breaking, 3 info
  - the request property `filter/anyOf[#/components/schemas/Filter]/must` became not nullable
  - the request property `filter/anyOf[#/components/schemas/Filter]/must_not` became not nullable
  - the request property `filter/anyOf[#/components/schemas/Filter]/should` became not nullable
  - the `filter/anyOf[#/components/schemas/Filter]/must` request property type changed from `array` to no type
  - …5 more

[Change history](https://skmtc.dev/qdrant/apis/qdrant-api/changes/collections/:collection_name/points/count/post.md)

---

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