Skip to content
Start here

Speed

ModelsExpand Collapse
class LabeledRegion:

A test region with a label.

label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
class LighthouseReport:

The Lighthouse report.

cls: Optional[float]

Cumulative Layout Shift.

device_type: Optional[Literal["DESKTOP", "MOBILE"]]

The type of device.

One of the following:
"DESKTOP"
"MOBILE"
error: Optional[Error]
code: Optional[Literal["NOT_REACHABLE", "DNS_FAILURE", "NOT_HTML", 2 more]]

The error code of the Lighthouse result.

One of the following:
"NOT_REACHABLE"
"DNS_FAILURE"
"NOT_HTML"
"LIGHTHOUSE_TIMEOUT"
"UNKNOWN"
detail: Optional[str]

Detailed error message.

final_displayed_url: Optional[str]

The final URL displayed to the user.

fcp: Optional[float]

First Contentful Paint.

json_report_url: Optional[str]

The URL to the full Lighthouse JSON report.

lcp: Optional[float]

Largest Contentful Paint.

performance_score: Optional[float]

The Lighthouse performance score.

si: Optional[float]

Speed Index.

state: Optional[Literal["RUNNING", "COMPLETE", "FAILED"]]

The state of the Lighthouse report.

One of the following:
"RUNNING"
"COMPLETE"
"FAILED"
tbt: Optional[float]

Total Blocking Time.

ttfb: Optional[float]

Time To First Byte.

tti: Optional[float]

Time To Interactive.

class Trend:
cls: Optional[List[Optional[float]]]

Cumulative Layout Shift trend.

fcp: Optional[List[Optional[float]]]

First Contentful Paint trend.

lcp: Optional[List[Optional[float]]]

Largest Contentful Paint trend.

performance_score: Optional[List[Optional[float]]]

The Lighthouse score trend.

si: Optional[List[Optional[float]]]

Speed Index trend.

tbt: Optional[List[Optional[float]]]

Total Blocking Time trend.

ttfb: Optional[List[Optional[float]]]

Time To First Byte trend.

tti: Optional[List[Optional[float]]]

Time To Interactive trend.

SpeedSchedule

Get a page test schedule
speed.schedule.get(strurl, ScheduleGetParams**kwargs) -> Schedule
GET/zones/{zone_id}/speed_api/schedule/{url}
Create scheduled page test
speed.schedule.create(strurl, ScheduleCreateParams**kwargs) -> ScheduleCreateResponse
POST/zones/{zone_id}/speed_api/schedule/{url}
Delete scheduled page test
speed.schedule.delete(strurl, ScheduleDeleteParams**kwargs) -> ScheduleDeleteResponse
DELETE/zones/{zone_id}/speed_api/schedule/{url}
ModelsExpand Collapse
class Schedule:

The test schedule.

frequency: Optional[Literal["DAILY", "WEEKLY"]]

The frequency of the test.

One of the following:
"DAILY"
"WEEKLY"
region: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
url: Optional[str]

A URL.

class ScheduleCreateResponse:
schedule: Optional[Schedule]

The test schedule.

test: Optional[Test]
class ScheduleDeleteResponse:
count: Optional[float]

Number of items affected.

SpeedAvailabilities

Get quota and availability
speed.availabilities.list(AvailabilityListParams**kwargs) -> Availability
GET/zones/{zone_id}/speed_api/availabilities
ModelsExpand Collapse
class Availability:
quota: Optional[Quota]
plan: Optional[str]

Cloudflare plan.

quotas_per_plan: Optional[QuotaQuotasPerPlan]

The number of tests available per plan.

value: Optional[QuotaQuotasPerPlanValue]

Counts per account plan.

business: Optional[int]
enterprise: Optional[int]
free: Optional[int]
pro: Optional[int]
remaining_schedules: Optional[float]

The number of remaining schedules available.

remaining_tests: Optional[float]

The number of remaining tests available.

schedule_quotas_per_plan: Optional[QuotaScheduleQuotasPerPlan]

The number of schedules available per plan.

value: Optional[QuotaScheduleQuotasPerPlanValue]

Counts per account plan.

business: Optional[int]
enterprise: Optional[int]
free: Optional[int]
pro: Optional[int]
regions: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
regions_per_plan: Optional[RegionsPerPlan]

Available regions.

business: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
enterprise: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
free: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"
pro: Optional[List[LabeledRegion]]
label: Optional[str]
value: Optional[Literal["asia-east1", "asia-northeast1", "asia-northeast2", 18 more]]

A test region.

One of the following:
"asia-east1"
"asia-northeast1"
"asia-northeast2"
"asia-south1"
"asia-southeast1"
"australia-southeast1"
"europe-north1"
"europe-southwest1"
"europe-west1"
"europe-west2"
"europe-west3"
"europe-west4"
"europe-west8"
"europe-west9"
"me-west1"
"southamerica-east1"
"us-central1"
"us-east1"
"us-east4"
"us-south1"
"us-west1"

SpeedPages

List tested webpages
speed.pages.list(PageListParams**kwargs) -> SyncSinglePage[PageListResponse]
GET/zones/{zone_id}/speed_api/pages
List core web vital metrics trend
speed.pages.trend(strurl, PageTrendParams**kwargs) -> Trend
GET/zones/{zone_id}/speed_api/pages/{url}/trend
ModelsExpand Collapse
class PageListResponse:
region: Optional[LabeledRegion]

A test region with a label.

schedule_frequency: Optional[Literal["DAILY", "WEEKLY"]]

The frequency of the test.

One of the following:
"DAILY"
"WEEKLY"
tests: Optional[List[Test]]
id: Optional[str]

UUID.

maxLength36
date: Optional[datetime]
formatdate-time
desktop_report: Optional[LighthouseReport]

The Lighthouse report.

mobile_report: Optional[LighthouseReport]

The Lighthouse report.

region: Optional[LabeledRegion]

A test region with a label.

schedule_frequency: Optional[Literal["DAILY", "WEEKLY"]]

The frequency of the test.

One of the following:
"DAILY"
"WEEKLY"
url: Optional[str]

A URL.

url: Optional[str]

A URL.

SpeedPagesTests

List page test history
speed.pages.tests.list(strurl, TestListParams**kwargs) -> SyncV4PagePaginationArray[Test]
GET/zones/{zone_id}/speed_api/pages/{url}/tests
Get a page test result
speed.pages.tests.get(strtest_id, TestGetParams**kwargs) -> Test
GET/zones/{zone_id}/speed_api/pages/{url}/tests/{test_id}
Start page test
speed.pages.tests.create(strurl, TestCreateParams**kwargs) -> Test
POST/zones/{zone_id}/speed_api/pages/{url}/tests
Delete all page tests
speed.pages.tests.delete(strurl, TestDeleteParams**kwargs) -> TestDeleteResponse
DELETE/zones/{zone_id}/speed_api/pages/{url}/tests
ModelsExpand Collapse
class Test:
id: Optional[str]

UUID.

maxLength36
date: Optional[datetime]
formatdate-time
desktop_report: Optional[LighthouseReport]

The Lighthouse report.

mobile_report: Optional[LighthouseReport]

The Lighthouse report.

region: Optional[LabeledRegion]

A test region with a label.

schedule_frequency: Optional[Literal["DAILY", "WEEKLY"]]

The frequency of the test.

One of the following:
"DAILY"
"WEEKLY"
url: Optional[str]

A URL.

class TestDeleteResponse:
count: Optional[float]

Number of items affected.