blob: 2f125f8043297726f76c80dc4e7af0c24a1f8038 [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 Kim4ed7d3f2020-05-27 12:20:54 -070078 <code><a href="#runpagespeed">runpagespeed(utm_source=None, category=None, locale=None, url=None, utm_campaign=None, captchaToken=None, strategy=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 Kim4ed7d3f2020-05-27 12:20:54 -070082 <code class="details" id="runpagespeed">runpagespeed(utm_source=None, category=None, locale=None, url=None, utm_campaign=None, captchaToken=None, strategy=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 Kim4ed7d3f2020-05-27 12:20:54 -070088 utm_source: string, Campaign source for analytics.
89 category: string, A Lighthouse category to run; if none are given, only Performance category
90will be run (repeated)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091 locale: string, The locale used to localize formatted results
Dan O'Mearadd494642020-05-01 07:42:23 -070092 url: string, The URL to fetch and analyze
Bu Sun Kim65020912020-05-20 12:08:20 -070093 utm_campaign: string, Campaign name for analytics.
94 captchaToken: string, The captcha token passed when filling out a captcha.
95 strategy: string, The analysis strategy (desktop or mobile) to use, and desktop is the
96default
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 Kim4ed7d3f2020-05-27 12:20:54 -0700106 &quot;version&quot;: { # The Pagespeed Version object. # The version of PageSpeed used to generate these results.
107 &quot;major&quot;: &quot;A String&quot;, # The major version number of PageSpeed used to generate these results.
108 &quot;minor&quot;: &quot;A String&quot;, # The minor version number of PageSpeed used to generate these results.
109 },
110 &quot;id&quot;: &quot;A String&quot;, # Canonicalized and final URL for the document, after following page
111 # redirects (if any).
112 &quot;originLoadingExperience&quot;: { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of the aggregated page loading experience of the origin
113 &quot;initial_url&quot;: &quot;A String&quot;, # The requested URL, which may differ from the resolved &quot;id&quot;.
114 &quot;id&quot;: &quot;A String&quot;, # The url, pattern or origin which the metrics are on.
115 &quot;metrics&quot;: { # The map of &lt;metrics, data&gt;.
116 &quot;a_key&quot;: { # A CrUX metric object for a single metric and form factor.
117 &quot;distributions&quot;: [ # Metric distributions. Proportions should sum up to 1.
118 { # A proportion of data in the total distribution, bucketed by a min/max
119 # percentage. Each bucket&#x27;s range is bounded by min &lt;= x &lt; max, In
120 # millisecond.
121 &quot;proportion&quot;: 3.14, # The proportion of data in this bucket.
122 &quot;min&quot;: 42, # Lower bound for a bucket&#x27;s range.
123 &quot;max&quot;: 42, # Upper bound for a bucket&#x27;s range.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124 },
125 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700126 &quot;metricId&quot;: &quot;A String&quot;, # Identifies the type of the metric.
127 &quot;formFactor&quot;: &quot;A String&quot;, # Identifies the form factor of the metric being collected.
128 &quot;median&quot;: 42, # The median number of the metric, in millisecond.
129 &quot;percentile&quot;: 42, # We use this field to store certain percentile value for this metric.
130 # For v4, this field contains pc50.
131 # For v5, this field contains pc90.
132 &quot;category&quot;: &quot;A String&quot;, # The category of the specific time metric.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133 },
134 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700135 &quot;overall_category&quot;: &quot;A String&quot;, # The human readable speed &quot;category&quot; of the id.
136 },
137 &quot;kind&quot;: &quot;A String&quot;, # Kind of result.
138 &quot;captchaResult&quot;: &quot;A String&quot;, # The captcha verify result
139 &quot;lighthouseResult&quot;: { # The Lighthouse result object. # Lighthouse response for the audit url as an object.
Bu Sun Kim65020912020-05-20 12:08:20 -0700140 &quot;stackPacks&quot;: [ # The Stack Pack advice strings.
Dan O'Mearadd494642020-05-01 07:42:23 -0700141 { # Message containing Stack Pack information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700142 &quot;title&quot;: &quot;A String&quot;, # The stack pack title.
143 &quot;descriptions&quot;: { # The stack pack advice strings.
144 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700145 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700146 &quot;iconDataURL&quot;: &quot;A String&quot;, # The stack pack icon data uri.
147 &quot;id&quot;: &quot;A String&quot;, # The stack pack id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700148 },
149 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700150 &quot;categoryGroups&quot;: { # Map of category groups in the LHR.
151 &quot;a_key&quot;: { # Message containing a category
152 &quot;title&quot;: &quot;A String&quot;, # The human readable title of the group
153 &quot;description&quot;: &quot;A String&quot;, # The description of what the category is grouping
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700154 },
155 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700156 &quot;runtimeError&quot;: { # Message containing a runtime error config. # A top-level error message that, if present, indicates a serious enough
157 # problem that this Lighthouse result may need to be discarded.
Bu Sun Kim65020912020-05-20 12:08:20 -0700158 &quot;code&quot;: &quot;A String&quot;, # The enumerated Lighthouse Error code.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700159 &quot;message&quot;: &quot;A String&quot;, # A human readable message explaining the error code.
Dan O'Mearadd494642020-05-01 07:42:23 -0700160 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700161 &quot;fetchTime&quot;: &quot;A String&quot;, # The time that this run was fetched.
162 &quot;requestedUrl&quot;: &quot;A String&quot;, # The original requested url.
163 &quot;userAgent&quot;: &quot;A String&quot;, # The user agent that was used to run this LHR.
164 &quot;configSettings&quot;: { # Message containing the configuration settings for the Lighthouse run. # The configuration settings for this LHR.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700165 &quot;onlyCategories&quot;: &quot;&quot;, # List of categories of audits the run should conduct.
166 &quot;emulatedFormFactor&quot;: &quot;A String&quot;, # The form factor the emulation should use.
Bu Sun Kim65020912020-05-20 12:08:20 -0700167 &quot;locale&quot;: &quot;A String&quot;, # The locale setting.
168 &quot;channel&quot;: &quot;A String&quot;, # How Lighthouse was run, e.g. from the Chrome extension or from the npm
169 # module.
Bu Sun Kim65020912020-05-20 12:08:20 -0700170 },
171 &quot;timing&quot;: { # Message containing the performance timing data for the Lighthouse run. # Timing information for this LHR.
172 &quot;total&quot;: 3.14, # The total duration of Lighthouse&#x27;s run.
173 },
174 &quot;runWarnings&quot;: [ # List of all run warnings in the LHR. Will always output to at least `[]`.
175 &quot;&quot;,
176 ],
177 &quot;audits&quot;: { # Map of audits in the LHR.
178 &quot;a_key&quot;: { # An audit&#x27;s result object in a Lighthouse result.
179 &quot;warnings&quot;: &quot;&quot;, # Possible warnings that occurred in the audit, can be null.
180 &quot;scoreDisplayMode&quot;: &quot;A String&quot;, # The enumerated score display mode.
181 &quot;explanation&quot;: &quot;A String&quot;, # An explanation of the errors in the audit.
182 &quot;details&quot;: { # Freeform details section of the audit.
183 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
184 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700185 &quot;score&quot;: &quot;&quot;, # The score of the audit, can be null.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700186 &quot;errorMessage&quot;: &quot;A String&quot;, # An error message from a thrown error inside the audit.
Bu Sun Kim65020912020-05-20 12:08:20 -0700187 &quot;displayValue&quot;: &quot;A String&quot;, # The value that should be displayed on the UI for this audit.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700188 &quot;id&quot;: &quot;A String&quot;, # The audit&#x27;s id.
Bu Sun Kim65020912020-05-20 12:08:20 -0700189 &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 -0700190 # of nodes in the DOM or the timestamp of a specific load event. More
191 # information can be found in the audit details, if present.
Bu Sun Kim65020912020-05-20 12:08:20 -0700192 &quot;title&quot;: &quot;A String&quot;, # The human readable title.
193 &quot;description&quot;: &quot;A String&quot;, # The description of the audit.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700194 },
195 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700196 &quot;environment&quot;: { # Message containing environment configuration for a Lighthouse run. # Environment settings that were used when making this LHR.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700197 &quot;networkUserAgent&quot;: &quot;A String&quot;, # The user agent string that was sent over the network.
Bu Sun Kim65020912020-05-20 12:08:20 -0700198 &quot;benchmarkIndex&quot;: 3.14, # The benchmark index number that indicates rough device class.
199 &quot;hostUserAgent&quot;: &quot;A String&quot;, # The user agent string of the version of Chrome used.
Bu Sun Kim65020912020-05-20 12:08:20 -0700200 },
201 &quot;finalUrl&quot;: &quot;A String&quot;, # The final resolved url that was audited.
202 &quot;i18n&quot;: { # Message containing the i18n data for the LHR - Version 1. # The internationalization strings that are required to render the LHR.
203 &quot;rendererFormattedStrings&quot;: { # Message holding the formatted strings used in the renderer. # Internationalized strings that are formatted to the locale in
204 # configSettings.
Bu Sun Kim65020912020-05-20 12:08:20 -0700205 &quot;errorMissingAuditInfo&quot;: &quot;A String&quot;, # The error string shown next to an erroring audit.
Bu Sun Kim65020912020-05-20 12:08:20 -0700206 &quot;opportunityResourceColumnLabel&quot;: &quot;A String&quot;, # The heading for the estimated page load savings opportunity of an
207 # audit.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700208 &quot;toplevelWarningsMessage&quot;: &quot;A String&quot;, # The label shown preceding important warnings that may have invalidated
209 # an entire report.
Bu Sun Kim65020912020-05-20 12:08:20 -0700210 &quot;varianceDisclaimer&quot;: &quot;A String&quot;, # The disclaimer shown below a performance metric value.
211 &quot;opportunitySavingsColumnLabel&quot;: &quot;A String&quot;, # The heading for the estimated page load savings of opportunity audits.
212 &quot;crcInitialNavigation&quot;: &quot;A String&quot;, # The label for the initial request in a critical request chain.
213 &quot;warningHeader&quot;: &quot;A String&quot;, # The label shown above a bulleted list of warnings.
214 &quot;crcLongestDurationLabel&quot;: &quot;A String&quot;, # The label for values shown in the summary of critical request chains.
Bu Sun Kim65020912020-05-20 12:08:20 -0700215 &quot;manualAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading shown above a list of audits that were not computerd in the
216 # run.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700217 &quot;scorescaleLabel&quot;: &quot;A String&quot;, # The label that explains the score gauges scale (0-49, 50-89, 90-100).
Bu Sun Kim65020912020-05-20 12:08:20 -0700218 &quot;lsPerformanceCategoryDescription&quot;: &quot;A String&quot;, # The disclaimer shown under performance explaning that the network can
219 # vary.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700220 &quot;errorLabel&quot;: &quot;A String&quot;, # The label shown next to an audit or metric that has had an error.
221 &quot;notApplicableAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading shown above a list of audits that do not apply to a page.
222 &quot;labDataTitle&quot;: &quot;A String&quot;, # The title of the lab data performance category.
223 &quot;passedAuditsGroupTitle&quot;: &quot;A String&quot;, # The heading that is shown above a list of audits that are passing.
224 &quot;auditGroupExpandTooltip&quot;: &quot;A String&quot;, # The tooltip text on an expandable chevron icon.
225 },
226 },
227 &quot;lighthouseVersion&quot;: &quot;A String&quot;, # The lighthouse version that was used to generate this LHR.
228 &quot;categories&quot;: { # The categories in a Lighthouse run. # Map of categories in the LHR.
229 &quot;best-practices&quot;: { # A Lighthouse category. # The best practices category, containing all best practices related
230 # audits.
231 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
232 # (The category&#x27;s score, can be null.)
233 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
234 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
235 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
236 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
237 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
238 { # A light reference to an audit by id, used to group and weight audits in a
239 # given category.
240 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
241 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
242 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
243 },
244 ],
245 },
246 &quot;pwa&quot;: { # A Lighthouse category. # The Progressive-Web-App (PWA) category, containing all pwa related
247 # audits.
248 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
249 # (The category&#x27;s score, can be null.)
250 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
251 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
252 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
253 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
254 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
255 { # A light reference to an audit by id, used to group and weight audits in a
256 # given category.
257 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
258 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
259 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
260 },
261 ],
262 },
263 &quot;accessibility&quot;: { # A Lighthouse category. # The accessibility category, containing all accessibility related audits.
264 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
265 # (The category&#x27;s score, can be null.)
266 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
267 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
268 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
269 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
270 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
271 { # A light reference to an audit by id, used to group and weight audits in a
272 # given category.
273 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
274 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
275 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
276 },
277 ],
278 },
279 &quot;seo&quot;: { # A Lighthouse category. # The Search-Engine-Optimization (SEO) category, containing all seo related
280 # audits.
281 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
282 # (The category&#x27;s score, can be null.)
283 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
284 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
285 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
286 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
287 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
288 { # A light reference to an audit by id, used to group and weight audits in a
289 # given category.
290 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
291 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
292 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
293 },
294 ],
295 },
296 &quot;performance&quot;: { # A Lighthouse category. # The performance category, containing all performance related audits.
297 &quot;score&quot;: &quot;&quot;, # The overall score of the category, the weighted average of all its audits.
298 # (The category&#x27;s score, can be null.)
299 &quot;id&quot;: &quot;A String&quot;, # The string identifier of the category.
300 &quot;manualDescription&quot;: &quot;A String&quot;, # A description for the manual audits in the category.
301 &quot;title&quot;: &quot;A String&quot;, # The human-friendly name of the category.
302 &quot;description&quot;: &quot;A String&quot;, # A more detailed description of the category and its importance.
303 &quot;auditRefs&quot;: [ # An array of references to all the audit members of this category.
304 { # A light reference to an audit by id, used to group and weight audits in a
305 # given category.
306 &quot;weight&quot;: 3.14, # The weight this audit&#x27;s score has on the overall category score.
307 &quot;id&quot;: &quot;A String&quot;, # The audit ref id.
308 &quot;group&quot;: &quot;A String&quot;, # The category group that the audit belongs to (optional).
309 },
310 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700311 },
312 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700313 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700314 &quot;analysisUTCTimestamp&quot;: &quot;A String&quot;, # The UTC timestamp of this analysis.
315 &quot;loadingExperience&quot;: { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of end users&#x27; page loading experience.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700316 &quot;initial_url&quot;: &quot;A String&quot;, # The requested URL, which may differ from the resolved &quot;id&quot;.
317 &quot;id&quot;: &quot;A String&quot;, # The url, pattern or origin which the metrics are on.
Bu Sun Kim65020912020-05-20 12:08:20 -0700318 &quot;metrics&quot;: { # The map of &lt;metrics, data&gt;.
319 &quot;a_key&quot;: { # A CrUX metric object for a single metric and form factor.
Bu Sun Kim65020912020-05-20 12:08:20 -0700320 &quot;distributions&quot;: [ # Metric distributions. Proportions should sum up to 1.
321 { # A proportion of data in the total distribution, bucketed by a min/max
322 # percentage. Each bucket&#x27;s range is bounded by min &lt;= x &lt; max, In
323 # millisecond.
324 &quot;proportion&quot;: 3.14, # The proportion of data in this bucket.
325 &quot;min&quot;: 42, # Lower bound for a bucket&#x27;s range.
326 &quot;max&quot;: 42, # Upper bound for a bucket&#x27;s range.
327 },
328 ],
329 &quot;metricId&quot;: &quot;A String&quot;, # Identifies the type of the metric.
330 &quot;formFactor&quot;: &quot;A String&quot;, # Identifies the form factor of the metric being collected.
Bu Sun Kim65020912020-05-20 12:08:20 -0700331 &quot;median&quot;: 42, # The median number of the metric, in millisecond.
332 &quot;percentile&quot;: 42, # We use this field to store certain percentile value for this metric.
333 # For v4, this field contains pc50.
334 # For v5, this field contains pc90.
335 &quot;category&quot;: &quot;A String&quot;, # The category of the specific time metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700336 },
337 },
338 &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 -0700339 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700340 }</pre>
341</div>
342
343</body></html>