blob: a19c419f6c34f31e52d887fec4895809e0f99d4a [file] [log] [blame]
Joe Gregorio075572b2012-07-09 16:53:09 -04001<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_v1.html">Page Speed Online API</a> . <a href="pagespeedonline_v1.pagespeedapi.html">pagespeedapi</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#runpagespeed">runpagespeed(url, locale=None, rule=None, strategy=None)</a></code></p>
79<p class="firstline">Runs Page Speed analysis on the page at the specified URL, and returns a Page Speed score, a list of suggestions to make that page faster, and other information.</p>
80<h3>Method Details</h3>
81<div class="method">
82 <code class="details" id="runpagespeed">runpagespeed(url, locale=None, rule=None, strategy=None)</code>
83 <pre>Runs Page Speed analysis on the page at the specified URL, and returns a Page Speed score, a list of suggestions to make that page faster, and other information.
84
85Args:
86 url: string, The URL to fetch and analyze (required)
87 locale: string, The locale used to localize formatted results
88 rule: string, A Page Speed rule to run; if none are given, all rules are run (repeated)
89 strategy: string, The analysis strategy to use
90 Allowed values
91 desktop - Fetch and analyze the URL for desktop browsers
92 mobile - Fetch and analyze the URL for mobile devices
93
94Returns:
95 An object of the form:
96
97 {
98 "kind": "pagespeedonline#result", # Kind of result.
99 "formattedResults": { # Localized Page Speed results. Contains a ruleResults entry for each Page Speed rule instantiated and run by the server.
100 "locale": "A String", # The locale of the formattedResults, e.g. "en_US".
101 "ruleResults": { # Dictionary of formatted rule results, with one entry for each Page Speed rule instantiated and run by the server.
102 },
103 },
104 "title": "A String", # Title of the page, as displayed in the browser's title bar.
105 "version": { # The version of the Page Speed SDK used to generate these results.
106 "major": 42, # The major version number of the Page Speed SDK used to generate these results.
107 "minor": 42, # The minor version number of the Page Speed SDK used to generate these results.
108 },
109 "score": 42, # The Page Speed Score (0-100), which indicates how much faster a page could be. A high score indicates little room for improvement, while a lower score indicates more room for improvement.
110 "responseCode": 42, # Response code for the document. 200 indicates a normal page load. 4xx/5xx indicates an error.
111 "invalidRules": [ # List of rules that were specified in the request, but which the server did not know how to instantiate.
112 "A String",
113 ],
114 "pageStats": { # Summary statistics for the page, such as number of JavaScript bytes, number of HTML bytes, etc.
115 "otherResponseBytes": "A String", # Number of response bytes for other resources on the page.
116 "flashResponseBytes": "A String", # Number of response bytes for flash resources on the page.
117 "totalRequestBytes": "A String", # Total size of all request bytes sent by the page.
118 "numberCssResources": 42, # Number of CSS resources referenced by the page.
119 "numberResources": 42, # Number of HTTP resources loaded by the page.
120 "cssResponseBytes": "A String", # Number of uncompressed response bytes for CSS resources on the page.
121 "javascriptResponseBytes": "A String", # Number of uncompressed response bytes for JS resources on the page.
122 "imageResponseBytes": "A String", # Number of response bytes for image resources on the page.
123 "numberHosts": 42, # Number of unique hosts referenced by the page.
124 "numberStaticResources": 42, # Number of static (i.e. cacheable) resources on the page.
125 "htmlResponseBytes": "A String", # Number of uncompressed response bytes for the main HTML document and all iframes on the page.
126 "numberJsResources": 42, # Number of JavaScript resources referenced by the page.
127 "textResponseBytes": "A String", # Number of uncompressed response bytes for text resources not covered by other statistics (i.e non-HTML, non-script, non-CSS resources) on the page.
128 },
129 "id": "A String", # Canonicalized and final URL for the document, after following page redirects (if any).
130 }</pre>
131</div>
132
133</body></html>