---
title: "List slowest tests"
method: GET
path: "/api/v1/user/projects/{projectId}/slowest-tests"
tags: ["Analytics"]
---

# List slowest tests

`GET /api/v1/user/projects/{projectId}/slowest-tests`

## Request

- Base URL: `https://app.gaffer.sh`
- URL: `https://app.gaffer.sh/api/v1/user/projects/{projectId}/slowest-tests`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `X-API-Key`
  - HTTP bearer

Returns the slowest tests for a project, sorted by P95 duration.
Queries duration statistics from the Analytics Engine.
The analysis period is clamped by your plan tier.

## Path parameters

- `projectId` string, required

## Query parameters

- `days` integer
- `limit` integer
- `framework` string
- `branch` string

## Response `200`

Slowest tests with duration statistics

- SlowestTestsResponse
  - `slowestTests` SlowestTest[], required
    - `name` string, required: Short test name
    - `fullName` string, required: Full test name including describe blocks
    - `filePath` string, nullable
    - `framework` string, nullable
    - `avgDurationMs` integer, required: Average duration in milliseconds
    - `p95DurationMs` integer, required: 95th percentile duration in milliseconds
    - `runCount` integer, required: Number of times this test has run
  - `summary` object, required
    - `projectId` string, required
    - `projectName` string, required
    - `period` integer, required: Analysis period in days
    - `totalReturned` integer, required
  - `meta` Meta, nullable: Present when query parameters were clamped by plan tier limits. Only included in the response when clamping actually occurred.
    - `appliedDays` integer: The actual days value used after clamping
    - `requestedDays` integer: The days value originally requested
    - `appliedLimit` integer: The actual limit value used after clamping
    - `requestedLimit` integer: The limit value originally requested
    - `clampedByPlan` boolean: Always true when this object is present

## Other responses

- `400`: Invalid request parameters
- `401`: Missing or invalid API key
- `404`: Resource not found

---

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