---
title: "Return the top routes (by request count) in a project's API traffic, grouped by raw `(method, path)`."
method: GET
path: "/projects/{project_id}/api-analytics/routes"
tags: ["Analytics"]
---

# Return the top routes (by request count) in a project's API traffic, grouped by raw \`(method, path)\`.

`GET /projects/{project_id}/api-analytics/routes`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/api-analytics/routes`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required

## Query parameters

- `environment_id` integer
- `start_date` string, required
- `end_date` string, required
- `limit` integer
- `offset` integer

## Response `200`

Top routes by request count

- ApiRoutesResponse: Top routes by request count for a given project + time window.
  - `routes` ApiRouteEntry[], required: Top routes, ordered by request_count descending.
    - `avg_latency_ms` number, double, nullable: Mean response time in milliseconds for this route.
    - `error_rate` number, double, required: Error rate for this route (0.0–1.0): requests with status >= 400.
    - `method` string, required: HTTP method (e.g. "GET", "POST").
    - `path` string, required: Raw request path (e.g. "/api/users/123"). High-cardinality paths with dynamic IDs will appear as separate rows until path normalization is implemented.
    - `request_count` integer, required: Total request count for this route in the period.
  - `total_routes` integer, required: Total distinct (method, path) pairs in the period (before the limit).

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Internal server error

## Changes

- **2026-09-07** `2b95ed4ff1d2`: 1 info
  - endpoint added
- **2026-09-07** `f7404eb7ac98`: 1 breaking
  - api path removed without deprecation
- **2026-08-14** `5b69d84f67d1`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/api-analytics/routes/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
