---
title: "Get number of key-value pairs in collection"
method: GET
path: "/_fabric/{fabric}/_api/kv/{collection}/count"
tags: ["Key Value"]
---

# Get number of key-value pairs in collection

`GET /_fabric/{fabric}/_api/kv/{collection}/count`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/kv/:collection/count/get.ts> (a function with typed inputs; its response is checked against the schema)

Get number of key-value pairs in collection.

## Path parameters

- `fabric` string, string, required
- `collection` string, string, required

## Query parameters

- `groupID` string, string

## Response `200`

Successfully fetched number of key-value pairs.

- KvExamplesRc200
  - `code` integer: HTTP response code.
  - `error` boolean, required: Flag if there is an error in response. *False* for this response.
  - `name` string: It shows name of the collection.
  - `count` integer: It gives kv count.

## Other responses

- `404`: Failed to find specified fabric or collection.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
