# Response Time Profiler (`zerobreak/response-time-profiler`) Actor

Response time profiler measures TTFB, DNS lookup, and total load time for any URL, so you can find slow pages before they cost you rankings.

- **URL**: https://apify.com/zerobreak/response-time-profiler.md
- **Developed by:** [ZeroBreak](https://apify.com/zerobreak) (community)
- **Categories:** SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.99 / 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

## Response Time Profiler: Measure TTFB, DNS, and Page Speed for SEO

Response time profiling is one of the faster ways to find pages hurting your search rankings. This actor measures DNS lookup time, time to first byte (TTFB), and total response time for any URL. It runs multiple samples to average out network noise, then grades each page from A to F based on standard performance thresholds.

Point it at a list of pages and it tells you which ones are slow, how slow, and how consistent they are across requests. Useful before a launch, after a deploy, or when a client wants to know why their site scores badly on PageSpeed.

### Use cases

- **SEO auditing**: find slow pages dragging down your Core Web Vitals scores before they affect rankings
- **Pre-launch checks**: confirm response times are within range before going live
- **Post-deploy monitoring**: catch regressions after infrastructure or code changes
- **Redirect auditing**: spot pages with too many hops adding latency before the content loads
- **Hosting comparison**: benchmark the same URLs across servers or CDN configurations
- **Agency reporting**: generate response-time data for client audits without extra tooling

### What data does this actor collect?

Each profiled URL produces one output record:

```json
{
    "url": "https://apify.com",
    "finalUrl": "https://apify.com/",
    "statusCode": 200,
    "dnsLookupMs": 12.4,
    "avgTtfbMs": 98.3,
    "minTotalMs": 210.5,
    "maxTotalMs": 245.8,
    "avgTotalMs": 228.1,
    "seoGrade": "B",
    "redirectCount": 1,
    "contentLengthBytes": 54320,
    "samplesCount": 3,
    "testedAt": "2025-01-15T10:30:00+00:00"
}
```

| Field | Type | Description |
|-------|------|-------------|
| `url` | string | Original URL provided as input |
| `finalUrl` | string | Final URL after following all redirects |
| `statusCode` | integer | HTTP status code of the response |
| `dnsLookupMs` | number | DNS resolution time in milliseconds |
| `avgTtfbMs` | number | Average time to first byte across all samples |
| `minTotalMs` | number | Fastest total response time recorded |
| `maxTotalMs` | number | Slowest total response time recorded |
| `avgTotalMs` | number | Average total response time across all samples |
| `seoGrade` | string | A-F grade (A under 200ms, B 200-500ms, C 500-1000ms, D 1000-2000ms, F over 2000ms) |
| `redirectCount` | integer | Number of redirects followed before the final URL |
| `contentLengthBytes` | integer | Total response body size in bytes |
| `samplesCount` | integer | Number of successful samples taken |
| `testedAt` | string | ISO 8601 timestamp of when the test ran |
| `error` | string | Error message if all samples failed for this URL |

### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `url` | string | | Single URL to profile |
| `urls` | array | | List of URLs to profile in bulk (one per line) |
| `samples` | integer | 3 | Requests per URL, averaged for the result. Min 1, max 10 |
| `maxUrls` | integer | 100 | Maximum URLs to process per run (cap: 1000) |
| `timeoutSecs` | integer | 300 | Overall actor timeout in seconds |
| `requestTimeoutSecs` | integer | 30 | Per-request timeout in seconds |
| `proxyConfiguration` | object | Datacenter (Anywhere) | Proxy type and location for requests. Supports Datacenter, Residential, Special, and custom proxies. Optional. |

#### Example input

```json
{
    "urls": [
        "https://apify.com",
        "https://apify.com/store",
        "https://apify.com/pricing"
    ],
    "samples": 3,
    "maxUrls": 100,
    "requestTimeoutSecs": 30,
    "proxyConfiguration": { "useApifyProxy": true }
}
```

### How it works

1. Takes URLs from `url` and `urls`, deduplicates them, and caps the list at `maxUrls`
2. Measures DNS lookup time for each hostname using a direct socket call
3. Makes `samples` HTTP GET requests per URL using streaming to capture time to first byte and total load time separately
4. Computes min, max, and average timing across all successful samples
5. Assigns an A-F SEO performance grade based on average total response time
6. Pushes one result record per URL to the Apify dataset

### FAQ

**What does the SEO grade mean?**

Grades map to standard web performance thresholds: A is under 200ms, B is 200-500ms, C is 500-1000ms, D is 1-2 seconds, F is over 2 seconds. Pages scoring C or below are worth investigating for server-side bottlenecks.

**How many samples should I run?**

3 samples (the default) is enough for most checks. Use 5-10 if you need tighter averages or are testing across variable network conditions.

**Can this actor check JavaScript-rendered pages?**

It measures raw HTTP response time, not the full browser render time. Single-page apps will show a fast initial response because the actor does not wait for client-side JavaScript to execute.

**How many URLs can it process per run?**

Up to 1,000 per run (controlled by `maxUrls`). For larger batches, run multiple actor instances or schedule them.

**Why does DNS time vary between runs?**

DNS is measured from the machine running the actor, which has its own resolver and cache state. Treat DNS times as relative indicators rather than exact user-facing values.

**What happens if a URL fails?**

The actor records the error and moves on to the next URL. Failed URLs appear in the dataset with an `error` field instead of timing data.

### Integrations

Connect Response Time Profiler with other apps and services using [Apify integrations](https://apify.com/integrations). You can integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, and many more. You can also use [webhooks](https://docs.apify.com/integrations/webhooks) to get notified when results are ready.

SEO teams often pipe results into Google Sheets for trend tracking, or run the actor on a schedule to catch performance regressions before clients notice.

# Actor input Schema

## `url` (type: `string`):

A single URL to profile. Include the full scheme (https://). Use 'urls' for bulk input.

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

List of URLs to profile. Enter one URL per line. Combined with 'URL' field if both are provided.

## `samples` (type: `integer`):

Number of HTTP requests to make per URL. Results are averaged across samples to reduce noise. Min 1, max 10.

## `maxUrls` (type: `integer`):

Maximum number of URLs to process in a single run. Cap at 1000.

## `timeoutSecs` (type: `integer`):

Maximum time the actor is allowed to run in seconds.

## `requestTimeoutSecs` (type: `integer`):

Maximum time to wait for a single HTTP request before timing out.

## `proxyConfiguration` (type: `object`):

Select proxies to use for requests. Helps avoid IP blocking and rate limits. Datacenter proxies are fastest; Residential proxies are harder to detect.

## Actor input object example

```json
{
  "url": "https://apify.com",
  "urls": [
    "https://apify.com",
    "https://apify.com/store",
    "https://apify.com/pricing"
  ],
  "samples": 3,
  "maxUrls": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "url": "https://apify.com",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zerobreak/response-time-profiler").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 = {
    "url": "https://apify.com",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("zerobreak/response-time-profiler").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 '{
  "url": "https://apify.com",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call zerobreak/response-time-profiler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zerobreak/response-time-profiler"
        }
    }
}
```

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/ebtFjseHKtCHTfNLO/builds/v0GpRT84hc3iGDMXw/openapi.json
