blob: ac0f127f52482d6e6e6b017cceff2bbd5804d384 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="pagespeedonline_v5.html">PageSpeed Insights API</a> . <a href="pagespeedonline_v5.pagespeedapi.html">pagespeedapi</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -080081 <code><a href="#runpagespeed">runpagespeed(strategy=None, url=None, captchaToken=None, category=None, locale=None, utm_campaign=None, utm_source=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070082<p class="firstline">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.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070083<h3>Method Details</h3>
84<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070085 <code class="details" id="close">close()</code>
86 <pre>Close httplib2 connections.</pre>
87</div>
88
89<div class="method">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -080090 <code class="details" id="runpagespeed">runpagespeed(strategy=None, url=None, captchaToken=None, category=None, locale=None, utm_campaign=None, utm_source=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070091 <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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070092
93Args:
Yoshi Automation Botc2228be2020-11-24 15:48:03 -080094 strategy: string, The analysis strategy (desktop or mobile) to use, and desktop is the default
95 Allowed values
96 STRATEGY_UNSPECIFIED - UNDEFINED.
97 DESKTOP - Fetch and analyze the URL for desktop browsers.
98 MOBILE - Fetch and analyze the URL for mobile devices.
99 url: string, Required. The URL to fetch and analyze
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700100 captchaToken: string, The captcha token passed when filling out a captcha.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700101 category: string, A Lighthouse category to run; if none are given, only Performance category will be run (repeated)
102 Allowed values
103 CATEGORY_UNSPECIFIED - Default UNDEFINED category.
104 ACCESSIBILITY - Accessibility (a11y), category pertaining to a website&#x27;s capacity to be accessible to all users.
105 BEST_PRACTICES - Best Practices, category pertaining to a website&#x27;s conformance to web best practice.
106 PERFORMANCE - Performance, category pertaining to a website&#x27;s performance.
107 PWA - Progressive Web App (PWA), category pertaining to a website&#x27;s ability to be run as a PWA.
108 SEO - Search Engine Optimization (SEO), category pertaining to a website&#x27;s ability to be indexed by search engines.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800109 locale: string, The locale used to localize formatted results
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700110 utm_campaign: string, Campaign name for analytics.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700111 utm_source: string, Campaign source for analytics.
Dan O'Mearadd494642020-05-01 07:42:23 -0700112 x__xgafv: string, V1 error format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700113 Allowed values
Dan O'Mearadd494642020-05-01 07:42:23 -0700114 1 - v1 error format
115 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700116
117Returns:
118 An object of the form:
119
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 { # The Pagespeed API response object.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800121 &quot;analysisUTCTimestamp&quot;: &quot;A String&quot;, # The UTC timestamp of this analysis.
122 &quot;version&quot;: { # The Pagespeed Version object. # The version of PageSpeed used to generate these results.
123 &quot;major&quot;: &quot;A String&quot;, # The major version number of PageSpeed used to generate these results.
124 &quot;minor&quot;: &quot;A String&quot;, # The minor version number of PageSpeed used to generate these results.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700125 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700126 &quot;kind&quot;: &quot;A String&quot;, # Kind of result.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800127 &quot;id&quot;: &quot;A String&quot;, # Canonicalized and final URL for the document, after following page redirects (if any).
128 &quot;lighthouseResult&quot;: { # The Lighthouse result object. # Lighthouse response for the audit url as an object.
129 &quot;fetchTime&quot;: &quot;A String&quot;, # The time that this run was fetched.
130 &quot;configSettings&quot;: { # Message containing the configuration settings for the Lighthouse run. # The configuration settings for this LHR.
131 &quot;onlyCategories&quot;: &quot;&quot;, # List of categories of audits the run should conduct.
132 &quot;emulatedFormFactor&quot;: &quot;A String&quot;, # The form factor the emulation should use.
133 &quot;channel&quot;: &quot;A String&quot;, # How Lighthouse was run, e.g. from the Chrome extension or from the npm module.
134 &quot;locale&quot;: &quot;A String&quot;, # The locale setting.
135 },
136 &quot;timing&quot;: { # Message containing the performance timing data for the Lighthouse run. # Timing information for this LHR.
137 &quot;total&quot;: 3.14, # The total duration of Lighthouse&#x27;s run.
138 },
139 &quot;audits&quot;: { # Map of audits in the LHR.
140 &quot;a_key&quot;: { # An audit&#x27;s result object in a Lighthouse result.
141 &quot;scoreDisplayMode&quot;: &quot;A String&quot;, # The enumerated score display mode.
142 &quot;warnings&quot;: &quot;&quot;, # Possible warnings that occurred in the audit, can be null.
143 &quot;explanation&quot;: &quot;A String&quot;, # An explanation of the errors in the audit.
144 &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.
145 &quot;title&quot;: &quot;A String&quot;, # The human readable title.
146 &quot;details&quot;: { # Freeform details section of the audit.
147 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
148 },
149 &quot;id&quot;: &quot;A String&quot;, # The audit&#x27;s id.
150 &quot;displayValue&quot;: &quot;A String&quot;, # The value that should be displayed on the UI for this audit.
151 &quot;errorMessage&quot;: &quot;A String&quot;, # An error message from a thrown error inside the audit.
152 &quot;description&quot;: &quot;A String&quot;, # The description of the audit.
153 &quot;score&quot;: &quot;&quot;, # The score of the audit, can be null.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700154 },
155 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800156 &quot;categories&quot;: { # The categories in a Lighthouse run. # Map of categories in the LHR.
157 &quot;accessibility&quot;: { # A Lighthouse category. # The accessibility category, containing all accessibility related audits.
158 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
159 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
160 { # A light reference to an audit by id, used to group and weight audits in a given category.
161 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
162 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
163 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
164 },
165 ],
166 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
167 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
168 &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.)
169 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
170 },
171 &quot;pwa&quot;: { # A Lighthouse category. # The Progressive-Web-App (PWA) category, containing all pwa related audits.
172 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
173 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
174 { # A light reference to an audit by id, used to group and weight audits in a given category.
175 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
176 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
177 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
178 },
179 ],
180 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
181 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
182 &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.)
183 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
184 },
185 &quot;performance&quot;: { # A Lighthouse category. # The performance category, containing all performance related audits.
186 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
187 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
188 { # A light reference to an audit by id, used to group and weight audits in a given category.
189 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
190 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
191 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
192 },
193 ],
194 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
195 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
196 &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.)
197 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
198 },
199 &quot;best-practices&quot;: { # A Lighthouse category. # The best practices category, containing all best practices related audits.
200 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
201 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
202 { # A light reference to an audit by id, used to group and weight audits in a given category.
203 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
204 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
205 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
206 },
207 ],
208 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
209 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
210 &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.)
211 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
212 },
213 &quot;seo&quot;: { # A Lighthouse category. # The Search-Engine-Optimization (SEO) category, containing all seo related audits.
214 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
215 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
216 { # A light reference to an audit by id, used to group and weight audits in a given category.
217 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
218 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
219 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
220 },
221 ],
222 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
223 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
224 &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.)
225 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700226 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700227 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700228 &quot;environment&quot;: { # Message containing environment configuration for a Lighthouse run. # Environment settings that were used when making this LHR.
229 &quot;networkUserAgent&quot;: &quot;A String&quot;, # The user agent string that was sent over the network.
230 &quot;hostUserAgent&quot;: &quot;A String&quot;, # The user agent string of the version of Chrome used.
231 &quot;benchmarkIndex&quot;: 3.14, # The benchmark index number that indicates rough device class.
232 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800233 &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.
234 &quot;code&quot;: &quot;A String&quot;, # The enumerated Lighthouse Error code.
235 &quot;message&quot;: &quot;A String&quot;, # A human readable message explaining the error code.
236 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700237 &quot;stackPacks&quot;: [ # The Stack Pack advice strings.
238 { # Message containing Stack Pack information.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800239 &quot;title&quot;: &quot;A String&quot;, # The stack pack title.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700240 &quot;descriptions&quot;: { # The stack pack advice strings.
241 &quot;a_key&quot;: &quot;A String&quot;,
242 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700243 &quot;id&quot;: &quot;A String&quot;, # The stack pack id.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800244 &quot;iconDataURL&quot;: &quot;A String&quot;, # The stack pack icon data uri.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700245 },
246 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800247 &quot;i18n&quot;: { # Message containing the i18n data for the LHR - Version 1. # The internationalization strings that are required to render the LHR.
248 &quot;rendererFormattedStrings&quot;: { # Message holding the formatted strings used in the renderer. # Internationalized strings that are formatted to the locale in configSettings.
249 &quot;manualAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading shown above a list of audits that were not computerd in the run.
250 &quot;errorMissingAuditInfo&quot;: &quot;A String&quot;, # The error string shown next to an erroring audit.
251 &quot;lsPerformanceCategoryDescription&quot;: &quot;A String&quot;, # The disclaimer shown under performance explaning that the network can vary.
252 &quot;opportunityResourceColumnLabel&quot;: &quot;A String&quot;, # The heading for the estimated page load savings opportunity of an audit.
253 &quot;crcLongestDurationLabel&quot;: &quot;A String&quot;, # The label for values shown in the summary of critical request chains.
254 &quot;labDataTitle&quot;: &quot;A String&quot;, # The title of the lab data performance category.
255 &quot;passedAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading that is shown above a list of audits that are passing.
256 &quot;opportunitySavingsColumnLabel&quot;: &quot;A String&quot;, # The heading for the estimated page load savings of opportunity audits.
257 &quot;scorescaleLabel&quot;: &quot;A String&quot;, # The label that explains the score gauges scale (0-49, 50-89, 90-100).
258 &quot;notApplicableAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading shown above a list of audits that do not apply to a page.
259 &quot;warningHeader&quot;: &quot;A String&quot;, # The label shown above a bulleted list of warnings.
260 &quot;crcInitialNavigation&quot;: &quot;A String&quot;, # The label for the initial request in a critical request chain.
261 &quot;varianceDisclaimer&quot;: &quot;A String&quot;, # The disclaimer shown below a performance metric value.
262 &quot;auditGroupExpandTooltip&quot;: &quot;A String&quot;, # The tooltip text on an expandable chevron icon.
263 &quot;toplevelWarningsMessage&quot;: &quot;A String&quot;, # The label shown preceding important warnings that may have invalidated an entire report.
264 &quot;errorLabel&quot;: &quot;A String&quot;, # The label shown next to an audit or metric that has had an error.
265 },
266 },
267 &quot;finalUrl&quot;: &quot;A String&quot;, # The final resolved url that was audited.
268 &quot;requestedUrl&quot;: &quot;A String&quot;, # The original requested url.
Bu Sun Kim65020912020-05-20 12:08:20 -0700269 &quot;categoryGroups&quot;: { # Map of category groups in the LHR.
270 &quot;a_key&quot;: { # Message containing a category
Bu Sun Kim65020912020-05-20 12:08:20 -0700271 &quot;description&quot;: &quot;A String&quot;, # The description of what the category is grouping
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800272 &quot;title&quot;: &quot;A String&quot;, # The human readable title of the group
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700273 },
274 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800275 &quot;userAgent&quot;: &quot;A String&quot;, # The user agent that was used to run this LHR.
276 &quot;runWarnings&quot;: [ # List of all run warnings in the LHR. Will always output to at least `[]`.
277 &quot;&quot;,
278 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700279 &quot;lighthouseVersion&quot;: &quot;A String&quot;, # The lighthouse version that was used to generate this LHR.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800280 },
281 &quot;captchaResult&quot;: &quot;A String&quot;, # The captcha verify result
282 &quot;loadingExperience&quot;: { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of end users&#x27; page loading experience.
283 &quot;id&quot;: &quot;A String&quot;, # The url, pattern or origin which the metrics are on.
284 &quot;origin_fallback&quot;: True or False, # True if the result is an origin fallback from a page, false otherwise.
285 &quot;initial_url&quot;: &quot;A String&quot;, # The requested URL, which may differ from the resolved &quot;id&quot;.
286 &quot;metrics&quot;: { # The map of .
287 &quot;a_key&quot;: { # A CrUX metric object for a single metric and form factor.
288 &quot;distributions&quot;: [ # Metric distributions. Proportions should sum up to 1.
289 { # 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.
290 &quot;max&quot;: 42, # Upper bound for a bucket&#x27;s range.
291 &quot;proportion&quot;: 3.14, # The proportion of data in this bucket.
292 &quot;min&quot;: 42, # Lower bound for a bucket&#x27;s range.
293 },
294 ],
295 &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.
296 &quot;median&quot;: 42, # The median number of the metric, in millisecond.
297 &quot;formFactor&quot;: &quot;A String&quot;, # Identifies the form factor of the metric being collected.
298 &quot;metricId&quot;: &quot;A String&quot;, # Identifies the type of the metric.
299 &quot;category&quot;: &quot;A String&quot;, # The category of the specific time metric.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700300 },
301 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800302 &quot;overall_category&quot;: &quot;A String&quot;, # The human readable speed &quot;category&quot; of the id.
303 },
304 &quot;originLoadingExperience&quot;: { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of the aggregated page loading experience of the origin
305 &quot;id&quot;: &quot;A String&quot;, # The url, pattern or origin which the metrics are on.
306 &quot;origin_fallback&quot;: True or False, # True if the result is an origin fallback from a page, false otherwise.
307 &quot;initial_url&quot;: &quot;A String&quot;, # The requested URL, which may differ from the resolved &quot;id&quot;.
308 &quot;metrics&quot;: { # The map of .
309 &quot;a_key&quot;: { # A CrUX metric object for a single metric and form factor.
310 &quot;distributions&quot;: [ # Metric distributions. Proportions should sum up to 1.
311 { # 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.
312 &quot;max&quot;: 42, # Upper bound for a bucket&#x27;s range.
313 &quot;proportion&quot;: 3.14, # The proportion of data in this bucket.
314 &quot;min&quot;: 42, # Lower bound for a bucket&#x27;s range.
315 },
316 ],
317 &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.
318 &quot;median&quot;: 42, # The median number of the metric, in millisecond.
319 &quot;formFactor&quot;: &quot;A String&quot;, # Identifies the form factor of the metric being collected.
320 &quot;metricId&quot;: &quot;A String&quot;, # Identifies the type of the metric.
321 &quot;category&quot;: &quot;A String&quot;, # The category of the specific time metric.
322 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700323 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800324 &quot;overall_category&quot;: &quot;A String&quot;, # The human readable speed &quot;category&quot; of the id.
Bu Sun Kim65020912020-05-20 12:08:20 -0700325 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700326 }</pre>
327</div>
328
329</body></html>