Speed

Speed

Domain types

LabeledRegion{…}

A test region with a label.

LighthouseReport{…}

The Lighthouse report.

Trend{…}
Speed

Availabilities

Speed.Availabilities

Methods

list(, ):
get/zones/{zone_id}/speed_api/availabilities

Retrieves quota for all plans, as well as the current zone quota.

Domain types

Availability{…}
Speed

Pages

Speed.Pages

Methods

list(, ): <>
get/zones/{zone_id}/speed_api/pages

Lists all webpages which have been tested.

trend(, , ):
get/zones/{zone_id}/speed_api/pages/{url}/trend

Lists the core web vital metrics trend over time for a specific page.

Security

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

Example: Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY

Accepted Permissions (at least one required)

Zone Settings Write Zone Settings Read

Parameters
url: string

A URL.

zone_id: string
(maxLength: 32)

Path param: Identifier.

deviceType: "DESKTOP" | "MOBILE"

Query param: The type of device.

metrics: string

Query param: A comma-separated list of metrics to include in the results.

region: "asia-east1" | "asia-northeast1" | "asia-northeast2" | 18 more...

Query param: A test region.

start: string
(format: date-time)

Query param

tz: string

Query param: The timezone of the start and end timestamps.

end?: string
(format: date-time)

Query param

Returns
cls?: Array<number | null>

Cumulative Layout Shift trend.

fcp?: Array<number | null>

First Contentful Paint trend.

lcp?: Array<number | null>

Largest Contentful Paint trend.

performanceScore?: Array<number | null>

The Lighthouse score trend.

si?: Array<number | null>

Speed Index trend.

tbt?: Array<number | null>

Total Blocking Time trend.

ttfb?: Array<number | null>

Time To First Byte trend.

tti?: Array<number | null>

Time To Interactive trend.

Request example
200Example

Speed.Pages.Tests

Methods

list(, , ): <>
get/zones/{zone_id}/speed_api/pages/{url}/tests

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

get(, , , ):
get/zones/{zone_id}/speed_api/pages/{url}/tests/{test_id}

Retrieves the result of a specific test.

create(, , ):
post/zones/{zone_id}/speed_api/pages/{url}/tests

Starts a test for a specific webpage, in a specific region.

delete(, , ):
delete/zones/{zone_id}/speed_api/pages/{url}/tests

Deletes all tests for a specific webpage from a specific region. Deleted tests are still counted as part of the quota.

Domain types

Test{…}
Speed

Schedule

Speed.ScheduleResource

Methods

get(, , ):
get/zones/{zone_id}/speed_api/schedule/{url}

Retrieves the test schedule for a page in a specific region.

create(, , ):
post/zones/{zone_id}/speed_api/schedule/{url}

Creates a scheduled test for a page.

delete(, , ):
delete/zones/{zone_id}/speed_api/schedule/{url}

Deletes a scheduled test for a page.

Domain types

Schedule{…}

The test schedule.