Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 912a812

Browse files
seano314busunkim96
authored andcommitted
Adding example for searchAppearance (googleapis#414)
1 parent b274355 commit 912a812

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

samples/searchconsole/search_analytics_api_sample.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ def main(argv):
140140
response = execute_request(service, flags.property_uri, request)
141141
print_table(response, 'Group by country and device')
142142

143+
# Group by total number of Search Appearance count.
144+
# Note: It is not possible to use searchAppearance with other
145+
# dimensions.
146+
request = {
147+
'startDate': flags.start_date,
148+
'endDate': flags.end_date,
149+
'dimensions': ['searchAppearance'],
150+
'rowLimit': 10
151+
}
152+
response = execute_request(service, flags.property_uri, request)
153+
print_table(response, 'Search Appearance Features')
143154

144155
def execute_request(service, property_uri, request):
145156
"""Executes a searchAnalytics.query request.
@@ -165,7 +176,7 @@ def print_table(response, title):
165176
response: The server response to be printed as a table.
166177
title: The title of the table.
167178
"""
168-
print title + ':'
179+
print '\n --' + title + ':'
169180

170181
if 'rows' not in response:
171182
print 'Empty response'

0 commit comments

Comments
 (0)