blob: 6ad545d28cbb6924416d895ade4455c240579f65 [file] [log] [blame]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="pagespeedonline_v5.html">PageSpeed Insights API</a> . <a href="pagespeedonline_v5.pagespeedapi.html">pagespeedapi</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#runpagespeed">runpagespeed(utm_source=None, captchaToken=None, locale=None, url=None, category=None, strategy=None, utm_campaign=None, x__xgafv=None)</a></code></p>
<p class="firstline">Runs PageSpeed analysis on the page at the specified URL, and returns</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="runpagespeed">runpagespeed(utm_source=None, captchaToken=None, locale=None, url=None, category=None, strategy=None, utm_campaign=None, x__xgafv=None)</code>
<pre>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.
Args:
utm_source: string, Campaign source for analytics.
captchaToken: string, The captcha token passed when filling out a captcha.
locale: string, The locale used to localize formatted results
url: string, The URL to fetch and analyze
category: string, A Lighthouse category to run; if none are given, only Performance category
will be run (repeated)
strategy: string, The analysis strategy (desktop or mobile) to use, and desktop is the
default
utm_campaign: string, Campaign name for analytics.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # The Pagespeed API response object.
&quot;originLoadingExperience&quot;: { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of the aggregated page loading experience of the origin
&quot;origin_fallback&quot;: True or False, # True if the result is an origin fallback from a page, false otherwise.
&quot;overall_category&quot;: &quot;A String&quot;, # The human readable speed &quot;category&quot; of the id.
&quot;initial_url&quot;: &quot;A String&quot;, # The requested URL, which may differ from the resolved &quot;id&quot;.
&quot;metrics&quot;: { # The map of &lt;metrics, data&gt;.
&quot;a_key&quot;: { # A CrUX metric object for a single metric and form factor.
&quot;distributions&quot;: [ # Metric distributions. Proportions should sum up to 1.
{ # A proportion of data in the total distribution, bucketed by a min/max
# percentage. Each bucket&#x27;s range is bounded by min &lt;= x &lt; max, In
# millisecond.
&quot;min&quot;: 42, # Lower bound for a bucket&#x27;s range.
&quot;max&quot;: 42, # Upper bound for a bucket&#x27;s range.
&quot;proportion&quot;: 3.14, # The proportion of data in this bucket.
},
],
&quot;percentile&quot;: 42, # We use this field to store certain percentile value for this metric.
# For v4, this field contains pc50.
# For v5, this field contains pc90.
&quot;category&quot;: &quot;A String&quot;, # The category of the specific time metric.
&quot;metricId&quot;: &quot;A String&quot;, # Identifies the type of the metric.
&quot;median&quot;: 42, # The median number of the metric, in millisecond.
&quot;formFactor&quot;: &quot;A String&quot;, # Identifies the form factor of the metric being collected.
},
},
&quot;id&quot;: &quot;A String&quot;, # The url, pattern or origin which the metrics are on.
},
&quot;id&quot;: &quot;A String&quot;, # Canonicalized and final URL for the document, after following page
# redirects (if any).
&quot;lighthouseResult&quot;: { # The Lighthouse result object. # Lighthouse response for the audit url as an object.
&quot;environment&quot;: { # Message containing environment configuration for a Lighthouse run. # Environment settings that were used when making this LHR.
&quot;networkUserAgent&quot;: &quot;A String&quot;, # The user agent string that was sent over the network.
&quot;benchmarkIndex&quot;: 3.14, # The benchmark index number that indicates rough device class.
&quot;hostUserAgent&quot;: &quot;A String&quot;, # The user agent string of the version of Chrome used.
},
&quot;runWarnings&quot;: [ # List of all run warnings in the LHR. Will always output to at least `[]`.
&quot;&quot;,
],
&quot;stackPacks&quot;: [ # The Stack Pack advice strings.
{ # Message containing Stack Pack information.
&quot;iconDataURL&quot;: &quot;A String&quot;, # The stack pack icon data uri.
&quot;descriptions&quot;: { # The stack pack advice strings.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;title&quot;: &quot;A String&quot;, # The stack pack title.
&quot;id&quot;: &quot;A String&quot;, # The stack pack id.
},
],
&quot;runtimeError&quot;: { # Message containing a runtime error config. # A top-level error message that, if present, indicates a serious enough
# problem that this Lighthouse result may need to be discarded.
&quot;message&quot;: &quot;A String&quot;, # A human readable message explaining the error code.
&quot;code&quot;: &quot;A String&quot;, # The enumerated Lighthouse Error code.
},
&quot;fetchTime&quot;: &quot;A String&quot;, # The time that this run was fetched.
&quot;userAgent&quot;: &quot;A String&quot;, # The user agent that was used to run this LHR.
&quot;finalUrl&quot;: &quot;A String&quot;, # The final resolved url that was audited.
&quot;timing&quot;: { # Message containing the performance timing data for the Lighthouse run. # Timing information for this LHR.
&quot;total&quot;: 3.14, # The total duration of Lighthouse&#x27;s run.
},
&quot;audits&quot;: { # Map of audits in the LHR.
&quot;a_key&quot;: { # An audit&#x27;s result object in a Lighthouse result.
&quot;details&quot;: { # Freeform details section of the audit.
&quot;a_key&quot;: &quot;&quot;, # Properties of the object.
},
&quot;warnings&quot;: &quot;&quot;, # Possible warnings that occurred in the audit, can be null.
&quot;numericValue&quot;: 3.14, # A numeric value that has a meaning specific to the audit, e.g. the number
# of nodes in the DOM or the timestamp of a specific load event. More
# information can be found in the audit details, if present.
&quot;scoreDisplayMode&quot;: &quot;A String&quot;, # The enumerated score display mode.
&quot;description&quot;: &quot;A String&quot;, # The description of the audit.
&quot;displayValue&quot;: &quot;A String&quot;, # The value that should be displayed on the UI for this audit.
&quot;explanation&quot;: &quot;A String&quot;, # An explanation of the errors in the audit.
&quot;title&quot;: &quot;A String&quot;, # The human readable title.
&quot;id&quot;: &quot;A String&quot;, # The audit&#x27;s id.
&quot;errorMessage&quot;: &quot;A String&quot;, # An error message from a thrown error inside the audit.
&quot;score&quot;: &quot;&quot;, # The score of the audit, can be null.
},
},
&quot;configSettings&quot;: { # Message containing the configuration settings for the Lighthouse run. # The configuration settings for this LHR.
&quot;channel&quot;: &quot;A String&quot;, # How Lighthouse was run, e.g. from the Chrome extension or from the npm
# module.
&quot;onlyCategories&quot;: &quot;&quot;, # List of categories of audits the run should conduct.
&quot;locale&quot;: &quot;A String&quot;, # The locale setting.
&quot;emulatedFormFactor&quot;: &quot;A String&quot;, # The form factor the emulation should use.
},
&quot;requestedUrl&quot;: &quot;A String&quot;, # The original requested url.
&quot;categoryGroups&quot;: { # Map of category groups in the LHR.
&quot;a_key&quot;: { # Message containing a category
&quot;title&quot;: &quot;A String&quot;, # The human readable title of the group
&quot;description&quot;: &quot;A String&quot;, # The description of what the category is grouping
},
},
&quot;categories&quot;: { # The categories in a Lighthouse run. # Map of categories in the LHR.
&quot;pwa&quot;: { # A Lighthouse category. # The Progressive-Web-App (PWA) category, containing all pwa related
# audits.
&quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
{ # A light reference to an audit by id, used to group and weight audits in a
# given category.
&quot;id&quot;: &quot;A String&quot;, # The audit ref id.
&quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
&quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
},
],
&quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
&quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
&quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
# (The category&#x27;s score, can be null.)
&quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
&quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
},
&quot;accessibility&quot;: { # A Lighthouse category. # The accessibility category, containing all accessibility related audits.
&quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
{ # A light reference to an audit by id, used to group and weight audits in a
# given category.
&quot;id&quot;: &quot;A String&quot;, # The audit ref id.
&quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
&quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
},
],
&quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
&quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
&quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
# (The category&#x27;s score, can be null.)
&quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
&quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
},
&quot;performance&quot;: { # A Lighthouse category. # The performance category, containing all performance related audits.
&quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
{ # A light reference to an audit by id, used to group and weight audits in a
# given category.
&quot;id&quot;: &quot;A String&quot;, # The audit ref id.
&quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
&quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
},
],
&quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
&quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
&quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
# (The category&#x27;s score, can be null.)
&quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
&quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
},
&quot;best-practices&quot;: { # A Lighthouse category. # The best practices category, containing all best practices related
# audits.
&quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
{ # A light reference to an audit by id, used to group and weight audits in a
# given category.
&quot;id&quot;: &quot;A String&quot;, # The audit ref id.
&quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
&quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
},
],
&quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
&quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
&quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
# (The category&#x27;s score, can be null.)
&quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
&quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
},
&quot;seo&quot;: { # A Lighthouse category. # The Search-Engine-Optimization (SEO) category, containing all seo related
# audits.
&quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
{ # A light reference to an audit by id, used to group and weight audits in a
# given category.
&quot;id&quot;: &quot;A String&quot;, # The audit ref id.
&quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
&quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
},
],
&quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
&quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
&quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
# (The category&#x27;s score, can be null.)
&quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
&quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
},
},
&quot;lighthouseVersion&quot;: &quot;A String&quot;, # The lighthouse version that was used to generate this LHR.
&quot;i18n&quot;: { # Message containing the i18n data for the LHR - Version 1. # The internationalization strings that are required to render the LHR.
&quot;rendererFormattedStrings&quot;: { # Message holding the formatted strings used in the renderer. # Internationalized strings that are formatted to the locale in
# configSettings.
&quot;opportunityResourceColumnLabel&quot;: &quot;A String&quot;, # The heading for the estimated page load savings opportunity of an
# audit.
&quot;errorMissingAuditInfo&quot;: &quot;A String&quot;, # The error string shown next to an erroring audit.
&quot;errorLabel&quot;: &quot;A String&quot;, # The label shown next to an audit or metric that has had an error.
&quot;labDataTitle&quot;: &quot;A String&quot;, # The title of the lab data performance category.
&quot;crcLongestDurationLabel&quot;: &quot;A String&quot;, # The label for values shown in the summary of critical request chains.
&quot;crcInitialNavigation&quot;: &quot;A String&quot;, # The label for the initial request in a critical request chain.
&quot;scorescaleLabel&quot;: &quot;A String&quot;, # The label that explains the score gauges scale (0-49, 50-89, 90-100).
&quot;notApplicableAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading shown above a list of audits that do not apply to a page.
&quot;passedAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading that is shown above a list of audits that are passing.
&quot;manualAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading shown above a list of audits that were not computerd in the
# run.
&quot;toplevelWarningsMessage&quot;: &quot;A String&quot;, # The label shown preceding important warnings that may have invalidated
# an entire report.
&quot;opportunitySavingsColumnLabel&quot;: &quot;A String&quot;, # The heading for the estimated page load savings of opportunity audits.
&quot;lsPerformanceCategoryDescription&quot;: &quot;A String&quot;, # The disclaimer shown under performance explaning that the network can
# vary.
&quot;auditGroupExpandTooltip&quot;: &quot;A String&quot;, # The tooltip text on an expandable chevron icon.
&quot;warningHeader&quot;: &quot;A String&quot;, # The label shown above a bulleted list of warnings.
&quot;varianceDisclaimer&quot;: &quot;A String&quot;, # The disclaimer shown below a performance metric value.
},
},
},
&quot;analysisUTCTimestamp&quot;: &quot;A String&quot;, # The UTC timestamp of this analysis.
&quot;version&quot;: { # The Pagespeed Version object. # The version of PageSpeed used to generate these results.
&quot;minor&quot;: &quot;A String&quot;, # The minor version number of PageSpeed used to generate these results.
&quot;major&quot;: &quot;A String&quot;, # The major version number of PageSpeed used to generate these results.
},
&quot;kind&quot;: &quot;A String&quot;, # Kind of result.
&quot;captchaResult&quot;: &quot;A String&quot;, # The captcha verify result
&quot;loadingExperience&quot;: { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of end users&#x27; page loading experience.
&quot;origin_fallback&quot;: True or False, # True if the result is an origin fallback from a page, false otherwise.
&quot;overall_category&quot;: &quot;A String&quot;, # The human readable speed &quot;category&quot; of the id.
&quot;initial_url&quot;: &quot;A String&quot;, # The requested URL, which may differ from the resolved &quot;id&quot;.
&quot;metrics&quot;: { # The map of &lt;metrics, data&gt;.
&quot;a_key&quot;: { # A CrUX metric object for a single metric and form factor.
&quot;distributions&quot;: [ # Metric distributions. Proportions should sum up to 1.
{ # A proportion of data in the total distribution, bucketed by a min/max
# percentage. Each bucket&#x27;s range is bounded by min &lt;= x &lt; max, In
# millisecond.
&quot;min&quot;: 42, # Lower bound for a bucket&#x27;s range.
&quot;max&quot;: 42, # Upper bound for a bucket&#x27;s range.
&quot;proportion&quot;: 3.14, # The proportion of data in this bucket.
},
],
&quot;percentile&quot;: 42, # We use this field to store certain percentile value for this metric.
# For v4, this field contains pc50.
# For v5, this field contains pc90.
&quot;category&quot;: &quot;A String&quot;, # The category of the specific time metric.
&quot;metricId&quot;: &quot;A String&quot;, # Identifies the type of the metric.
&quot;median&quot;: 42, # The median number of the metric, in millisecond.
&quot;formFactor&quot;: &quot;A String&quot;, # Identifies the form factor of the metric being collected.
},
},
&quot;id&quot;: &quot;A String&quot;, # The url, pattern or origin which the metrics are on.
},
}</pre>
</div>
</body></html>