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.
HTTP request
GET https://pagespeedonline.googleapis.com/pagespeedonline/v5/runPagespeed
The URL uses gRPC Transcoding syntax.
Query parameters
Parameters | |
---|---|
category
|
A Lighthouse category to run; if none are given, only Performance category will be run |
locale
|
The locale used to localize formatted results |
strategy
|
The analysis strategy (desktop or mobile) to use, and desktop is the default |
url
|
Required. The URL to fetch and analyze |
utm_campaign
|
Campaign name for analytics. |
utm_source
|
Campaign source for analytics. |
captchaToken
|
The captcha token passed when filling out a captcha. |
Request body
The request body must be empty.
Response body
If successful, the response body contains data with the following structure:
The Pagespeed API response object.
JSON representation | |
---|---|
{ "kind" : string , "captchaResult" : string , "id" : string , "loadingExperience" : { object ( |
Fields | |
---|---|
kind
|
Kind of result. |
captchaResult
|
The captcha verify result |
id
|
Canonicalized and final URL for the document, after following page redirects (if any). |
loadingExperience
|
Metrics of end users' page loading experience. |
originLoadingExperience
|
Metrics of the aggregated page loading experience of the origin |
analysisUTCTimestamp
|
The UTC timestamp of this analysis. |
lighthouseResult
|
Lighthouse response for the audit url as an object. |
version
|
The version of PageSpeed used to generate these results. |
Authorization Scopes
Requires the following OAuth scope:
-
openid
For more information, see the OAuth 2.0 Overview .
Category
The enumerated categories that should be analyzed.
Enums | |
---|---|
CATEGORY_UNSPECIFIED
|
Default UNDEFINED category. |
ACCESSIBILITY
|
Accessibility (a11y), category pertaining to a website's capacity to be accessible to all users. |
BEST_PRACTICES
|
Best Practices, category pertaining to a website's conformance to web best practice. |
PERFORMANCE
|
Performance, category pertaining to a website's performance. |
SEO
|
Search Engine Optimization (SEO), category pertaining to a website's ability to be indexed by search engines. |
Strategy
The device running strategy to be used in analysis.
Enums | |
---|---|
STRATEGY_UNSPECIFIED
|
UNDEFINED. |
DESKTOP
|
Fetch and analyze the URL for desktop browsers. |
MOBILE
|
Fetch and analyze the URL for mobile devices. |
PagespeedApiLoadingExperienceV5
The CrUX loading experience object that contains CrUX data breakdowns.
JSON representation | |
---|---|
{
"id"
:
string
,
"metrics"
:
{
string
:
{
object (
|
Fields | |
---|---|
id
|
The url, pattern or origin which the metrics are on. |
metrics
|
The map of <metrics, data>. An object containing a list of |
overall_category
|
The human readable speed "category" of the id. |
initial_url
|
The requested URL, which may differ from the resolved "id". |
origin_fallback
|
True if the result is an origin fallback from a page, false otherwise. |
LighthouseResultV5
The Lighthouse result object.
JSON representation | |
---|---|
{ "fetchTime" : string , "requestedUrl" : string , "finalUrl" : string , "lighthouseVersion" : string , "i18n" : { object ( |
Fields | |
---|---|
fetchTime
|
The time that this run was fetched. |
requestedUrl
|
The original requested url. |
finalUrl
|
The final resolved url that was audited. |
lighthouseVersion
|
The lighthouse version that was used to generate this LHR. |
i18n
|
The internationalization strings that are required to render the LHR. |
userAgent
|
The user agent that was used to run this LHR. |
audits
|
Map of audits in the LHR. An object containing a list of |
categoryGroups
|
Map of category groups in the LHR. An object containing a list of |
stackPacks[]
|
The Stack Pack advice strings. |
environment
|
Environment settings that were used when making this LHR. |
runWarnings
|
List of all run warnings in the LHR. Will always output to at least |
runtimeError
|
A top-level error message that, if present, indicates a serious enough problem that this Lighthouse result may need to be discarded. |
categories
|
Map of categories in the LHR. |
timing
|
Timing information for this LHR. |
configSettings
|
The configuration settings for this LHR. |
I18n
Message containing the i18n data for the LHR - Version 1.
JSON representation | |
---|---|
{
"rendererFormattedStrings"
:
{
object (
|
Fields | |
---|---|
rendererFormattedStrings
|
Internationalized strings that are formatted to the locale in configSettings. |
RendererFormattedStrings
Message holding the formatted strings used in the renderer.
JSON representation | |
---|---|
{ "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 } |
Fields | |
---|---|
varianceDisclaimer
|
The disclaimer shown below a performance metric value. |
opportunityResourceColumnLabel
|
The heading for the estimated page load savings opportunity of an audit. |
opportunitySavingsColumnLabel
|
The heading for the estimated page load savings of opportunity audits. |
errorMissingAuditInfo
|
The error string shown next to an erroring audit. |
errorLabel
|
The label shown next to an audit or metric that has had an error. |
warningHeader
|
The label shown above a bulleted list of warnings. |
auditGroupExpandTooltip
|
The tooltip text on an expandable chevron icon. |
passedAuditsGroupTitle
|
The heading that is shown above a list of audits that are passing. |
notApplicableAuditsGroupTitle
|
The heading shown above a list of audits that do not apply to a page. |
manualAuditsGroupTitle
|
The heading shown above a list of audits that were not computerd in the run. |
scorescaleLabel
|
The label that explains the score gauges scale (0-49, 50-89, 90-100). |
crcLongestDurationLabel
|
The label for values shown in the summary of critical request chains. |
crcInitialNavigation
|
The label for the initial request in a critical request chain. |
lsPerformanceCategoryDescription
|
The disclaimer shown under performance explaning that the network can vary. |
labDataTitle
|
The title of the lab data performance category. |
StackPack
Message containing Stack Pack information.
JSON representation | |
---|---|
{ "id" : string , "title" : string , "iconDataURL" : string , "descriptions" : { string : string , ... } } |
Fields | |
---|---|
id
|
The stack pack id. |
title
|
The stack pack title. |
iconDataURL
|
The stack pack icon data uri. |
descriptions
|
The stack pack advice strings. An object containing a list of |
Environment
Message containing environment configuration for a Lighthouse run.
JSON representation | |
---|---|
{ "networkUserAgent" : string , "hostUserAgent" : string , "benchmarkIndex" : number } |
Fields | |
---|---|
networkUserAgent
|
The user agent string that was sent over the network. |
hostUserAgent
|
The user agent string of the version of Chrome used. |
benchmarkIndex
|
The benchmark index number that indicates rough device class. |
RuntimeError
Message containing a runtime error config.
JSON representation | |
---|---|
{ "code" : string , "message" : string } |
Fields | |
---|---|
code
|
The enumerated Lighthouse Error code. |
Categories
The categories in a Lighthouse run.
JSON representation | |
---|---|
{ "accessibility" : { object ( |
Fields | |
---|---|
accessibility
|
The accessibility category, containing all accessibility related audits. |
best-practices
|
The best practices category, containing all best practices related audits. |
seo
|
The Search-Engine-Optimization (SEO) category, containing all seo related audits. |
performance
|
The performance category, containing all performance related audits. |
LighthouseCategoryV5
A Lighthouse category.
JSON representation | |
---|---|
{
"id"
:
string
,
"title"
:
string
,
"description"
:
string
,
"manualDescription"
:
string
,
"auditRefs"
:
[
{
object (
|
Fields | |
---|---|
id
|
The string identifier of the category. |
title
|
The human-friendly name of the category. |
description
|
A more detailed description of the category and its importance. |
manualDescription
|
A description for the manual audits in the category. |
auditRefs[]
|
An array of references to all the audit members of this category. |
score
|
The overall score of the category, the weighted average of all its audits. (The category's score, can be null.) |
AuditRefs
A light reference to an audit by id, used to group and weight audits in a given category.
JSON representation | |
---|---|
{ "id" : string , "weight" : number , "group" : string } |
Fields | |
---|---|
id
|
The audit ref id. |
weight
|
The weight this audit's score has on the overall category score. |
group
|
The category group that the audit belongs to (optional). |
Timing
Message containing the performance timing data for the Lighthouse run.
JSON representation | |
---|---|
{ "total" : number } |
Fields | |
---|---|
total
|
The total duration of Lighthouse's run. |
ConfigSettings
Message containing the configuration settings for the Lighthouse run.
JSON representation | |
---|---|
{ "onlyCategories" : value , "emulatedFormFactor" : string , "locale" : string , "channel" : string , "formFactor" : string } |
Fields | |
---|---|
onlyCategories
|
List of categories of audits the run should conduct. |
emulatedFormFactor
|
The form factor the emulation should use. This field is deprecated, formFactor should be used instead. |
locale
|
The locale setting. |
channel
|
How Lighthouse was run, e.g. from the Chrome extension or from the npm module. |
formFactor
|
How Lighthouse should interpret this run in regards to scoring performance metrics and skipping mobile-only tests in desktop. |
PagespeedVersion
The Pagespeed Version object.
JSON representation | |
---|---|
{ "major" : string , "minor" : string } |
Fields | |
---|---|
major
|
The major version number of PageSpeed used to generate these results. |
minor
|
The minor version number of PageSpeed used to generate these results. |