## List core web vital metrics trend `speed.pages.trend(strurl, PageTrendParams**kwargs) -> Trend` **get** `/zones/{zone_id}/speed_api/pages/{url}/trend` Lists the core web vital metrics trend over time for a specific page. ### Parameters - `zone_id: str` Identifier. - `url: str` A URL. - `device_type: Literal["DESKTOP", "MOBILE"]` The type of device. - `"DESKTOP"` - `"MOBILE"` - `metrics: str` A comma-separated list of metrics to include in the results. - `region: Literal["asia-east1", "asia-northeast1", "asia-northeast2", 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: Union[str, datetime]` - `tz: str` The timezone of the start and end timestamps. - `end: Optional[Union[str, datetime]]` ### Returns - `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. ### Example ```python import os from datetime import datetime from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) trend = client.speed.pages.trend( url="example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", device_type="DESKTOP", metrics="performanceScore,ttfb,fcp,si,lcp,tti,tbt,cls", region="us-central1", start=datetime.fromisoformat("2014-01-01T05:20:00.12345"), tz="tz", ) print(trend.cls) ``` #### 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 ] } } ```