Skip to content

Commit ec736d9

Browse files
committed
Added a shopping sample and also adding shopping to api-python-client-doc
1 parent 89174d2 commit ec736d9

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

samples/api-python-client-doc/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def get(self):
7373
<li><a href='/diacritize/v1'>diacritize</a>
7474
<li><a href='/translate/v2'>translate</a>
7575
<li><a href='/prediction/v1.1'>prediction</a>
76+
<li><a href='/shopping/v1'>shopping</a>
7677
</ul>
7778
""")
7879

samples/shopping/main.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/python2.4
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright 2010 Google Inc. All Rights Reserved.
5+
6+
"""Simple command-line example for The Google Shopping API.
7+
8+
Command-line application that does a search for products.
9+
"""
10+
11+
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
12+
13+
from apiclient.discovery import build
14+
15+
import pprint
16+
17+
# Uncomment the next line to get very detailed logging
18+
# httplib2.debuglevel = 4
19+
20+
21+
def main():
22+
p = build("shopping", "v1",
23+
developerKey="AIzaSyDRRpR3GS1F1_jKNNM9HCNd2wJQyPG3oN0")
24+
res = p.products().list(
25+
country='US',
26+
source='public',
27+
q='logitech revue'
28+
).execute()
29+
pprint.pprint(res)
30+
31+
if __name__ == '__main__':
32+
main()

0 commit comments

Comments
 (0)