# Web Performance Regression Monitor (`sa104-lab/web-performance-regression-monitor`) Actor

Monitor website response times and HTTP status codes, compare each run with previous measurements, and detect performance regressions automatically. Track multiple URLs, set custom thresholds, and export structured results for uptime monitoring, QA, and CI workflows.

- **URL**: https://apify.com/sa104-lab/web-performance-regression-monitor.md
- **Developed by:** [Satoshi Suzuki](https://apify.com/sa104-lab) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Web Performance Regression Monitor

Monitor website response times and HTTP status codes across multiple URLs. Compare every run with previous measurements and automatically detect performance regressions before they affect your users.

This Actor is designed for developers, QA teams, website owners, agencies, and automated CI workflows that need a simple way to identify sudden website slowdowns.

### What this Actor does

- Checks multiple URLs in a single run
- Records HTTP status codes
- Measures response time in milliseconds
- Compares each result with the previous measurement
- Calculates the percentage change in response time
- Detects regressions using your custom threshold
- Returns structured results for automation, reporting, or export
- Supports scheduled monitoring through Apify Tasks and Schedules

### Common use cases

- Monitor production websites and APIs
- Detect performance problems after deployments
- Track client websites automatically
- Add regression checks to QA and CI workflows
- Identify slow pages before customers report them
- Export historical results for analysis

### Input

| Field                        | Type   | Description                                                     |
| ---------------------------- | ------ | --------------------------------------------------------------- |
| `urls`                       | Array  | One or more URLs to monitor                                     |
| `regressionThresholdPercent` | Number | Percentage increase in response time that triggers a regression |
| `requestTimeoutSeconds`      | Number | Maximum time allowed for each request                           |

#### Example input

```json
{
  "urls": [
    "https://www.apify.com/",
    "https://example.com/"
  ],
  "regressionThresholdPercent": 50,
  "requestTimeoutSeconds": 30
}
```

### Output

Each monitored URL produces one structured dataset result containing:

- URL
- HTTP status
- Current response time
- Previous response time
- Percentage change
- Regression threshold
- Regression detected
- Healthy status
- Check timestamp
- Error details, when applicable

#### Example output

```json
{
  "input_url": "https://example.com/",
  "status_code": 200,
  "response_time_ms": 245,
  "previous_response_time_ms": 150,
  "response_time_change_percent": 63.33,
  "regression_threshold_percent": 50,
  "regression_detected": true,
  "healthy": true,
  "checked_at": "2026-09-18T12:00:00Z",
  "error": null
}
```

### How regression detection works

The Actor compares the current response time with the previous stored measurement for the same URL.

For example:

- Previous response time: 200 ms
- Current response time: 320 ms
- Increase: 60%
- Threshold: 50%
- Result: Performance regression detected

The first run creates the baseline. Later runs compare new measurements with the previous results.

### Automated monitoring

For continuous monitoring:

1. Save your preferred input as an Apify Task.
2. Create a Schedule for the task.
3. Run it hourly, daily, or at your preferred interval.
4. Connect integrations or webhooks to notify your workflow when results are available.

### Pricing

This Actor uses pay-per-event pricing. You are charged according to the number of results produced, plus the displayed Actor start fee. Always check the current pricing shown on the Actor page before running large monitoring jobs.

### Important notes

Response times may vary because of network conditions, server location, temporary load, caching, or rate limiting. For reliable monitoring, run the Actor repeatedly on a consistent schedule and choose a threshold appropriate for your website.

### Get started

Enter the URLs you want to monitor, choose a regression threshold, and click **Start**. Your structured performance results will appear in the default dataset.

# Actor input Schema

## `urls` (type: `array`):

Enter one or more website URLs to measure and compare with their previous results.

## `regressionThresholdPercent` (type: `number`):

Flag a regression when response time increases by this percentage or more.

## `timeout` (type: `integer`):

Maximum time allowed for each URL request.

## Actor input object example

```json
{
  "urls": [
    "https://www.apify.com/"
  ],
  "regressionThresholdPercent": 50,
  "timeout": 30
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("sa104-lab/web-performance-regression-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("sa104-lab/web-performance-regression-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call sa104-lab/web-performance-regression-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sa104-lab/web-performance-regression-monitor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ShNq4qva5drF5S4MV/builds/LE7iGIqHM7fjr1z8h/openapi.json
