Skip to content
Start here

List page test history

client.Speed.Pages.Tests.List(ctx, url, params) (*V4PagePaginationArray[Test], error)
GET/zones/{zone_id}/speed_api/pages/{url}/tests

Test history (list of tests) for a specific webpage.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Zone Settings WriteZone Settings Read
ParametersExpand Collapse
url string

A URL.

params PageTestListParams
ZoneID param.Field[string]

Path param: Identifier.

maxLength32
Page param.Field[int64]Optional

Query param

PerPage param.Field[int64]Optional

Query param

maximum50
minimum5
Region param.Field[PageTestListParamsRegion]Optional

Query param: A test region.

const PageTestListParamsRegionAsiaEast1 PageTestListParamsRegion = "asia-east1"
const PageTestListParamsRegionAsiaNortheast1 PageTestListParamsRegion = "asia-northeast1"
const PageTestListParamsRegionAsiaNortheast2 PageTestListParamsRegion = "asia-northeast2"
const PageTestListParamsRegionAsiaSouth1 PageTestListParamsRegion = "asia-south1"
const PageTestListParamsRegionAsiaSoutheast1 PageTestListParamsRegion = "asia-southeast1"
const PageTestListParamsRegionAustraliaSoutheast1 PageTestListParamsRegion = "australia-southeast1"
const PageTestListParamsRegionEuropeNorth1 PageTestListParamsRegion = "europe-north1"
const PageTestListParamsRegionEuropeSouthwest1 PageTestListParamsRegion = "europe-southwest1"
const PageTestListParamsRegionEuropeWest1 PageTestListParamsRegion = "europe-west1"
const PageTestListParamsRegionEuropeWest2 PageTestListParamsRegion = "europe-west2"
const PageTestListParamsRegionEuropeWest3 PageTestListParamsRegion = "europe-west3"
const PageTestListParamsRegionEuropeWest4 PageTestListParamsRegion = "europe-west4"
const PageTestListParamsRegionEuropeWest8 PageTestListParamsRegion = "europe-west8"
const PageTestListParamsRegionEuropeWest9 PageTestListParamsRegion = "europe-west9"
const PageTestListParamsRegionMeWest1 PageTestListParamsRegion = "me-west1"
const PageTestListParamsRegionSouthamericaEast1 PageTestListParamsRegion = "southamerica-east1"
const PageTestListParamsRegionUsCentral1 PageTestListParamsRegion = "us-central1"
const PageTestListParamsRegionUsEast1 PageTestListParamsRegion = "us-east1"
const PageTestListParamsRegionUsEast4 PageTestListParamsRegion = "us-east4"
const PageTestListParamsRegionUsSouth1 PageTestListParamsRegion = "us-south1"
const PageTestListParamsRegionUsWest1 PageTestListParamsRegion = "us-west1"
ReturnsExpand Collapse
type Test struct{…}
ID stringOptional

UUID.

maxLength36
Date TimeOptional
formatdate-time
DesktopReport LighthouseReportOptional

The Lighthouse report.

CLS float64Optional

Cumulative Layout Shift.

DeviceType LighthouseReportDeviceTypeOptional

The type of device.

One of the following:
const LighthouseReportDeviceTypeDesktop LighthouseReportDeviceType = "DESKTOP"
const LighthouseReportDeviceTypeMobile LighthouseReportDeviceType = "MOBILE"
Error LighthouseReportErrorOptional
Code LighthouseReportErrorCodeOptional

The error code of the Lighthouse result.

One of the following:
const LighthouseReportErrorCodeNotReachable LighthouseReportErrorCode = "NOT_REACHABLE"
const LighthouseReportErrorCodeDNSFailure LighthouseReportErrorCode = "DNS_FAILURE"
const LighthouseReportErrorCodeNotHTML LighthouseReportErrorCode = "NOT_HTML"
const LighthouseReportErrorCodeLighthouseTimeout LighthouseReportErrorCode = "LIGHTHOUSE_TIMEOUT"
const LighthouseReportErrorCodeUnknown LighthouseReportErrorCode = "UNKNOWN"
Detail stringOptional

Detailed error message.

FinalDisplayedURL stringOptional

The final URL displayed to the user.

FCP float64Optional

First Contentful Paint.

JsonReportURL stringOptional

The URL to the full Lighthouse JSON report.

LCP float64Optional

Largest Contentful Paint.

PerformanceScore float64Optional

The Lighthouse performance score.

Si float64Optional

Speed Index.

State LighthouseReportStateOptional

The state of the Lighthouse report.

One of the following:
const LighthouseReportStateRunning LighthouseReportState = "RUNNING"
const LighthouseReportStateComplete LighthouseReportState = "COMPLETE"
const LighthouseReportStateFailed LighthouseReportState = "FAILED"
TBT float64Optional

Total Blocking Time.

TTFB float64Optional

Time To First Byte.

TTI float64Optional

Time To Interactive.

MobileReport LighthouseReportOptional

The Lighthouse report.

CLS float64Optional

Cumulative Layout Shift.

DeviceType LighthouseReportDeviceTypeOptional

The type of device.

One of the following:
const LighthouseReportDeviceTypeDesktop LighthouseReportDeviceType = "DESKTOP"
const LighthouseReportDeviceTypeMobile LighthouseReportDeviceType = "MOBILE"
Error LighthouseReportErrorOptional
Code LighthouseReportErrorCodeOptional

The error code of the Lighthouse result.

One of the following:
const LighthouseReportErrorCodeNotReachable LighthouseReportErrorCode = "NOT_REACHABLE"
const LighthouseReportErrorCodeDNSFailure LighthouseReportErrorCode = "DNS_FAILURE"
const LighthouseReportErrorCodeNotHTML LighthouseReportErrorCode = "NOT_HTML"
const LighthouseReportErrorCodeLighthouseTimeout LighthouseReportErrorCode = "LIGHTHOUSE_TIMEOUT"
const LighthouseReportErrorCodeUnknown LighthouseReportErrorCode = "UNKNOWN"
Detail stringOptional

Detailed error message.

FinalDisplayedURL stringOptional

The final URL displayed to the user.

FCP float64Optional

First Contentful Paint.

JsonReportURL stringOptional

The URL to the full Lighthouse JSON report.

LCP float64Optional

Largest Contentful Paint.

PerformanceScore float64Optional

The Lighthouse performance score.

Si float64Optional

Speed Index.

State LighthouseReportStateOptional

The state of the Lighthouse report.

One of the following:
const LighthouseReportStateRunning LighthouseReportState = "RUNNING"
const LighthouseReportStateComplete LighthouseReportState = "COMPLETE"
const LighthouseReportStateFailed LighthouseReportState = "FAILED"
TBT float64Optional

Total Blocking Time.

TTFB float64Optional

Time To First Byte.

TTI float64Optional

Time To Interactive.

Region LabeledRegionOptional

A test region with a label.

Label stringOptional
Value LabeledRegionValueOptional

A test region.

One of the following:
const LabeledRegionValueAsiaEast1 LabeledRegionValue = "asia-east1"
const LabeledRegionValueAsiaNortheast1 LabeledRegionValue = "asia-northeast1"
const LabeledRegionValueAsiaNortheast2 LabeledRegionValue = "asia-northeast2"
const LabeledRegionValueAsiaSouth1 LabeledRegionValue = "asia-south1"
const LabeledRegionValueAsiaSoutheast1 LabeledRegionValue = "asia-southeast1"
const LabeledRegionValueAustraliaSoutheast1 LabeledRegionValue = "australia-southeast1"
const LabeledRegionValueEuropeNorth1 LabeledRegionValue = "europe-north1"
const LabeledRegionValueEuropeSouthwest1 LabeledRegionValue = "europe-southwest1"
const LabeledRegionValueEuropeWest1 LabeledRegionValue = "europe-west1"
const LabeledRegionValueEuropeWest2 LabeledRegionValue = "europe-west2"
const LabeledRegionValueEuropeWest3 LabeledRegionValue = "europe-west3"
const LabeledRegionValueEuropeWest4 LabeledRegionValue = "europe-west4"
const LabeledRegionValueEuropeWest8 LabeledRegionValue = "europe-west8"
const LabeledRegionValueEuropeWest9 LabeledRegionValue = "europe-west9"
const LabeledRegionValueMeWest1 LabeledRegionValue = "me-west1"
const LabeledRegionValueSouthamericaEast1 LabeledRegionValue = "southamerica-east1"
const LabeledRegionValueUsCentral1 LabeledRegionValue = "us-central1"
const LabeledRegionValueUsEast1 LabeledRegionValue = "us-east1"
const LabeledRegionValueUsEast4 LabeledRegionValue = "us-east4"
const LabeledRegionValueUsSouth1 LabeledRegionValue = "us-south1"
const LabeledRegionValueUsWest1 LabeledRegionValue = "us-west1"
ScheduleFrequency TestScheduleFrequencyOptional

The frequency of the test.

One of the following:
const TestScheduleFrequencyDaily TestScheduleFrequency = "DAILY"
const TestScheduleFrequencyWeekly TestScheduleFrequency = "WEEKLY"
URL stringOptional

A URL.

List page test history

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/speed"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Speed.Pages.Tests.List(
    context.TODO(),
    "example.com",
    speed.PageTestListParams{
      ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
      "date": "2014-01-01T05:20:00.12345Z",
      "desktopReport": {
        "cls": 100,
        "deviceType": "DESKTOP",
        "error": {
          "code": "NOT_REACHABLE",
          "detail": "Details: net::ERR_CONNECTION_CLOSED",
          "finalDisplayedUrl": "example.com"
        },
        "fcp": 100,
        "jsonReportUrl": "jsonReportUrl",
        "lcp": 100,
        "performanceScore": 90,
        "si": 100,
        "state": "COMPLETE",
        "tbt": 100,
        "ttfb": 100,
        "tti": 100
      },
      "mobileReport": {
        "cls": 100,
        "deviceType": "DESKTOP",
        "error": {
          "code": "NOT_REACHABLE",
          "detail": "Details: net::ERR_CONNECTION_CLOSED",
          "finalDisplayedUrl": "example.com"
        },
        "fcp": 100,
        "jsonReportUrl": "jsonReportUrl",
        "lcp": 100,
        "performanceScore": 90,
        "si": 100,
        "state": "COMPLETE",
        "tbt": 100,
        "ttfb": 100,
        "tti": 100
      },
      "region": {
        "label": "Iowa, USA",
        "value": "us-central1"
      },
      "scheduleFrequency": "DAILY",
      "url": "example.com"
    }
  ],
  "result_info": {
    "count": 5,
    "page": 1,
    "per_page": 5,
    "total_count": 3
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
      "date": "2014-01-01T05:20:00.12345Z",
      "desktopReport": {
        "cls": 100,
        "deviceType": "DESKTOP",
        "error": {
          "code": "NOT_REACHABLE",
          "detail": "Details: net::ERR_CONNECTION_CLOSED",
          "finalDisplayedUrl": "example.com"
        },
        "fcp": 100,
        "jsonReportUrl": "jsonReportUrl",
        "lcp": 100,
        "performanceScore": 90,
        "si": 100,
        "state": "COMPLETE",
        "tbt": 100,
        "ttfb": 100,
        "tti": 100
      },
      "mobileReport": {
        "cls": 100,
        "deviceType": "DESKTOP",
        "error": {
          "code": "NOT_REACHABLE",
          "detail": "Details: net::ERR_CONNECTION_CLOSED",
          "finalDisplayedUrl": "example.com"
        },
        "fcp": 100,
        "jsonReportUrl": "jsonReportUrl",
        "lcp": 100,
        "performanceScore": 90,
        "si": 100,
        "state": "COMPLETE",
        "tbt": 100,
        "ttfb": 100,
        "tti": 100
      },
      "region": {
        "label": "Iowa, USA",
        "value": "us-central1"
      },
      "scheduleFrequency": "DAILY",
      "url": "example.com"
    }
  ],
  "result_info": {
    "count": 5,
    "page": 1,
    "per_page": 5,
    "total_count": 3
  }
}