1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Copyright 2014 Google Inc. All Rights Reserved.
5
6"""Basic query against the public shopping search API"""
7
8import pprint
9
10from googleapiclient.discovery import build
11
12
13SHOPPING_API_VERSION = 'v1'
14DEVELOPER_KEY = 'AIzaSyACZJW4JwcWwz5taR2gjIMNQrtgDLfILPc'
15
16
17def main():
18  """Get and print a feed of all public products available in the
19  United States.
20
21  Note: The source and country arguments are required to pass to the list
22  method.
23  """
24  client = build('shopping', SHOPPING_API_VERSION, developerKey=DEVELOPER_KEY)
25  resource = client.products()
26  request = resource.list(source='public', country='US')
27  response = request.execute()
28  pprint.pprint(response)
29
30
31if __name__ == '__main__':
32    main()
33