---
title: "getProjectMetrics"
description: "Get project metrics"
canonical: "https://pgbeam.com/docs/ts-sdk/projects/getProjectMetrics"
last-updated: "2026-10-30T13:32:17.000Z"
---

# getProjectMetrics

> Get project metrics

URL: https://pgbeam.com/docs/ts-sdk/projects/getProjectMetrics

{/* Auto-generated from OpenAPI. Do not edit. Run `pnpm generate:sdk-docs` to regenerate. */}

Returns recent project metrics snapshots, optionally filtered by region.

## Usage

```typescript
const result = await api.projects.getProjectMetrics({
  pathParams: { project_id: "prj_xxx" },
});
```

## Parameters

| Parameter             | Type     | Required | Description                                         |
| --------------------- | -------- | -------- | --------------------------------------------------- |
| pathParams.project_id | `string` | Yes      | Unique project identifier (prefixed, e.g. prj_xxx). |
| queryParams.limit     | `number` | No       | Maximum number of recent snapshots to return.       |
| queryParams.region    | `string` | No       | Filter metrics by region code.                      |

## Response

`Promise<ProjectMetricsResponse>`: metrics snapshots

## Example

```typescript
import { PgBeamClient } from "pgbeam";

const client = new PgBeamClient({
  token: "pbu_...",
  baseUrl: "https://api.pgbeam.com",
});

const result = await client.api.projects.getProjectMetrics({
  pathParams: { project_id: "prj_xxx" },
  queryParams: { limit: 20, region: "us-east-1" },
});
```

## Errors

| Status | Description                                                                                                                         |
| ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| 400    | The request was rejected. `code` is `INVALID_INPUT`, and `errors` names the offending fields when the failure was a validation one. |
| 401    | Missing or invalid authentication. `code` is `UNAUTHORIZED`.                                                                        |
| 404    | The resource does not exist, or the caller is not entitled to know that it does. `code` is `NOT_FOUND`.                             |
| 429    | Rate limited. `code` is `RATE_LIMITED`.                                                                                             |
| 500    | The request failed for a reason on our side. `code` is `INTERNAL_ERROR`. Quote `request_id` when reporting it.                      |