---
title: "Retrieve trip metrics (speed, travel time, etc.) aggregated by line over a date range."
method: GET
path: "/api/tripmetrics"
tags: ["/api"]
---

# Retrieve trip metrics (speed, travel time, etc.) aggregated by line over a date range.

`GET /api/tripmetrics`

## Request body

- TripMetricsByLineParams — Parameters for the `/api/tripmetrics` endpoint. Attributes: start_date: Start of date range (YYYY-MM-DD). end_date: End of date range (YYYY-MM-DD). agg: Aggregation level — `daily`, `weekly`, or `monthly`. line: Line identifier (e.g., `Red`, `Green-B`).
  - `start_date` union, required
    - string
    - string, date
  - `end_date` union, required
    - string
    - string, date
  - `agg` string, required
  - `line` string, required

## Response `200`

Success

- TripMetricsResponse — Response for `/api/tripmetrics` — trip count, time, and miles for a line. Attributes: data: Trip metrics at the requested aggregation level.
  - `data` object, required

---

[API](https://skmtc.net/transitmatters/apis/data-dashboard-api.md) · [All operations](https://skmtc.net/transitmatters/apis/data-dashboard-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/transitmatters/data-dashboard-api/versions/4bc220e599eb/schema)
