---
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`

## Request

- Base URL: `https://api.pantheon.io`
- URL: `https://api.pantheon.io/v0/sites/{site_id}/environments/{env_id}/metrics`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/pantheon/apis/pantheon-public-api-service/docs/v0/sites/:site_id/environments/:env_id/metrics/get.ts> (a function with typed inputs; its response is checked against the schema)

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.dev/pantheon/apis/pantheon-public-api-service.md) - [All operations](https://skmtc.dev/pantheon/apis/pantheon-public-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/pantheon/apis/pantheon-public-api-service/revisions/5d158d59f4c3?raw)
