blob: 9df8bfece0fea652589fab65151b483dcbb534ff [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">
Bu Sun Kim65020912020-05-20 12:08:20 -070078 <code><a href="#runpagespeed">runpagespeed(locale=None, url=None, utm_campaign=None, captchaToken=None, strategy=None, category=None, utm_source=None, x__xgafv=None)</a></code></p>
Dan O'Mearadd494642020-05-01 07:42:23 -070079<p class="firstline">Runs PageSpeed analysis on the page at the specified URL, and returns</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070080<h3>Method Details</h3>
81<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -070082 <code class="details" id="runpagespeed">runpagespeed(locale=None, url=None, utm_campaign=None, captchaToken=None, strategy=None, category=None, utm_source=None, x__xgafv=None)</code>
Dan O'Mearadd494642020-05-01 07:42:23 -070083 <pre>Runs PageSpeed analysis on the page at the specified URL, and returns
84PageSpeed scores, a list of suggestions to make that page faster, and other
85information.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070086
87Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070088 locale: string, The locale used to localize formatted results
Dan O'Mearadd494642020-05-01 07:42:23 -070089 url: string, The URL to fetch and analyze
Bu Sun Kim65020912020-05-20 12:08:20 -070090 utm_campaign: string, Campaign name for analytics.
91 captchaToken: string, The captcha token passed when filling out a captcha.
92 strategy: string, The analysis strategy (desktop or mobile) to use, and desktop is the
93default
94 category: string, A Lighthouse category to run; if none are given, only Performance category
95will be run (repeated)
96 utm_source: string, Campaign source for analytics.
Dan O'Mearadd494642020-05-01 07:42:23 -070097 x__xgafv: string, V1 error format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098 Allowed values
Dan O'Mearadd494642020-05-01 07:42:23 -070099 1 - v1 error format
100 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700101
102Returns:
103 An object of the form:
104
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 { # The Pagespeed API response object.
Bu Sun Kim65020912020-05-20 12:08:20 -0700106 &quot;lighthouseResult&quot;: { # The Lighthouse result object. # Lighthouse response for the audit url as an object.
107 &quot;lighthouseVersion&quot;: &quot;A String&quot;, # The lighthouse version that was used to generate this LHR.
108 &quot;categories&quot;: { # The categories in a Lighthouse run. # Map of categories in the LHR.
109 &quot;seo&quot;: { # A Lighthouse category. # The Search-Engine-Optimization (SEO) category, containing all seo related
110 # audits.
111 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
112 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
113 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
114 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
115 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
116 { # A light reference to an audit by id, used to group and weight audits in a
117 # given category.
118 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
119 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
120 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700121 },
122 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700123 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
124 # (The category&#x27;s score, can be null.)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700125 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700126 &quot;performance&quot;: { # A Lighthouse category. # The performance category, containing all performance related audits.
127 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
128 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
129 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
130 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
131 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
132 { # A light reference to an audit by id, used to group and weight audits in a
133 # given category.
134 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
135 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
136 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700137 },
138 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700139 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
140 # (The category&#x27;s score, can be null.)
141 },
142 &quot;best-practices&quot;: { # A Lighthouse category. # The best practices category, containing all best practices related
143 # audits.
144 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
145 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
146 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
147 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
148 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
149 { # A light reference to an audit by id, used to group and weight audits in a
150 # given category.
151 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
152 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
153 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
154 },
155 ],
156 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
157 # (The category&#x27;s score, can be null.)
158 },
159 &quot;pwa&quot;: { # A Lighthouse category. # The Progressive-Web-App (PWA) category, containing all pwa related
160 # audits.
161 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
162 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
163 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
164 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
165 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
166 { # A light reference to an audit by id, used to group and weight audits in a
167 # given category.
168 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
169 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
170 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
171 },
172 ],
173 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
174 # (The category&#x27;s score, can be null.)
175 },
176 &quot;accessibility&quot;: { # A Lighthouse category. # The accessibility category, containing all accessibility related audits.
177 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
178 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
179 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
180 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
181 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
182 { # A light reference to an audit by id, used to group and weight audits in a
183 # given category.
184 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
185 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
186 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
187 },
188 ],
189 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
190 # (The category&#x27;s score, can be null.)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700191 },
192 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700193 &quot;stackPacks&quot;: [ # The Stack Pack advice strings.
Dan O'Mearadd494642020-05-01 07:42:23 -0700194 { # Message containing Stack Pack information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700195 &quot;iconDataURL&quot;: &quot;A String&quot;, # The stack pack icon data uri.
196 &quot;id&quot;: &quot;A String&quot;, # The stack pack id.
197 &quot;title&quot;: &quot;A String&quot;, # The stack pack title.
198 &quot;descriptions&quot;: { # The stack pack advice strings.
199 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700200 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700201 },
202 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700203 &quot;categoryGroups&quot;: { # Map of category groups in the LHR.
204 &quot;a_key&quot;: { # Message containing a category
205 &quot;title&quot;: &quot;A String&quot;, # The human readable title of the group
206 &quot;description&quot;: &quot;A String&quot;, # The description of what the category is grouping
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700207 },
208 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700209 &quot;runtimeError&quot;: { # Message containing a runtime error config. # A top-level error message that, if present, indicates a serious enough
210 # problem that this Lighthouse result may need to be discarded.
211 &quot;message&quot;: &quot;A String&quot;, # A human readable message explaining the error code.
212 &quot;code&quot;: &quot;A String&quot;, # The enumerated Lighthouse Error code.
Dan O'Mearadd494642020-05-01 07:42:23 -0700213 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700214 &quot;fetchTime&quot;: &quot;A String&quot;, # The time that this run was fetched.
215 &quot;requestedUrl&quot;: &quot;A String&quot;, # The original requested url.
216 &quot;userAgent&quot;: &quot;A String&quot;, # The user agent that was used to run this LHR.
217 &quot;configSettings&quot;: { # Message containing the configuration settings for the Lighthouse run. # The configuration settings for this LHR.
218 &quot;locale&quot;: &quot;A String&quot;, # The locale setting.
219 &quot;channel&quot;: &quot;A String&quot;, # How Lighthouse was run, e.g. from the Chrome extension or from the npm
220 # module.
221 &quot;onlyCategories&quot;: &quot;&quot;, # List of categories of audits the run should conduct.
222 &quot;emulatedFormFactor&quot;: &quot;A String&quot;, # The form factor the emulation should use.
223 },
224 &quot;timing&quot;: { # Message containing the performance timing data for the Lighthouse run. # Timing information for this LHR.
225 &quot;total&quot;: 3.14, # The total duration of Lighthouse&#x27;s run.
226 },
227 &quot;runWarnings&quot;: [ # List of all run warnings in the LHR. Will always output to at least `[]`.
228 &quot;&quot;,
229 ],
230 &quot;audits&quot;: { # Map of audits in the LHR.
231 &quot;a_key&quot;: { # An audit&#x27;s result object in a Lighthouse result.
232 &quot;warnings&quot;: &quot;&quot;, # Possible warnings that occurred in the audit, can be null.
233 &quot;scoreDisplayMode&quot;: &quot;A String&quot;, # The enumerated score display mode.
234 &quot;explanation&quot;: &quot;A String&quot;, # An explanation of the errors in the audit.
235 &quot;details&quot;: { # Freeform details section of the audit.
236 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
237 },
238 &quot;errorMessage&quot;: &quot;A String&quot;, # An error message from a thrown error inside the audit.
239 &quot;score&quot;: &quot;&quot;, # The score of the audit, can be null.
240 &quot;displayValue&quot;: &quot;A String&quot;, # The value that should be displayed on the UI for this audit.
241 &quot;numericValue&quot;: 3.14, # A numeric value that has a meaning specific to the audit, e.g. the number
Dan O'Mearadd494642020-05-01 07:42:23 -0700242 # of nodes in the DOM or the timestamp of a specific load event. More
243 # information can be found in the audit details, if present.
Bu Sun Kim65020912020-05-20 12:08:20 -0700244 &quot;id&quot;: &quot;A String&quot;, # The audit&#x27;s id.
245 &quot;title&quot;: &quot;A String&quot;, # The human readable title.
246 &quot;description&quot;: &quot;A String&quot;, # The description of the audit.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700247 },
248 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700249 &quot;environment&quot;: { # Message containing environment configuration for a Lighthouse run. # Environment settings that were used when making this LHR.
250 &quot;benchmarkIndex&quot;: 3.14, # The benchmark index number that indicates rough device class.
251 &quot;hostUserAgent&quot;: &quot;A String&quot;, # The user agent string of the version of Chrome used.
252 &quot;networkUserAgent&quot;: &quot;A String&quot;, # The user agent string that was sent over the network.
253 },
254 &quot;finalUrl&quot;: &quot;A String&quot;, # The final resolved url that was audited.
255 &quot;i18n&quot;: { # Message containing the i18n data for the LHR - Version 1. # The internationalization strings that are required to render the LHR.
256 &quot;rendererFormattedStrings&quot;: { # Message holding the formatted strings used in the renderer. # Internationalized strings that are formatted to the locale in
257 # configSettings.
258 &quot;errorLabel&quot;: &quot;A String&quot;, # The label shown next to an audit or metric that has had an error.
259 &quot;labDataTitle&quot;: &quot;A String&quot;, # The title of the lab data performance category.
260 &quot;notApplicableAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading shown above a list of audits that do not apply to a page.
261 &quot;passedAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading that is shown above a list of audits that are passing.
262 &quot;auditGroupExpandTooltip&quot;: &quot;A String&quot;, # The tooltip text on an expandable chevron icon.
263 &quot;errorMissingAuditInfo&quot;: &quot;A String&quot;, # The error string shown next to an erroring audit.
264 &quot;toplevelWarningsMessage&quot;: &quot;A String&quot;, # The label shown preceding important warnings that may have invalidated
265 # an entire report.
266 &quot;opportunityResourceColumnLabel&quot;: &quot;A String&quot;, # The heading for the estimated page load savings opportunity of an
267 # audit.
268 &quot;varianceDisclaimer&quot;: &quot;A String&quot;, # The disclaimer shown below a performance metric value.
269 &quot;opportunitySavingsColumnLabel&quot;: &quot;A String&quot;, # The heading for the estimated page load savings of opportunity audits.
270 &quot;crcInitialNavigation&quot;: &quot;A String&quot;, # The label for the initial request in a critical request chain.
271 &quot;warningHeader&quot;: &quot;A String&quot;, # The label shown above a bulleted list of warnings.
272 &quot;crcLongestDurationLabel&quot;: &quot;A String&quot;, # The label for values shown in the summary of critical request chains.
273 &quot;scorescaleLabel&quot;: &quot;A String&quot;, # The label that explains the score gauges scale (0-49, 50-89, 90-100).
274 &quot;manualAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading shown above a list of audits that were not computerd in the
275 # run.
276 &quot;lsPerformanceCategoryDescription&quot;: &quot;A String&quot;, # The disclaimer shown under performance explaning that the network can
277 # vary.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700278 },
279 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700280 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700281 &quot;analysisUTCTimestamp&quot;: &quot;A String&quot;, # The UTC timestamp of this analysis.
282 &quot;loadingExperience&quot;: { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of end users&#x27; page loading experience.
283 &quot;metrics&quot;: { # The map of &lt;metrics, data&gt;.
284 &quot;a_key&quot;: { # A CrUX metric object for a single metric and form factor.
285 &quot;median&quot;: 42, # The median number of the metric, in millisecond.
286 &quot;percentile&quot;: 42, # We use this field to store certain percentile value for this metric.
287 # For v4, this field contains pc50.
288 # For v5, this field contains pc90.
289 &quot;category&quot;: &quot;A String&quot;, # The category of the specific time metric.
290 &quot;distributions&quot;: [ # Metric distributions. Proportions should sum up to 1.
291 { # A proportion of data in the total distribution, bucketed by a min/max
292 # percentage. Each bucket&#x27;s range is bounded by min &lt;= x &lt; max, In
293 # millisecond.
294 &quot;proportion&quot;: 3.14, # The proportion of data in this bucket.
295 &quot;min&quot;: 42, # Lower bound for a bucket&#x27;s range.
296 &quot;max&quot;: 42, # Upper bound for a bucket&#x27;s range.
297 },
298 ],
299 &quot;metricId&quot;: &quot;A String&quot;, # Identifies the type of the metric.
300 &quot;formFactor&quot;: &quot;A String&quot;, # Identifies the form factor of the metric being collected.
301 },
302 },
303 &quot;overall_category&quot;: &quot;A String&quot;, # The human readable speed &quot;category&quot; of the id.
304 &quot;initial_url&quot;: &quot;A String&quot;, # The requested URL, which may differ from the resolved &quot;id&quot;.
305 &quot;id&quot;: &quot;A String&quot;, # The url, pattern or origin which the metrics are on.
306 },
307 &quot;version&quot;: { # The Pagespeed Version object. # The version of PageSpeed used to generate these results.
308 &quot;major&quot;: &quot;A String&quot;, # The major version number of PageSpeed used to generate these results.
309 &quot;minor&quot;: &quot;A String&quot;, # The minor version number of PageSpeed used to generate these results.
310 },
311 &quot;id&quot;: &quot;A String&quot;, # Canonicalized and final URL for the document, after following page
Dan O'Mearadd494642020-05-01 07:42:23 -0700312 # redirects (if any).
Bu Sun Kim65020912020-05-20 12:08:20 -0700313 &quot;originLoadingExperience&quot;: { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of the aggregated page loading experience of the origin
314 &quot;metrics&quot;: { # The map of &lt;metrics, data&gt;.
315 &quot;a_key&quot;: { # A CrUX metric object for a single metric and form factor.
316 &quot;median&quot;: 42, # The median number of the metric, in millisecond.
317 &quot;percentile&quot;: 42, # We use this field to store certain percentile value for this metric.
318 # For v4, this field contains pc50.
319 # For v5, this field contains pc90.
320 &quot;category&quot;: &quot;A String&quot;, # The category of the specific time metric.
321 &quot;distributions&quot;: [ # Metric distributions. Proportions should sum up to 1.
322 { # A proportion of data in the total distribution, bucketed by a min/max
323 # percentage. Each bucket&#x27;s range is bounded by min &lt;= x &lt; max, In
324 # millisecond.
325 &quot;proportion&quot;: 3.14, # The proportion of data in this bucket.
326 &quot;min&quot;: 42, # Lower bound for a bucket&#x27;s range.
327 &quot;max&quot;: 42, # Upper bound for a bucket&#x27;s range.
328 },
329 ],
330 &quot;metricId&quot;: &quot;A String&quot;, # Identifies the type of the metric.
331 &quot;formFactor&quot;: &quot;A String&quot;, # Identifies the form factor of the metric being collected.
332 },
333 },
334 &quot;overall_category&quot;: &quot;A String&quot;, # The human readable speed &quot;category&quot; of the id.
335 &quot;initial_url&quot;: &quot;A String&quot;, # The requested URL, which may differ from the resolved &quot;id&quot;.
336 &quot;id&quot;: &quot;A String&quot;, # The url, pattern or origin which the metrics are on.
337 },
338 &quot;kind&quot;: &quot;A String&quot;, # Kind of result.
339 &quot;captchaResult&quot;: &quot;A String&quot;, # The captcha verify result
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700340 }</pre>
341</div>
342
343</body></html>