blob: 394ebf7af7b0f1270ba508bd1a627ce8a5c2a0bc [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">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#runpagespeed">runpagespeed(captchaToken=None, locale=None, url=None, x__xgafv=None, category=None, utm_campaign=None, strategy=None, utm_source=None)</a></code></p>
79<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">
Dan O'Mearadd494642020-05-01 07:42:23 -070082 <code class="details" id="runpagespeed">runpagespeed(captchaToken=None, locale=None, url=None, x__xgafv=None, category=None, utm_campaign=None, strategy=None, utm_source=None)</code>
83 <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:
Dan O'Mearadd494642020-05-01 07:42:23 -070088 captchaToken: string, The captcha token passed when filling out a captcha.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070089 locale: string, The locale used to localize formatted results
Dan O'Mearadd494642020-05-01 07:42:23 -070090 url: string, The URL to fetch and analyze
91 x__xgafv: string, V1 error format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070092 Allowed values
Dan O'Mearadd494642020-05-01 07:42:23 -070093 1 - v1 error format
94 2 - v2 error format
95 category: string, A Lighthouse category to run; if none are given, only Performance category
96will be run (repeated)
97 utm_campaign: string, Campaign name for analytics.
98 strategy: string, The analysis strategy (desktop or mobile) to use, and desktop is the
99default
100 utm_source: string, Campaign source for analytics.
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.
106 "kind": "A String", # Kind of result.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700107 "captchaResult": "A String", # The captcha verify result
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 "originLoadingExperience": { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of the aggregated page loading experience of the origin
109 "metrics": { # The map of &lt;metrics, data&gt;.
110 "a_key": { # A CrUX metric object for a single metric and form factor.
111 "category": "A String", # The category of the specific time metric.
112 "formFactor": "A String", # Identifies the form factor of the metric being collected.
113 "metricId": "A String", # Identifies the type of the metric.
114 "median": 42, # The median number of the metric, in millisecond.
115 "percentile": 42, # We use this field to store certain percentile value for this metric.
116 # For v4, this field contains pc50.
117 # For v5, this field contains pc90.
118 "distributions": [ # Metric distributions. Proportions should sum up to 1.
119 { # A proportion of data in the total distribution, bucketed by a min/max
120 # percentage. Each bucket's range is bounded by min &lt;= x &lt; max, In
121 # millisecond.
122 "max": 42, # Upper bound for a bucket's range.
123 "proportion": 3.14, # The proportion of data in this bucket.
124 "min": 42, # Lower bound for a bucket's range.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700125 },
126 ],
127 },
128 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700129 "initial_url": "A String", # The requested URL, which may differ from the resolved "id".
130 "overall_category": "A String", # The human readable speed "category" of the id.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700131 "id": "A String", # The url, pattern or origin which the metrics are on.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700132 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700133 "loadingExperience": { # The CrUX loading experience object that contains CrUX data breakdowns. # Metrics of end users' page loading experience.
134 "metrics": { # The map of &lt;metrics, data&gt;.
135 "a_key": { # A CrUX metric object for a single metric and form factor.
136 "category": "A String", # The category of the specific time metric.
137 "formFactor": "A String", # Identifies the form factor of the metric being collected.
138 "metricId": "A String", # Identifies the type of the metric.
139 "median": 42, # The median number of the metric, in millisecond.
140 "percentile": 42, # We use this field to store certain percentile value for this metric.
141 # For v4, this field contains pc50.
142 # For v5, this field contains pc90.
143 "distributions": [ # Metric distributions. Proportions should sum up to 1.
144 { # A proportion of data in the total distribution, bucketed by a min/max
145 # percentage. Each bucket's range is bounded by min &lt;= x &lt; max, In
146 # millisecond.
147 "max": 42, # Upper bound for a bucket's range.
148 "proportion": 3.14, # The proportion of data in this bucket.
149 "min": 42, # Lower bound for a bucket's range.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700150 },
151 ],
152 },
153 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700154 "initial_url": "A String", # The requested URL, which may differ from the resolved "id".
155 "overall_category": "A String", # The human readable speed "category" of the id.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700156 "id": "A String", # The url, pattern or origin which the metrics are on.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700157 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700158 "version": { # The Pagespeed Version object. # The version of PageSpeed used to generate these results.
159 "major": "A String", # The major version number of PageSpeed used to generate these results.
160 "minor": "A String", # The minor version number of PageSpeed used to generate these results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700161 },
162 "analysisUTCTimestamp": "A String", # The UTC timestamp of this analysis.
Dan O'Mearadd494642020-05-01 07:42:23 -0700163 "lighthouseResult": { # The Lighthouse result object. # Lighthouse response for the audit url as an object.
164 "environment": { # Message containing environment configuration for a Lighthouse run. # Environment settings that were used when making this LHR.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700165 "benchmarkIndex": 3.14, # The benchmark index number that indicates rough device class.
166 "networkUserAgent": "A String", # The user agent string that was sent over the network.
167 "hostUserAgent": "A String", # The user agent string of the version of Chrome used.
168 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700169 "fetchTime": "A String", # The time that this run was fetched.
170 "finalUrl": "A String", # The final resolved url that was audited.
171 "categoryGroups": { # Map of category groups in the LHR.
172 "a_key": { # Message containing a category
173 "description": "A String", # The description of what the category is grouping
174 "title": "A String", # The human readable title of the group
175 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700176 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700177 "configSettings": { # Message containing the configuration settings for the Lighthouse run. # The configuration settings for this LHR.
178 "locale": "A String", # The locale setting.
179 "onlyCategories": "", # List of categories of audits the run should conduct.
180 "emulatedFormFactor": "A String", # The form factor the emulation should use.
181 "channel": "A String", # How Lighthouse was run, e.g. from the Chrome extension or from the npm
182 # module.
183 },
184 "runtimeError": { # Message containing a runtime error config. # A top-level error message that, if present, indicates a serious enough
185 # problem that this Lighthouse result may need to be discarded.
186 "message": "A String", # A human readable message explaining the error code.
187 "code": "A String", # The enumerated Lighthouse Error code.
188 },
189 "runWarnings": [ # List of all run warnings in the LHR. Will always output to at least `[]`.
190 "",
191 ],
192 "lighthouseVersion": "A String", # The lighthouse version that was used to generate this LHR.
193 "stackPacks": [ # The Stack Pack advice strings.
194 { # Message containing Stack Pack information.
195 "descriptions": { # The stack pack advice strings.
196 "a_key": "A String",
197 },
198 "title": "A String", # The stack pack title.
199 "iconDataURL": "A String", # The stack pack icon data uri.
200 "id": "A String", # The stack pack id.
201 },
202 ],
203 "i18n": { # Message containing the i18n data for the LHR - Version 1. # The internationalization strings that are required to render the LHR.
204 "rendererFormattedStrings": { # Message holding the formatted strings used in the renderer. # Internationalized strings that are formatted to the locale in
205 # configSettings.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700206 "labDataTitle": "A String", # The title of the lab data performance category.
207 "passedAuditsGroupTitle": "A String", # The heading that is shown above a list of audits that are passing.
208 "auditGroupExpandTooltip": "A String", # The tooltip text on an expandable chevron icon.
Dan O'Mearadd494642020-05-01 07:42:23 -0700209 "toplevelWarningsMessage": "A String", # The label shown preceding important warnings that may have invalidated
210 # an entire report.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700211 "opportunitySavingsColumnLabel": "A String", # The heading for the estimated page load savings of opportunity audits.
Dan O'Mearadd494642020-05-01 07:42:23 -0700212 "crcLongestDurationLabel": "A String", # The label for values shown in the summary of critical request chains.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700213 "errorMissingAuditInfo": "A String", # The error string shown next to an erroring audit.
Dan O'Mearadd494642020-05-01 07:42:23 -0700214 "warningHeader": "A String", # The label shown above a bulleted list of warnings.
215 "lsPerformanceCategoryDescription": "A String", # The disclaimer shown under performance explaning that the network can
216 # vary.
217 "notApplicableAuditsGroupTitle": "A String", # The heading shown above a list of audits that do not apply to a page.
218 "manualAuditsGroupTitle": "A String", # The heading shown above a list of audits that were not computerd in the
219 # run.
220 "errorLabel": "A String", # The label shown next to an audit or metric that has had an error.
221 "opportunityResourceColumnLabel": "A String", # The heading for the estimated page load savings opportunity of an
222 # audit.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700223 "crcInitialNavigation": "A String", # The label for the initial request in a critical request chain.
224 "scorescaleLabel": "A String", # The label that explains the score gauges scale (0-49, 50-89, 90-100).
Dan O'Mearadd494642020-05-01 07:42:23 -0700225 "varianceDisclaimer": "A String", # The disclaimer shown below a performance metric value.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700226 },
227 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700228 "timing": { # Message containing the performance timing data for the Lighthouse run. # Timing information for this LHR.
229 "total": 3.14, # The total duration of Lighthouse's run.
230 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700231 "userAgent": "A String", # The user agent that was used to run this LHR.
232 "audits": { # Map of audits in the LHR.
Dan O'Mearadd494642020-05-01 07:42:23 -0700233 "a_key": { # An audit's result object in a Lighthouse result.
234 "numericValue": 3.14, # A numeric value that has a meaning specific to the audit, e.g. the number
235 # of nodes in the DOM or the timestamp of a specific load event. More
236 # information can be found in the audit details, if present.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700237 "description": "A String", # The description of the audit.
238 "title": "A String", # The human readable title.
239 "explanation": "A String", # An explanation of the errors in the audit.
240 "errorMessage": "A String", # An error message from a thrown error inside the audit.
Dan O'Mearadd494642020-05-01 07:42:23 -0700241 "score": "", # The score of the audit, can be null.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700242 "details": { # Freeform details section of the audit.
Dan O'Mearadd494642020-05-01 07:42:23 -0700243 "a_key": "", # Properties of the object.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700244 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700245 "warnings": "", # Possible warnings that occurred in the audit, can be null.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700246 "scoreDisplayMode": "A String", # The enumerated score display mode.
247 "displayValue": "A String", # The value that should be displayed on the UI for this audit.
248 "id": "A String", # The audit's id.
249 },
250 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700251 "categories": { # The categories in a Lighthouse run. # Map of categories in the LHR.
252 "seo": { # A Lighthouse category. # The Search-Engine-Optimization (SEO) category, containing all seo related
253 # audits.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700254 "description": "A String", # A more detailed description of the category and its importance.
255 "title": "A String", # The human-friendly name of the category.
256 "auditRefs": [ # An array of references to all the audit members of this category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700257 { # A light reference to an audit by id, used to group and weight audits in a
258 # given category.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700259 "group": "A String", # The category group that the audit belongs to (optional).
260 "id": "A String", # The audit ref id.
261 "weight": 3.14, # The weight this audit's score has on the overall category score.
262 },
263 ],
264 "manualDescription": "A String", # A description for the manual audits in the category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700265 "score": "", # The overall score of the category, the weighted average of all its audits.
266 # (The category's score, can be null.)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700267 "id": "A String", # The string identifier of the category.
268 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700269 "performance": { # A Lighthouse category. # The performance category, containing all performance related audits.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700270 "description": "A String", # A more detailed description of the category and its importance.
271 "title": "A String", # The human-friendly name of the category.
272 "auditRefs": [ # An array of references to all the audit members of this category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700273 { # A light reference to an audit by id, used to group and weight audits in a
274 # given category.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700275 "group": "A String", # The category group that the audit belongs to (optional).
276 "id": "A String", # The audit ref id.
277 "weight": 3.14, # The weight this audit's score has on the overall category score.
278 },
279 ],
280 "manualDescription": "A String", # A description for the manual audits in the category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700281 "score": "", # The overall score of the category, the weighted average of all its audits.
282 # (The category's score, can be null.)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700283 "id": "A String", # The string identifier of the category.
284 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700285 "pwa": { # A Lighthouse category. # The Progressive-Web-App (PWA) category, containing all pwa related
286 # audits.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700287 "description": "A String", # A more detailed description of the category and its importance.
288 "title": "A String", # The human-friendly name of the category.
289 "auditRefs": [ # An array of references to all the audit members of this category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700290 { # A light reference to an audit by id, used to group and weight audits in a
291 # given category.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700292 "group": "A String", # The category group that the audit belongs to (optional).
293 "id": "A String", # The audit ref id.
294 "weight": 3.14, # The weight this audit's score has on the overall category score.
295 },
296 ],
297 "manualDescription": "A String", # A description for the manual audits in the category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700298 "score": "", # The overall score of the category, the weighted average of all its audits.
299 # (The category's score, can be null.)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700300 "id": "A String", # The string identifier of the category.
301 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700302 "accessibility": { # A Lighthouse category. # The accessibility category, containing all accessibility related audits.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700303 "description": "A String", # A more detailed description of the category and its importance.
304 "title": "A String", # The human-friendly name of the category.
305 "auditRefs": [ # An array of references to all the audit members of this category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700306 { # A light reference to an audit by id, used to group and weight audits in a
307 # given category.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700308 "group": "A String", # The category group that the audit belongs to (optional).
309 "id": "A String", # The audit ref id.
310 "weight": 3.14, # The weight this audit's score has on the overall category score.
311 },
312 ],
313 "manualDescription": "A String", # A description for the manual audits in the category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700314 "score": "", # The overall score of the category, the weighted average of all its audits.
315 # (The category's score, can be null.)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700316 "id": "A String", # The string identifier of the category.
317 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700318 "best-practices": { # A Lighthouse category. # The best practices category, containing all best practices related
319 # audits.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700320 "description": "A String", # A more detailed description of the category and its importance.
321 "title": "A String", # The human-friendly name of the category.
322 "auditRefs": [ # An array of references to all the audit members of this category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700323 { # A light reference to an audit by id, used to group and weight audits in a
324 # given category.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700325 "group": "A String", # The category group that the audit belongs to (optional).
326 "id": "A String", # The audit ref id.
327 "weight": 3.14, # The weight this audit's score has on the overall category score.
328 },
329 ],
330 "manualDescription": "A String", # A description for the manual audits in the category.
Dan O'Mearadd494642020-05-01 07:42:23 -0700331 "score": "", # The overall score of the category, the weighted average of all its audits.
332 # (The category's score, can be null.)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700333 "id": "A String", # The string identifier of the category.
334 },
335 },
336 "requestedUrl": "A String", # The original requested url.
337 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700338 "id": "A String", # Canonicalized and final URL for the document, after following page
339 # redirects (if any).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700340 }</pre>
341</div>
342
343</body></html>