> ## Documentation Index
> Fetch the complete documentation index at: https://empirical.run/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics

> Track pass, fail and flaky rates for every test over time, and filter tests with a search syntax that also works in the API

The [Analytics](https://empirical.run/analytics) page shows the health of your test suite: run
history and pass rate, how the test count trends, and the fail and flaky rate of each test. Use it
to find the tests that fail or flake most, then filter them with the search syntax below.

![Analytics page with test run history and test count charts above a test case table filtered by fail\_rate:>50, showing fail rate, flaky rate and run history per test](https://mintcdn.com/empirical/LJ3vSWX6ebomgCgh/images/analytics/screenshot.png?fit=max\&auto=format\&n=LJ3vSWX6ebomgCgh\&q=85\&s=fd308fca43e4e46d9267ea3bda3b7a0a)

## Search syntax

Type these patterns in the search bar to filter test cases.

### Text search

| Syntax | Example | Description |
| - | - | - |
| Term | `login` | Matches name or file path containing "login" |
| Multiple terms | `login auth` | Must contain both terms (AND) |
| Quoted phrase | `"user login"` | Treats multi-word text as a single term |
| Negation | `-admin` | Excludes tests matching "admin" |
| Negated phrase | `-"slow test"` | Excludes tests matching "slow test" |
| Combined | `checkout -guest` | Contains "checkout", excludes "guest" |

### Field filters

| Syntax | Example | Description |
| - | - | - |
| `project:` | `project:chromium` | Filter by Playwright project name |
| `tag:` | `tag:critical` | Filter by tag (multiple tags use OR) |
| `tag:__none__` | `tag:__none__` | Filter tests with no tags |
| `flaky_rate:` | `flaky_rate:>10` | Filter by flaky rate percentage |
| `fail_rate:` | `fail_rate:>=25` | Filter by fail rate percentage |
| `flaky_count:` | `flaky_count:>2` | Filter by flaky count (absolute number) |
| `fail_count:` | `fail_count:>=5` | Filter by fail count (absolute number) |

#### Metric filter operators

`flaky_rate`, `fail_rate`, `flaky_count` and `fail_count` accept `>`, `>=`, `<`, `<=` and `=`. Without an operator, the filter uses `>=`.

### Examples

| Query | Description |
| - | - |
| `login flaky_rate:>10` | Login tests with flaky rate above 10% |
| `tag:smoke tag:critical` | Tests with either smoke OR critical tag |
| `tag:__none__` | Tests that have no tags assigned |
| `project:firefox -skip` | Firefox project tests, excluding "skip" |
| `fail_rate:>=20 -tag:known-flaky` | High failure tests, excluding known flaky |

### Search from the API

To use the same syntax with the [Test case analytics API](https://empirical.run/docs/api-reference/analytics/test-case-analytics.md), pass the URL-encoded query as the `search` parameter:

```sh theme={null}
curl -X GET \
  "https://api.empirical.run/api/v2/analytics/test-cases?search=login%20flaky_rate%3A%3E10%20-tag%3Aknown-flaky" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"
```

This request runs the search `login flaky_rate:>10 -tag:known-flaky`: login tests with a flaky rate above 10%, excluding tests tagged `known-flaky`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.