---
title: "Get code references statistics for flags"
method: GET
path: "/api/v2/code-refs/statistics/{projectKey}"
tags: ["Code references"]
---

# Get code references statistics for flags

`GET /api/v2/code-refs/statistics/{projectKey}`

Get statistics about all the code references across repositories for all flags in your project that have code references in the default branch, for example, `main`. Optionally, you can include the `flagKey` query parameter to limit your request to statistics about code references for a single flag. This endpoint returns the number of references to your flag keys in your repositories, as well as a link to each repository.

## Path parameters

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

## Query parameters

- `flagKey` string, string — Filter results to a specific flag key

## Response `200`

Statistic collection response

- StatisticCollectionRep
  - `flags` object, required — A map of flag keys to a list of code reference statistics for each code repository in which the flag key appears
  - `_links` object, required — The location and content type of related resources

## Other responses

- `401` — Invalid access token
- `403` — Forbidden
- `404` — Invalid resource identifier
- `429` — Rate limited

---

[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)
