---
title: "List metrics"
method: GET
path: "/api/v2/metrics/{projectKey}"
tags: ["Metrics"]
---

# List metrics

`GET /api/v2/metrics/{projectKey}`

Get a list of all metrics for the specified project.

### Filtering metrics

The `filter` parameter supports the following operators: `contains`, `equals`, `anyOf`.

#### Supported fields and operators

You can only filter certain fields in metrics when using the `filter` parameter. Additionally, you can only filter some fields with certain operators.

When you search for metrics, the `filter` parameter supports the following fields and operators:

|<div style="width:120px">Field</div> |Description |Supported operators |
|---|---|---|
| `eventKind` | The metric event kind. One of `custom`, `pageview`, `click`. | `equals` |
| `hasConnections` | Whether the metric has connections to experiments or guarded rollouts. One of `true`, `false`. | `equals` |
| `isNumeric` | Whether the metric is numeric. One of `true`, `false`. | `equals` |
| `maintainerIds` | A comma-separated list of metric maintainer IDs. | `anyOf` |
| `maintainerTeamKey` | The metric maintainer team key. | `equals` |
| `metricUsedIn` | Filter by where the metric is used. One of `experiments`, `guarded_rollouts`, `any`, `none`. | `equals` |
| `query` | A "fuzzy" search across metric key and name. Supply a string or list of strings to the operator. | `equals` |
| `tags` | The metric tags. | `contains` |
| `unitAggregationType` | The metric's unit aggregation type. One of `sum`, `average`. | `equals` |

For example, the filter `?filter=tags contains ["tag1", "tag2", "tag3"]` matches metrics that have all three tags.

The documented values for `filter` query parameters are prior to URL encoding. For example, the `[` in `?filter=tags contains ["tag1", "tag2", "tag3"]` must be encoded to `%5B`.

### Expanding the metric list response

LaunchDarkly supports expanding the "List metrics" response. By default, the expandable field is **not** included in the response.

To expand the response, append the `expand` query parameter and add the following supported field:

- `experimentCount` includes the number of experiments from the specific project that use the metric

For example, `expand=experimentCount` includes the `experimentCount` field for each metric in the response.

## Path parameters

- `projectKey` string, string, required — The project key

## Query parameters

- `expand` string, string — A comma-separated list of properties that can reveal additional information in the response.
- `limit` integer — The number of metrics to return in the response. Defaults to 20. Maximum limit is 50.
- `offset` integer — Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.
- `sort` string, string — A field to sort the items by. Prefix field by a dash ( - ) to sort in descending order. This endpoint supports sorting by `createdAt` or `name`.
- `filter` string, string — A comma-separated list of filters. This endpoint accepts filtering by `query`, `tags`, 'eventKind', 'isNumeric', 'unitAggregationType`, `hasConnections`, `maintainerIds`, `maintainerTeamKey`, `view`, `dataSourceKeys`, and `metricUsedIn`. To learn more about the filter syntax, read the 'Filtering metrics' section above.

## Response `200`

Metrics collection response

- MetricCollectionRep
  - `items` MetricListingRep[] — An array of metrics
    - `experimentCount` integer — The number of experiments using this metric
    - `metricGroupCount` integer — The number of metric groups using this metric
    - `activeExperimentCount` integer — The number of active experiments using this metric
    - `activeGuardedRolloutCount` integer — The number of active guarded rollouts using this metric
    - `_id` string, required — The ID of this metric
    - `_versionId` string, required — The version ID of the metric
    - `_version` integer — Version of the metric
    - `key` string, required — A unique key to reference the metric
    - `name` string, required — A human-friendly name for the metric
    - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
    - `_attachedFlagCount` integer — The number of feature flags currently attached to this metric
    - `_links` object, required — The location and content type of related resources
    - `_site` Link
      - `href` string
      - `type` string
    - `_access` Access
      - `denied` AccessDenied[], required
        - `action` string, required
        - `reason` AccessDeniedReason, required
          - `resources` string[] — Resource specifier strings
          - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
          - `actions` ActionSpecifier[] — Actions to perform on a resource
          - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
          - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
          - `role_name` string
      - `allowed` AccessAllowedRep[], required
        - `action` string, required
        - `reason` AccessAllowedReason, required
          - `resources` string[] — Resource specifier strings
          - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
          - `actions` ActionSpecifier[] — Actions to perform on a resource
          - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
          - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
          - `role_name` string
    - `tags` string[], required — Tags for the metric
    - `_creationDate` integer, required
    - `lastModified` Modification
      - `date` string, date-time
    - `maintainerId` string — The ID of the member who maintains this metric
    - `_maintainer` MemberSummary
      - `_links` object, required — The location and content type of related resources
      - `_id` string, required — The member's ID
      - `firstName` string — The member's first name
      - `lastName` string — The member's last name
      - `role` string, required — The member's base role. If the member has no additional roles, this role will be in effect.
      - `email` string, required — The member's email address
    - `description` string — Description of the metric
    - `category` string — The category of the metric
    - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
    - `successCriteria` 'HigherThanBaseline' | 'LowerThanBaseline' — For custom metrics, the success criteria
    - `unit` string — For numeric custom metrics, the unit of measure
    - `eventKey` string — For custom metrics, the event key to use in your code
    - `randomizationUnits` string[] — An array of randomization units allowed for this metric
    - `filters` Filter
      - `type` 'group' | 'contextAttribute' | 'eventProperty', required — Filter type. One of [contextAttribute, eventProperty, group]
      - `attribute` string — If not a group node, the context attribute name or event property name to filter on
      - `op` string, required
      - `values` unknown[], required — The context attribute / event property values or group member nodes
        - unknown
      - `contextKind` string — For context attribute filters, the context kind.
      - `negate` boolean, required — If set, then take the inverse of the operator. 'in' becomes 'not in'.
    - `unitAggregationType` 'average' | 'sum' — The method by which multiple unit event values are aggregated
    - `analysisType` 'mean' | 'percentile' — The method for analyzing metric events
    - `percentileValue` integer — The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when <code>analysisType</code> is <code>percentile</code>.
    - `eventDefault` MetricEventDefaultRep
      - `disabled` boolean — Whether to disable defaulting missing unit events when calculating results. Defaults to false
      - `value` number — The default value applied to missing unit events. Set to 0 when <code>disabled</code> is false. No other values are currently supported.
    - `dataSource` MetricDataSourceRefRep, required
      - `key` string, required
      - `environmentKey` string
      - `_name` string
      - `_integrationKey` string
    - `lastSeen` integer
    - `archived` boolean — Whether the metric version is archived
    - `archivedAt` integer
    - `selector` string — For click metrics, the CSS selectors
    - `urls` UrlMatcher[]
  - `_links` object — The location and content type of related resources
  - `totalCount` integer

## Other responses

- `401` — Invalid access token
- `404` — Invalid resource identifier

## Changes

- **2026-02-28** `69c5c9aafe78` — 9 info
  - added the optional property `items/items/_version` to the response with the `200` status
  - added the optional property `items/items/activeExperimentCount` to the response with the `200` status
  - added the optional property `items/items/activeGuardedRolloutCount` to the response with the `200` status
  - added the optional property `items/items/archived` to the response with the `200` status
  - …5 more

[Change history](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/changes/api/v2/metrics/:projectKey/get.md)

---

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