AI-generated Key Takeaways
-
Analyzes a webpage's performance and provides PageSpeed scores.
-
Offers suggestions to improve page loading speed based on the analysis.
-
Returns information about user experience metrics such as loading time.
-
Allows specifying the analysis strategy for desktop or mobile devices.
-
Uses Lighthouse to perform a comprehensive audit of the given URL.
Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information. Try it now.
Request
HTTP request
GET https://www.googleapis.com/pagespeedonline/v5/runPagespeed
Parameters
| Parameter name | Value | Description |
|---|---|---|
| Required query parameters | ||
url | string | The URL to fetch and analyze |
| Optional query parameters | ||
category | string | A Lighthouse category to run; if none are given, only Performance category will be run Acceptable values are:
|
locale | string | The locale used to localize formatted results |
strategy | string | The analysis strategy (desktop or mobile) to use, and desktop is the default Acceptable values are:
|
utm_campaign | string | Campaign name for analytics. |
utm_source | string | Campaign source for analytics. |
Request body
Do not supply a request body with this method.
Response
If successful, this method returns a response body with the following structure:
{ "captchaResult": string, "kind": "pagespeedonline#result", "id": string, "loadingExperience": { "id": string, "metrics": { (key): { "percentile": integer, "distributions": [ { "min": integer, "max": integer, "proportion": double } ], "category": string } }, "overall_category": string, "initial_url": string }, "originLoadingExperience": { "id": string, "metrics": { (key): { "percentile": integer, "distributions": [ { "min": integer, "max": integer, "proportion": double } ], "category": string } }, "overall_category": string, "initial_url": string }, "lighthouseResult": { "requestedUrl": string, "finalUrl": string, "lighthouseVersion": string, "userAgent": string, "fetchTime": string, "environment": { "networkUserAgent": string, "hostUserAgent": string, "benchmarkIndex": double }, "runWarnings": [ (value) ], "configSettings": { "emulatedFormFactor": string, "locale": string, "onlyCategories": (value), "onlyCategories": (value) }, "audits": { (key): { "id": string, "title": string, "description": string, "score": (value), "score": (value), "scoreDisplayMode": string, "displayValue": string, "explanation": string, "errorMessage": string, "warnings": (value), "warnings": (value), "details": { (key): (value) } } }, "categories": { (key): { "id": string, "title": string, "description": string, "score": (value), "score": (value), "manualDescription": string, "auditRefs": [ { "id": string, "weight": double, "group": string } ] } }, "categoryGroups": { (key): { "title": string, "description": string } }, "runtimeError": { "code": string, "message": string }, "timing": { "total": double }, "i18n": { "rendererFormattedStrings": { "varianceDisclaimer": string, "opportunityResourceColumnLabel": string, "opportunitySavingsColumnLabel": string, "errorMissingAuditInfo": string, "errorLabel": string, "warningHeader": string, "auditGroupExpandTooltip": string, "passedAuditsGroupTitle": string, "notApplicableAuditsGroupTitle": string, "manualAuditsGroupTitle": string, "toplevelWarningsMessage": string, "scorescaleLabel": string, "crcLongestDurationLabel": string, "crcInitialNavigation": string, "lsPerformanceCategoryDescription": string, "labDataTitle": string } } }, "analysisUTCTimestamp": string, "version": { "major": integer, "minor": integer } }| Property name | Value | Description | Notes |
|---|---|---|---|
captchaResult | string | The captcha verify result Acceptable values are:
| |
kind | string | Kind of result. | |
id | string | Canonicalized and final URL for the document, after following page redirects (if any). | |
loadingExperience | nested object | Metrics of end users' page loading experience. | |
loadingExperience.id | string | The url, pattern or origin which the metrics are on. | |
loadingExperience.metrics | object | ||
loadingExperience.metrics.(key) | object | The type of the metric. | |
loadingExperience.metrics.(key).distributions[] | list | ||
loadingExperience.metrics.(key).distributions[].min | integer | ||
loadingExperience.metrics.(key).distributions[].max | integer | ||
loadingExperience.metrics.(key).distributions[].proportion | double | ||
version | object | The version of PageSpeed used to generate these results. | |
version.major | integer | The major version number of PageSpeed used to generate these results. | |
version.minor | integer | The minor version number of PageSpeed used to generate these results. | |
loadingExperience.metrics.(key).category | string | Acceptable values are:
| |
loadingExperience.overall_category | string | Acceptable values are:
| |
loadingExperience.initial_url | string | ||
loadingExperience.metrics.(key).percentile | integer | ||
originLoadingExperience | nested object | Metrics of the aggregated page loading experience of the origin | |
originLoadingExperience.id | string | The url, pattern or origin which the metrics are on. | |
originLoadingExperience.metrics | object | ||
originLoadingExperience.metrics.(key) | object | The type of the metric. | |
originLoadingExperience.metrics.(key).percentile | integer | ||
originLoadingExperience.metrics.(key).distributions[] | list | ||
originLoadingExperience.metrics.(key).distributions[].min | integer | ||
originLoadingExperience.metrics.(key).distributions[].max | integer | ||
originLoadingExperience.metrics.(key).distributions[].proportion | double | ||
originLoadingExperience.metrics.(key).category | string | Acceptable values are:
| |
originLoadingExperience.overall_category | string | Acceptable values are:
| |
originLoadingExperience.initial_url | string | ||
analysisUTCTimestamp | string | The UTC timestamp of this analysis. | |
lighthouseResult | nested object | Lighthouse response for the audit url as an object. | |
lighthouseResult.requestedUrl | string | The original requested url. | |
lighthouseResult.finalUrl | string | The final resolved url that was audited. | |
lighthouseResult.lighthouseVersion | string | The lighthouse version that was used to generate this LHR. | |
lighthouseResult.userAgent | string | The user agent that was used to run this LHR. | |
lighthouseResult.fetchTime | string | The time that this run was fetched. | |
lighthouseResult.environment | object | Environment settings that were used when making this LHR. | |
lighthouseResult.environment.networkUserAgent | string | ||
lighthouseResult.environment.hostUserAgent | string | ||
lighthouseResult.environment.benchmarkIndex | double | ||
lighthouseResult.runWarnings[] | list | List of all run warnings in the LHR. Will always output to at least `[]`. | |
lighthouseResult.configSettings | object | The configuration settings for this LHR. | |
lighthouseResult.configSettings.emulatedFormFactor | string | The form factor the emulation should use Acceptable values are:
| |
lighthouseResult.configSettings.locale | string | The locale setting | |
lighthouseResult.configSettings.onlyCategories | nested object | ||
lighthouseResult.audits | object | Map of audits in the LHR. | |
lighthouseResult.audits.(key) | nested object | ||
lighthouseResult.audits.(key).id | string | The audit's id. | |
lighthouseResult.audits.(key).title | string | The human readable title. | |
lighthouseResult.audits.(key).description | string | The description of the audit. | |
lighthouseResult.audits.(key).score | nested object | ||
lighthouseResult.audits.(key).scoreDisplayMode | string | The enumerated score display mode. Acceptable values are:
| |
lighthouseResult.audits.(key).displayValue | string | The value that should be displayed on the UI for this audit. | |
lighthouseResult.audits.(key).explanation | string | An explanation of the errors in the audit. | |
lighthouseResult.audits.(key).errorMessage | string | An error message from a thrown error inside the audit. | |
lighthouseResult.audits.(key).warnings | nested object | ||
lighthouseResult.audits.(key).details | object | Freeform details section of the audit. | |
lighthouseResult.audits.(key).details.(key) | any value | ||
lighthouseResult.categories | object | Map of categories in the LHR. | |
lighthouseResult.categories.(key) | nested object | ||
lighthouseResult.categories.(key).id | string | The string identifier of the category. | |
lighthouseResult.categories.(key).title | string | The human-friendly name of the category | |
lighthouseResult.categories.(key).description | string | A more detailed description of the category and its importance. | |
lighthouseResult.categories.(key).score | nested object | ||
lighthouseResult.categories.(key).manualDescription | string | A description for the manual audits in the category. | |
lighthouseResult.categories.(key).auditRefs[] | list | An array of references to all the audit members of this category. | |
lighthouseResult.categories.(key).auditRefs[].id | string | The audit ref id. | |
lighthouseResult.categories.(key).auditRefs[].weight | double | The weight this audit's score has on the overall category score. | |
lighthouseResult.categories.(key).auditRefs[].group | string | The category group that the audit belongs to (optional). | |
lighthouseResult.categoryGroups | object | Map of category groups in the LHR. | |
lighthouseResult.categoryGroups.(key) | object | ||
lighthouseResult.categoryGroups.(key).title | string | ||
lighthouseResult.categoryGroups.(key).description | string | ||
lighthouseResult.runtimeError | object | Object containing the code + message of any thrown runtime errors. | |
lighthouseResult.runtimeError.code | string | Acceptable values are:
| |
lighthouseResult.runtimeError.message | string | ||
lighthouseResult.timing | object | Timing information for this LHR. | |
lighthouseResult.timing.total | double | The total duration of Lighthouse's run | |
lighthouseResult.i18n | object | The internationalization strings that are required to render the LHR. | |
lighthouseResult.i18n.rendererFormattedStrings | object | ||
lighthouseResult.i18n.rendererFormattedStrings.varianceDisclaimer | string | ||
lighthouseResult.i18n.rendererFormattedStrings.opportunityResourceColumnLabel | string | ||
lighthouseResult.i18n.rendererFormattedStrings.opportunitySavingsColumnLabel | string | ||
lighthouseResult.i18n.rendererFormattedStrings.errorMissingAuditInfo | string | ||
lighthouseResult.i18n.rendererFormattedStrings.errorLabel | string | ||
lighthouseResult.i18n.rendererFormattedStrings.warningHeader | string | ||
lighthouseResult.i18n.rendererFormattedStrings.auditGroupExpandTooltip | string | ||
lighthouseResult.i18n.rendererFormattedStrings.passedAuditsGroupTitle | string | ||
lighthouseResult.i18n.rendererFormattedStrings.notApplicableAuditsGroupTitle | string | ||
lighthouseResult.i18n.rendererFormattedStrings.manualAuditsGroupTitle | string | ||
lighthouseResult.i18n.rendererFormattedStrings.toplevelWarningsMessage | string | ||
lighthouseResult.i18n.rendererFormattedStrings.scorescaleLabel | string | ||
lighthouseResult.i18n.rendererFormattedStrings.crcLongestDurationLabel | string | ||
lighthouseResult.i18n.rendererFormattedStrings.crcInitialNavigation | string | ||
lighthouseResult.i18n.rendererFormattedStrings.lsPerformanceCategoryDescription | string | ||
lighthouseResult.i18n.rendererFormattedStrings.labDataTitle | string |
Try it!
Use the APIs Explorer below to call this method on live data and see the response.