---
title: "Get a site's PageSpeed history"
url: https://docs.corefinity.com/api/reference/logs/get-site-page-speed
type: endpoint
last_updated: 2026-11-13
feature: pagespeed
related:
  - https://docs.corefinity.com/guides/sites/logs-and-monitoring/pagespeed.md
  - https://docs.corefinity.com/mcp/tools/corestack_pagespeed_get.md
---
# Get a site's PageSpeed history

Answers the Google PageSpeed Insights tests of the site's home page: the newest result for mobile and for
desktop, the tests queued or running, every finished test of the last 30 or 90 days, and whether a test can be
run now.

```http
GET /api/corestack/sites/{site}/pagespeed
```

- Scope: `read`
- Two-factor: required on your account (all)
- Rate limit: 60 a minute
- Try it in the console: on

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.

## Query parameters

- `range` (string): How far back the history and the series go.
- `strategy` (string): Keeps the history and the series of one strategy. Both when left out.

## Request

### curl

```bash
curl https://manage.corefinity.com/api/corestack/sites/1042/pagespeed \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->get('https://manage.corefinity.com/api/corestack/sites/1042/pagespeed');

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/pagespeed', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
  },
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.get(
    "https://manage.corefinity.com/api/corestack/sites/1042/pagespeed",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 The history.

```json
{
  "enabled": true,
  "history": [
    {
      "cls": 0.04,
      "error": null,
      "fcp_ms": 1200,
      "fetched_at": "2026-11-09T13:00:00Z",
      "id": 6203,
      "inp_ms": 180,
      "lcp_ms": 2100,
      "performance_score": 91,
      "requested_by": null,
      "speed_index_ms": 2400,
      "status": "succeeded",
      "strategy": "desktop",
      "tbt_ms": 150,
      "ttfb_ms": 320
    },
    {
      "cls": 0.04,
      "error": null,
      "fcp_ms": 1200,
      "fetched_at": "2026-11-09T13:00:00Z",
      "id": 6202,
      "inp_ms": 180,
      "lcp_ms": 2100,
      "performance_score": 72,
      "requested_by": null,
      "speed_index_ms": 2400,
      "status": "succeeded",
      "strategy": "mobile",
      "tbt_ms": 150,
      "ttfb_ms": 320
    },
    {
      "cls": 0.04,
      "error": null,
      "fcp_ms": 1200,
      "fetched_at": "2026-11-02T13:00:00Z",
      "id": 6201,
      "inp_ms": 180,
      "lcp_ms": 2100,
      "performance_score": 64,
      "requested_by": null,
      "speed_index_ms": 2400,
      "status": "succeeded",
      "strategy": "mobile",
      "tbt_ms": 150,
      "ttfb_ms": 320
    }
  ],
  "in_flight": [],
  "latest": {
    "desktop": {
      "created_at": "2026-11-09T13:00:00Z",
      "diagnostics": null,
      "error": null,
      "fetched_at": "2026-11-09T13:00:00Z",
      "field": null,
      "finished_at": "2026-11-09T13:00:00Z",
      "id": 6203,
      "lighthouse_version": "12.6.0",
      "metrics": {
        "cls": {
          "band": "good",
          "value": 0.04
        },
        "fcp": {
          "band": "good",
          "value_ms": 1200
        },
        "inp": {
          "band": "good",
          "source": "field",
          "value_ms": 180
        },
        "lcp": {
          "band": "good",
          "value_ms": 2100
        },
        "speed_index": {
          "band": "good",
          "value_ms": 2400
        },
        "tbt": {
          "band": "good",
          "value_ms": 150
        },
        "ttfb": {
          "band": "good",
          "value_ms": 320
        }
      },
      "opportunities": [],
      "requested_by": null,
      "score": {
        "band": "good",
        "value": 91
      },
      "started_at": "2026-11-09T13:00:00Z",
      "status": "succeeded",
      "status_label": "Done",
      "strategy": "desktop",
      "url": "https://harbourandfinch.example.com/"
    },
    "mobile": {
      "created_at": "2026-11-09T13:00:00Z",
      "diagnostics": {
        "dom_size": 1290,
        "resources": [
          {
            "requests": 31,
            "transfer_bytes": 768400,
            "type": "script"
          },
          {
            "requests": 28,
            "transfer_bytes": 652100,
            "type": "image"
          }
        ],
        "third_party_bytes": 412600,
        "total_requests": 84,
        "total_transfer_bytes": 1843200
      },
      "error": null,
      "fetched_at": "2026-11-09T13:00:00Z",
      "field": {
        "cls": 0.05,
        "fcp_ms": 1400,
        "inp_ms": 180,
        "lcp_ms": 2300,
        "overall": "AVERAGE",
        "source": "page",
        "ttfb_ms": 700
      },
      "finished_at": "2026-11-09T13:00:00Z",
      "id": 6202,
      "lighthouse_version": "12.6.0",
      "metrics": {
        "cls": {
          "band": "good",
          "value": 0.04
        },
        "fcp": {
          "band": "good",
          "value_ms": 1200
        },
        "inp": {
          "band": "good",
          "source": "field",
          "value_ms": 180
        },
        "lcp": {
          "band": "good",
          "value_ms": 2100
        },
        "speed_index": {
          "band": "good",
          "value_ms": 2400
        },
        "tbt": {
          "band": "good",
          "value_ms": 150
        },
        "ttfb": {
          "band": "good",
          "value_ms": 320
        }
      },
      "opportunities": [
        {
          "display_value": "Est savings of 212 KiB",
          "id": "unused-javascript",
          "savings_ms": 450,
          "title": "Reduce unused JavaScript"
        },
        {
          "display_value": null,
          "id": "render-blocking-resources",
          "savings_ms": 300,
          "title": "Eliminate render-blocking resources"
        }
      ],
      "requested_by": null,
      "score": {
        "band": "needs_improvement",
        "value": 72
      },
      "started_at": "2026-11-09T13:00:00Z",
      "status": "succeeded",
      "status_label": "Done",
      "strategy": "mobile",
      "url": "https://harbourandfinch.example.com/"
    }
  },
  "run_now": {
    "available": true,
    "next_at": null,
    "reason": null,
    "remaining_this_hour": 2
  },
  "series": {
    "desktop": [
      {
        "at": "2026-11-09T13:00:00Z",
        "run_id": 6203,
        "score": 91
      }
    ],
    "failures": [],
    "from": "2026-10-11T13:00:00Z",
    "mobile": [
      {
        "at": "2026-11-09T13:00:00Z",
        "run_id": 6202,
        "score": 72
      },
      {
        "at": "2026-11-02T13:00:00Z",
        "run_id": 6201,
        "score": 64
      }
    ],
    "range": "30d",
    "to": "2026-11-10T13:00:00Z"
  },
  "site": {
    "domain": "harbourandfinch.example.com",
    "id": 1042,
    "skipped": null,
    "tested_url": "https://harbourandfinch.example.com/"
  },
  "trend": {
    "desktop": {
      "current": null,
      "delta": null,
      "previous": null
    },
    "mobile": {
      "current": null,
      "delta": null,
      "previous": null
    }
  }
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), your company requires two-factor authentication and you have not set it up, or your account has no company that can use Managed Clusters, for example because the company was closed (`company_unavailable` or `company_not_enabled`, whichever the route checks first). For Managed Clusters routes; any other route uses `ForbiddenScopeOrTwoFactor`.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 The site is deleted (`deleted`) or still being created (`provisioning`).

```json
{
  "code": "deleted",
  "message": "This site is deleted and waiting to be purged. Restore it first.",
  "reason": "deleted"
}
```

### 422 `range` or `strategy` is not one of its values. `field` names it.

```json
{
  "code": "invalid",
  "errors": {
    "range": [
      "The selected range is invalid."
    ]
  },
  "field": "range",
  "message": "The selected range is invalid.",
  "reason": "invalid"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `company_unavailable` | Your company is unavailable. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 404 | `feature_off` | This feature is not on for your organisation yet. |
| 409 | `deleted` | The site, environment or copy has been deleted, or is being deleted. Nothing can be changed on it. Restore a deleted site first if it can still be restored. |
| 409 | `provisioning` | The site is still being created. Try again in a few minutes. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [PageSpeed](https://docs.corefinity.com/guides/sites/logs-and-monitoring/pagespeed.md)
- MCP tool: [`corestack_pagespeed_get`](https://docs.corefinity.com/mcp/tools/corestack_pagespeed_get.md)
