---
type: api
title: Get package stats
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-get-fleet-epm-packages-pkgname-stats
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-get-fleet-epm-packages-pkgname-stats
products:
  - Kibana
---

# Get package stats

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/fleet/epm/packages/{pkgName}/stats`
- `GET` `/s/{space_id}/api/fleet/epm/packages/{pkgName}/stats`

#### Path parameters

- `pkgName` (string) — required
  Package name

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Get usage statistics for a specific package, such as the number of agent policies using it.

## Required authorization

- Privileges: `integrations-read` or `fleet-setup` or `fleet-all`

## Authentication

- Api key: `Authorization: <value>`
  You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys).

## Responses

#### `200`

Successful response

`application/json`

- `response` (object)
  - `agent_policy_count` (number)
  - `package_policy_count` (number)
#### `400`

Bad Request

`application/json`

- `attributes` (object)
- `error` (string)
- `errorType` (string)
- `message` (string)
- `statusCode` (number)
## Code examples

#### Console

```console
GET kbn:/api/fleet/epm/packages/PKG_NAME/stats
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/fleet/epm/packages/${PKG_NAME}/stats" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Get package stats

Usage stats for a specific package

```json
{
  "response": {
    "agent_policy_count": 3
  }
}
```

#### Generic error response

Example of a generic error response

```json
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}
```

