blob: 4d4bad780e055f5d8ee26c4268de251dba8fbdd2 [file] [log] [blame]
Dmitry Frenkel3e17f892020-10-06 16:46:05 -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="searchconsole_v1.html">Google Search Console API</a> . <a href="searchconsole_v1.searchanalytics.html">searchanalytics</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
81 <code><a href="#query">query(siteUrl, body=None, x__xgafv=None)</a></code></p>
82<p class="firstline">Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned.</p>
83<h3>Method Details</h3>
84<div class="method">
85 <code class="details" id="close">close()</code>
86 <pre>Close httplib2 connections.</pre>
87</div>
88
89<div class="method">
90 <code class="details" id="query">query(siteUrl, body=None, x__xgafv=None)</code>
91 <pre>Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned.
92
93Args:
94 siteUrl: string, The site&#x27;s URL, including protocol. For example: `http://www.example.com/`. (required)
95 body: object, The request body.
96 The object takes the form of:
97
98{
Yoshi Automation Botc2228be2020-11-24 15:48:03 -080099 &quot;dimensionFilterGroups&quot;: [ # [Optional] Zero or more filters to apply to the dimension grouping values; for example, &#x27;query contains \&quot;buy\&quot;&#x27; to see only data where the query string contains the substring \&quot;buy\&quot; (not case-sensitive). You can filter by a dimension without grouping by it.
100 { # A set of dimension value filters to test against each row. Only rows that pass all filter groups will be returned. All results within a filter group are either AND&#x27;ed or OR&#x27;ed together, depending on the group type selected. All filter groups are AND&#x27;ed together.
101 &quot;groupType&quot;: &quot;A String&quot;,
102 &quot;filters&quot;: [
103 { # A filter test to be applied to each row in the data set, where a match can return the row. Filters are string comparisons, and values and dimension names are not case-sensitive. Individual filters are either AND&#x27;ed or OR&#x27;ed within their parent filter group, according to the group&#x27;s group type. You do not need to group by a specified dimension to filter against it.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800104 &quot;operator&quot;: &quot;A String&quot;,
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800105 &quot;expression&quot;: &quot;A String&quot;,
106 &quot;dimension&quot;: &quot;A String&quot;,
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800107 },
108 ],
109 },
110 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800111 &quot;rowLimit&quot;: 42, # [Optional; Default is 1000] The maximum number of rows to return. Must be a number from 1 to 25,000 (inclusive).
112 &quot;startRow&quot;: 42, # [Optional; Default is 0] Zero-based index of the first row in the response. Must be a non-negative number.
113 &quot;searchType&quot;: &quot;A String&quot;, # [Optional; Default is \&quot;web\&quot;] The search type to filter for.
114 &quot;aggregationType&quot;: &quot;A String&quot;, # [Optional; Default is \&quot;auto\&quot;] How data is aggregated. If aggregated by property, all data for the same property is aggregated; if aggregated by page, all data is aggregated by canonical URI. If you filter or group by page, choose AUTO; otherwise you can aggregate either by property or by page, depending on how you want your data calculated; see the help documentation to learn how data is calculated differently by site versus by page. **Note:** If you group or filter by page, you cannot aggregate by property. If you specify any value other than AUTO, the aggregation type in the result will match the requested type, or if you request an invalid type, you will get an error. The API will never change your aggregation type if the requested type is invalid.
115 &quot;startDate&quot;: &quot;A String&quot;, # [Required] Start date of the requested date range, in YYYY-MM-DD format, in PST time (UTC - 8:00). Must be less than or equal to the end date. This value is included in the range.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700116 &quot;dimensions&quot;: [ # [Optional] Zero or more dimensions to group results by. Dimensions are the group-by values in the Search Analytics page. Dimensions are combined to create a unique row key for each row. Results are grouped in the order that you supply these dimensions.
117 &quot;A String&quot;,
118 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800119 &quot;endDate&quot;: &quot;A String&quot;, # [Required] End date of the requested date range, in YYYY-MM-DD format, in PST (UTC - 8:00). Must be greater than or equal to the start date. This value is included in the range.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700120 }
121
122 x__xgafv: string, V1 error format.
123 Allowed values
124 1 - v1 error format
125 2 - v2 error format
126
127Returns:
128 An object of the form:
129
130 { # A list of rows, one per result, grouped by key. Metrics in each row are aggregated for all data grouped by that key either by page or property, as specified by the aggregation type parameter.
131 &quot;rows&quot;: [ # A list of rows grouped by the key values in the order given in the query.
132 {
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800133 &quot;ctr&quot;: 3.14,
134 &quot;impressions&quot;: 3.14,
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700135 &quot;keys&quot;: [
136 &quot;A String&quot;,
137 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700138 &quot;position&quot;: 3.14,
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800139 &quot;clicks&quot;: 3.14,
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700140 },
141 ],
142 &quot;responseAggregationType&quot;: &quot;A String&quot;, # How the results were aggregated.
143 }</pre>
144</div>
145
146</body></html>