# Speed ## Domain Types ### Labeled Region - `LabeledRegion = object { label, value }` A test region with a label. - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` ### Lighthouse Report - `LighthouseReport = object { cls, deviceType, error, 9 more }` The Lighthouse report. - `cls: optional number` Cumulative Layout Shift. - `deviceType: optional "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `error: optional object { code, detail, finalDisplayedUrl }` - `code: optional "NOT_REACHABLE" or "DNS_FAILURE" or "NOT_HTML" or 2 more` The error code of the Lighthouse result. - `"NOT_REACHABLE"` - `"DNS_FAILURE"` - `"NOT_HTML"` - `"LIGHTHOUSE_TIMEOUT"` - `"UNKNOWN"` - `detail: optional string` Detailed error message. - `finalDisplayedUrl: optional string` The final URL displayed to the user. - `fcp: optional number` First Contentful Paint. - `jsonReportUrl: optional string` The URL to the full Lighthouse JSON report. - `lcp: optional number` Largest Contentful Paint. - `performanceScore: optional number` The Lighthouse performance score. - `si: optional number` Speed Index. - `state: optional "RUNNING" or "COMPLETE" or "FAILED"` The state of the Lighthouse report. - `"RUNNING"` - `"COMPLETE"` - `"FAILED"` - `tbt: optional number` Total Blocking Time. - `ttfb: optional number` Time To First Byte. - `tti: optional number` Time To Interactive. ### Trend - `Trend = object { cls, fcp, lcp, 5 more }` - `cls: optional array of number` Cumulative Layout Shift trend. - `fcp: optional array of number` First Contentful Paint trend. - `lcp: optional array of number` Largest Contentful Paint trend. - `performanceScore: optional array of number` The Lighthouse score trend. - `si: optional array of number` Speed Index trend. - `tbt: optional array of number` Total Blocking Time trend. - `ttfb: optional array of number` Time To First Byte trend. - `tti: optional array of number` Time To Interactive trend. # Schedule ## Get a page test schedule **get** `/zones/{zone_id}/speed_api/schedule/{url}` Retrieves the test schedule for a page in a specific region. ### Path Parameters - `zone_id: string` Identifier. - `url: string` A URL. ### Query Parameters - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional Schedule` The test schedule. - `frequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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 string` A URL. ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/schedule/$URL \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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": { "frequency": "DAILY", "region": "us-central1", "url": "example.com" } } ``` ## Create scheduled page test **post** `/zones/{zone_id}/speed_api/schedule/{url}` Creates a scheduled test for a page. ### Path Parameters - `zone_id: string` Identifier. - `url: string` A URL. ### Query Parameters - `frequency: optional "DAILY" or "WEEKLY"` The frequency of the scheduled test. Defaults to WEEKLY for free plans, DAILY for paid plans. - `"DAILY"` - `"WEEKLY"` - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional object { schedule, test }` - `schedule: optional Schedule` The test schedule. - `frequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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 string` A URL. - `test: optional Test` - `id: optional string` UUID. - `date: optional string` - `desktopReport: optional LighthouseReport` The Lighthouse report. - `cls: optional number` Cumulative Layout Shift. - `deviceType: optional "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `error: optional object { code, detail, finalDisplayedUrl }` - `code: optional "NOT_REACHABLE" or "DNS_FAILURE" or "NOT_HTML" or 2 more` The error code of the Lighthouse result. - `"NOT_REACHABLE"` - `"DNS_FAILURE"` - `"NOT_HTML"` - `"LIGHTHOUSE_TIMEOUT"` - `"UNKNOWN"` - `detail: optional string` Detailed error message. - `finalDisplayedUrl: optional string` The final URL displayed to the user. - `fcp: optional number` First Contentful Paint. - `jsonReportUrl: optional string` The URL to the full Lighthouse JSON report. - `lcp: optional number` Largest Contentful Paint. - `performanceScore: optional number` The Lighthouse performance score. - `si: optional number` Speed Index. - `state: optional "RUNNING" or "COMPLETE" or "FAILED"` The state of the Lighthouse report. - `"RUNNING"` - `"COMPLETE"` - `"FAILED"` - `tbt: optional number` Total Blocking Time. - `ttfb: optional number` Time To First Byte. - `tti: optional number` Time To Interactive. - `mobileReport: optional LighthouseReport` The Lighthouse report. - `region: optional LabeledRegion` A test region with a label. - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `url: optional string` A URL. ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/schedule/$URL \ -X POST \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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": { "schedule": { "frequency": "DAILY", "region": "us-central1", "url": "example.com" }, "test": { "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" } } } ``` ## Delete scheduled page test **delete** `/zones/{zone_id}/speed_api/schedule/{url}` Deletes a scheduled test for a page. ### Path Parameters - `zone_id: string` Identifier. - `url: string` A URL. ### Query Parameters - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional object { count }` - `count: optional number` Number of items affected. ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/schedule/$URL \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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": { "count": 1 } } ``` ## Domain Types ### Schedule - `Schedule = object { frequency, region, url }` The test schedule. - `frequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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 string` A URL. ### Schedule Create Response - `ScheduleCreateResponse = object { schedule, test }` - `schedule: optional Schedule` The test schedule. - `frequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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 string` A URL. - `test: optional Test` - `id: optional string` UUID. - `date: optional string` - `desktopReport: optional LighthouseReport` The Lighthouse report. - `cls: optional number` Cumulative Layout Shift. - `deviceType: optional "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `error: optional object { code, detail, finalDisplayedUrl }` - `code: optional "NOT_REACHABLE" or "DNS_FAILURE" or "NOT_HTML" or 2 more` The error code of the Lighthouse result. - `"NOT_REACHABLE"` - `"DNS_FAILURE"` - `"NOT_HTML"` - `"LIGHTHOUSE_TIMEOUT"` - `"UNKNOWN"` - `detail: optional string` Detailed error message. - `finalDisplayedUrl: optional string` The final URL displayed to the user. - `fcp: optional number` First Contentful Paint. - `jsonReportUrl: optional string` The URL to the full Lighthouse JSON report. - `lcp: optional number` Largest Contentful Paint. - `performanceScore: optional number` The Lighthouse performance score. - `si: optional number` Speed Index. - `state: optional "RUNNING" or "COMPLETE" or "FAILED"` The state of the Lighthouse report. - `"RUNNING"` - `"COMPLETE"` - `"FAILED"` - `tbt: optional number` Total Blocking Time. - `ttfb: optional number` Time To First Byte. - `tti: optional number` Time To Interactive. - `mobileReport: optional LighthouseReport` The Lighthouse report. - `region: optional LabeledRegion` A test region with a label. - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `url: optional string` A URL. ### Schedule Delete Response - `ScheduleDeleteResponse = object { count }` - `count: optional number` Number of items affected. # Availabilities ## Get quota and availability **get** `/zones/{zone_id}/speed_api/availabilities` Retrieves quota for all plans, as well as the current zone quota. ### Path Parameters - `zone_id: string` Identifier. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional Availability` - `quota: optional object { plan, quotasPerPlan, remainingSchedules, 2 more }` - `plan: optional string` Cloudflare plan. - `quotasPerPlan: optional object { value }` The number of tests available per plan. - `value: optional object { business, enterprise, free, pro }` Counts per account plan. - `business: optional number` - `enterprise: optional number` - `free: optional number` - `pro: optional number` - `remainingSchedules: optional number` The number of remaining schedules available. - `remainingTests: optional number` The number of remaining tests available. - `scheduleQuotasPerPlan: optional object { value }` The number of schedules available per plan. - `value: optional object { business, enterprise, free, pro }` Counts per account plan. - `business: optional number` - `enterprise: optional number` - `free: optional number` - `pro: optional number` - `regions: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `regionsPerPlan: optional object { business, enterprise, free, pro }` Available regions. - `business: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `enterprise: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `free: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `pro: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/availabilities \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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": { "quota": { "plan": "free", "quotasPerPlan": { "value": { "business": 1, "enterprise": 1, "free": 1, "pro": 1 } }, "remainingSchedules": 1, "remainingTests": 30, "scheduleQuotasPerPlan": { "value": { "business": 1, "enterprise": 1, "free": 1, "pro": 1 } } }, "regions": [ { "label": "Iowa, USA", "value": "us-central1" } ], "regionsPerPlan": { "business": [ { "label": "Iowa, USA", "value": "us-central1" } ], "enterprise": [ { "label": "Iowa, USA", "value": "us-central1" } ], "free": [ { "label": "Iowa, USA", "value": "us-central1" } ], "pro": [ { "label": "Iowa, USA", "value": "us-central1" } ] } } } ``` ## Domain Types ### Availability - `Availability = object { quota, regions, regionsPerPlan }` - `quota: optional object { plan, quotasPerPlan, remainingSchedules, 2 more }` - `plan: optional string` Cloudflare plan. - `quotasPerPlan: optional object { value }` The number of tests available per plan. - `value: optional object { business, enterprise, free, pro }` Counts per account plan. - `business: optional number` - `enterprise: optional number` - `free: optional number` - `pro: optional number` - `remainingSchedules: optional number` The number of remaining schedules available. - `remainingTests: optional number` The number of remaining tests available. - `scheduleQuotasPerPlan: optional object { value }` The number of schedules available per plan. - `value: optional object { business, enterprise, free, pro }` Counts per account plan. - `business: optional number` - `enterprise: optional number` - `free: optional number` - `pro: optional number` - `regions: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `regionsPerPlan: optional object { business, enterprise, free, pro }` Available regions. - `business: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `enterprise: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `free: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `pro: optional array of LabeledRegion` - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. # Pages ## List tested webpages **get** `/zones/{zone_id}/speed_api/pages` Lists all webpages which have been tested. ### Path Parameters - `zone_id: string` Identifier. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional array of object { region, scheduleFrequency, tests, url }` - `region: optional LabeledRegion` A test region with a label. - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `tests: optional array of Test` - `id: optional string` UUID. - `date: optional string` - `desktopReport: optional LighthouseReport` The Lighthouse report. - `cls: optional number` Cumulative Layout Shift. - `deviceType: optional "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `error: optional object { code, detail, finalDisplayedUrl }` - `code: optional "NOT_REACHABLE" or "DNS_FAILURE" or "NOT_HTML" or 2 more` The error code of the Lighthouse result. - `"NOT_REACHABLE"` - `"DNS_FAILURE"` - `"NOT_HTML"` - `"LIGHTHOUSE_TIMEOUT"` - `"UNKNOWN"` - `detail: optional string` Detailed error message. - `finalDisplayedUrl: optional string` The final URL displayed to the user. - `fcp: optional number` First Contentful Paint. - `jsonReportUrl: optional string` The URL to the full Lighthouse JSON report. - `lcp: optional number` Largest Contentful Paint. - `performanceScore: optional number` The Lighthouse performance score. - `si: optional number` Speed Index. - `state: optional "RUNNING" or "COMPLETE" or "FAILED"` The state of the Lighthouse report. - `"RUNNING"` - `"COMPLETE"` - `"FAILED"` - `tbt: optional number` Total Blocking Time. - `ttfb: optional number` Time To First Byte. - `tti: optional number` Time To Interactive. - `mobileReport: optional LighthouseReport` The Lighthouse report. - `region: optional LabeledRegion` A test region with a label. - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `url: optional string` A URL. - `url: optional string` A URL. ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/pages \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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": [ { "region": { "label": "Iowa, USA", "value": "us-central1" }, "scheduleFrequency": "DAILY", "tests": [ { "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" } ], "url": "example.com" } ] } ``` ## List core web vital metrics trend **get** `/zones/{zone_id}/speed_api/pages/{url}/trend` Lists the core web vital metrics trend over time for a specific page. ### Path Parameters - `zone_id: string` Identifier. - `url: string` A URL. ### Query Parameters - `deviceType: "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `metrics: string` A comma-separated list of metrics to include in the results. - `region: "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `start: string` - `tz: string` The timezone of the start and end timestamps. - `end: optional string` ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional Trend` - `cls: optional array of number` Cumulative Layout Shift trend. - `fcp: optional array of number` First Contentful Paint trend. - `lcp: optional array of number` Largest Contentful Paint trend. - `performanceScore: optional array of number` The Lighthouse score trend. - `si: optional array of number` Speed Index trend. - `tbt: optional array of number` Total Blocking Time trend. - `ttfb: optional array of number` Time To First Byte trend. - `tti: optional array of number` Time To Interactive trend. ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/pages/$URL/trend \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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": { "cls": [ 0 ], "fcp": [ 0 ], "lcp": [ 0 ], "performanceScore": [ 0 ], "si": [ 0 ], "tbt": [ 0 ], "ttfb": [ 0 ], "tti": [ 0 ] } } ``` ## Domain Types ### Page List Response - `PageListResponse = object { region, scheduleFrequency, tests, url }` - `region: optional LabeledRegion` A test region with a label. - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `tests: optional array of Test` - `id: optional string` UUID. - `date: optional string` - `desktopReport: optional LighthouseReport` The Lighthouse report. - `cls: optional number` Cumulative Layout Shift. - `deviceType: optional "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `error: optional object { code, detail, finalDisplayedUrl }` - `code: optional "NOT_REACHABLE" or "DNS_FAILURE" or "NOT_HTML" or 2 more` The error code of the Lighthouse result. - `"NOT_REACHABLE"` - `"DNS_FAILURE"` - `"NOT_HTML"` - `"LIGHTHOUSE_TIMEOUT"` - `"UNKNOWN"` - `detail: optional string` Detailed error message. - `finalDisplayedUrl: optional string` The final URL displayed to the user. - `fcp: optional number` First Contentful Paint. - `jsonReportUrl: optional string` The URL to the full Lighthouse JSON report. - `lcp: optional number` Largest Contentful Paint. - `performanceScore: optional number` The Lighthouse performance score. - `si: optional number` Speed Index. - `state: optional "RUNNING" or "COMPLETE" or "FAILED"` The state of the Lighthouse report. - `"RUNNING"` - `"COMPLETE"` - `"FAILED"` - `tbt: optional number` Total Blocking Time. - `ttfb: optional number` Time To First Byte. - `tti: optional number` Time To Interactive. - `mobileReport: optional LighthouseReport` The Lighthouse report. - `region: optional LabeledRegion` A test region with a label. - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `url: optional string` A URL. - `url: optional string` A URL. # Tests ## List page test history **get** `/zones/{zone_id}/speed_api/pages/{url}/tests` Test history (list of tests) for a specific webpage. ### Path Parameters - `zone_id: string` Identifier. - `url: string` A URL. ### Query Parameters - `page: optional number` - `per_page: optional number` - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional array of Test` - `id: optional string` UUID. - `date: optional string` - `desktopReport: optional LighthouseReport` The Lighthouse report. - `cls: optional number` Cumulative Layout Shift. - `deviceType: optional "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `error: optional object { code, detail, finalDisplayedUrl }` - `code: optional "NOT_REACHABLE" or "DNS_FAILURE" or "NOT_HTML" or 2 more` The error code of the Lighthouse result. - `"NOT_REACHABLE"` - `"DNS_FAILURE"` - `"NOT_HTML"` - `"LIGHTHOUSE_TIMEOUT"` - `"UNKNOWN"` - `detail: optional string` Detailed error message. - `finalDisplayedUrl: optional string` The final URL displayed to the user. - `fcp: optional number` First Contentful Paint. - `jsonReportUrl: optional string` The URL to the full Lighthouse JSON report. - `lcp: optional number` Largest Contentful Paint. - `performanceScore: optional number` The Lighthouse performance score. - `si: optional number` Speed Index. - `state: optional "RUNNING" or "COMPLETE" or "FAILED"` The state of the Lighthouse report. - `"RUNNING"` - `"COMPLETE"` - `"FAILED"` - `tbt: optional number` Total Blocking Time. - `ttfb: optional number` Time To First Byte. - `tti: optional number` Time To Interactive. - `mobileReport: optional LighthouseReport` The Lighthouse report. - `region: optional LabeledRegion` A test region with a label. - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `url: optional string` A URL. - `result_info: optional object { count, page, per_page, total_count }` - `count: optional number` - `page: optional number` - `per_page: optional number` - `total_count: optional number` ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/pages/$URL/tests \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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 } } ``` ## Get a page test result **get** `/zones/{zone_id}/speed_api/pages/{url}/tests/{test_id}` Retrieves the result of a specific test. ### Path Parameters - `zone_id: string` Identifier. - `url: string` A URL. - `test_id: string` ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional Test` - `id: optional string` UUID. - `date: optional string` - `desktopReport: optional LighthouseReport` The Lighthouse report. - `cls: optional number` Cumulative Layout Shift. - `deviceType: optional "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `error: optional object { code, detail, finalDisplayedUrl }` - `code: optional "NOT_REACHABLE" or "DNS_FAILURE" or "NOT_HTML" or 2 more` The error code of the Lighthouse result. - `"NOT_REACHABLE"` - `"DNS_FAILURE"` - `"NOT_HTML"` - `"LIGHTHOUSE_TIMEOUT"` - `"UNKNOWN"` - `detail: optional string` Detailed error message. - `finalDisplayedUrl: optional string` The final URL displayed to the user. - `fcp: optional number` First Contentful Paint. - `jsonReportUrl: optional string` The URL to the full Lighthouse JSON report. - `lcp: optional number` Largest Contentful Paint. - `performanceScore: optional number` The Lighthouse performance score. - `si: optional number` Speed Index. - `state: optional "RUNNING" or "COMPLETE" or "FAILED"` The state of the Lighthouse report. - `"RUNNING"` - `"COMPLETE"` - `"FAILED"` - `tbt: optional number` Total Blocking Time. - `ttfb: optional number` Time To First Byte. - `tti: optional number` Time To Interactive. - `mobileReport: optional LighthouseReport` The Lighthouse report. - `region: optional LabeledRegion` A test region with a label. - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `url: optional string` A URL. ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/pages/$URL/tests/$TEST_ID \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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" } } ``` ## Start page test **post** `/zones/{zone_id}/speed_api/pages/{url}/tests` Starts a test for a specific webpage, in a specific region. ### Path Parameters - `zone_id: string` Identifier. - `url: string` A URL. ### Body Parameters - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional Test` - `id: optional string` UUID. - `date: optional string` - `desktopReport: optional LighthouseReport` The Lighthouse report. - `cls: optional number` Cumulative Layout Shift. - `deviceType: optional "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `error: optional object { code, detail, finalDisplayedUrl }` - `code: optional "NOT_REACHABLE" or "DNS_FAILURE" or "NOT_HTML" or 2 more` The error code of the Lighthouse result. - `"NOT_REACHABLE"` - `"DNS_FAILURE"` - `"NOT_HTML"` - `"LIGHTHOUSE_TIMEOUT"` - `"UNKNOWN"` - `detail: optional string` Detailed error message. - `finalDisplayedUrl: optional string` The final URL displayed to the user. - `fcp: optional number` First Contentful Paint. - `jsonReportUrl: optional string` The URL to the full Lighthouse JSON report. - `lcp: optional number` Largest Contentful Paint. - `performanceScore: optional number` The Lighthouse performance score. - `si: optional number` Speed Index. - `state: optional "RUNNING" or "COMPLETE" or "FAILED"` The state of the Lighthouse report. - `"RUNNING"` - `"COMPLETE"` - `"FAILED"` - `tbt: optional number` Total Blocking Time. - `ttfb: optional number` Time To First Byte. - `tti: optional number` Time To Interactive. - `mobileReport: optional LighthouseReport` The Lighthouse report. - `region: optional LabeledRegion` A test region with a label. - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `url: optional string` A URL. ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/pages/$URL/tests \ -X POST \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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" } } ``` ## Delete all page tests **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. ### Path Parameters - `zone_id: string` Identifier. - `url: string` A URL. ### Query Parameters - `region: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: boolean` Whether the API call was successful. - `result: optional object { count }` - `count: optional number` Number of items affected. ### Example ```http curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/speed_api/pages/$URL/tests \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "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": { "count": 1 } } ``` ## Domain Types ### Test - `Test = object { id, date, desktopReport, 4 more }` - `id: optional string` UUID. - `date: optional string` - `desktopReport: optional LighthouseReport` The Lighthouse report. - `cls: optional number` Cumulative Layout Shift. - `deviceType: optional "DESKTOP" or "MOBILE"` The type of device. - `"DESKTOP"` - `"MOBILE"` - `error: optional object { code, detail, finalDisplayedUrl }` - `code: optional "NOT_REACHABLE" or "DNS_FAILURE" or "NOT_HTML" or 2 more` The error code of the Lighthouse result. - `"NOT_REACHABLE"` - `"DNS_FAILURE"` - `"NOT_HTML"` - `"LIGHTHOUSE_TIMEOUT"` - `"UNKNOWN"` - `detail: optional string` Detailed error message. - `finalDisplayedUrl: optional string` The final URL displayed to the user. - `fcp: optional number` First Contentful Paint. - `jsonReportUrl: optional string` The URL to the full Lighthouse JSON report. - `lcp: optional number` Largest Contentful Paint. - `performanceScore: optional number` The Lighthouse performance score. - `si: optional number` Speed Index. - `state: optional "RUNNING" or "COMPLETE" or "FAILED"` The state of the Lighthouse report. - `"RUNNING"` - `"COMPLETE"` - `"FAILED"` - `tbt: optional number` Total Blocking Time. - `ttfb: optional number` Time To First Byte. - `tti: optional number` Time To Interactive. - `mobileReport: optional LighthouseReport` The Lighthouse report. - `region: optional LabeledRegion` A test region with a label. - `label: optional string` - `value: optional "asia-east1" or "asia-northeast1" or "asia-northeast2" or 18 more` A test region. - `"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"` - `scheduleFrequency: optional "DAILY" or "WEEKLY"` The frequency of the test. - `"DAILY"` - `"WEEKLY"` - `url: optional string` A URL. ### Test Delete Response - `TestDeleteResponse = object { count }` - `count: optional number` Number of items affected.