---
title: "Get monitor metrics"
method: GET
path: "/monitors/{id}/metrics"
---

# Get monitor metrics

`GET /monitors/{id}/metrics`

## Request

- Base URL: `https://app.yoping.me/api/v1`
- URL: `https://app.yoping.me/api/v1/monitors/{id}/metrics`
- Auth: API key in cookie `yp_session`

Returns downsampled chart points per region for [from, to), capped at 500 points. Granularity `raw` is allowed only for windows of at most 48 hours. `from` defaults to 24 hours before `to`; `to` defaults to now.

## Path parameters

- `id` string, required

## Query parameters

- `granularity` 'raw' | '1h' | '1d'
- `from` string, date-time
- `to` string, date-time

## Response `200`

Chart points for the window.

- object: Uniform success envelope: the payload is always under `data`.
  - `data` object, required
    - `granularity` 'raw' | '1h' | '1d', required
    - `points` MetricPoint[], required
      - `bucket` string, date-time, required
      - `region` string, required
      - `uptime_pct` number, nullable, required
      - `avg_ms` number, nullable, required
      - `p95_ms` integer, nullable, required

## Other responses

- `400`: Invalid input (code `validation_failed`): malformed JSON, a missing or out-of-range field, bad pagination parameters, or a rejected token.
- `401`: Not authenticated (code `unauthorized`): missing, invalid, or expired session; invalid login credentials; or a Bearer token, which this surface rejects.
- `404`: Not found (code `not_found`). A resource id belonging to another account is indistinguishable from a missing one.
- `429`: Too many requests (code `rate_limited`). A global per-IP budget of 300 requests/minute (burst 60) applies to every endpoint; login, signup, and test alerts have tighter dedicated limits.

---

[API](https://skmtc.dev/yoping/apis/yopingme-api.md) · [All operations](https://skmtc.dev/yoping/apis/yopingme-api/llms.txt) · [OpenAPI document](https://skmtc.dev/yoping/apis/yopingme-api/revisions/76d8deb40173?raw)
