---
title: "Get Environment Metrics"
method: GET
path: "/v0/sites/{site_id}/environments/{env_id}/metrics"
tags: ["sites"]
---

# Get Environment Metrics

`GET /v0/sites/{site_id}/environments/{env_id}/metrics`

Retrieves traffic metrics (pages served, visits, cache performance) for an environment.
Returns timeseries data showing daily metrics over the specified duration.
The response includes cache hit/miss data for performance analysis.

## Path parameters

- `site_id` string, required
- `env_id` string, required

## Query parameters

- `duration` string

## Response `200`

- MetricsResponse — Returns an array of metrics, each with a timestamp field. This format matches the old API for Terminus compatibility.
  - `timeseries` Metric[] — Timeseries data as an array of metric objects
    - `cache_hits` integer — Number of cache hits
    - `cache_misses` integer — Number of cache misses
    - `datetime` string — ISO 8601 datetime for this metric data point
    - `pages_served` integer — Number of pages served
    - `timestamp` integer — Unix timestamp for this metric data point
    - `visits` integer — Number of unique visits

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/pantheon/apis/pantheon-public-api-service.md) · [All operations](https://skmtc.net/pantheon/apis/pantheon-public-api-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pantheon/pantheon-public-api-service/revisions/94758829689e/schema)
