Get and print a feed of all public products matching the search query "digital camera", that are created by "Canon" available in the United States. The "restrictBy" parameter controls which types of results are returned. Multiple values for a single restrictBy can be separated by t
()
| 16 | |
| 17 | |
| 18 | def main(): |
| 19 | """Get and print a feed of all public products matching the search query |
| 20 | "digital camera", that are created by "Canon" available in the |
| 21 | United States. |
| 22 | |
| 23 | The "restrictBy" parameter controls which types of results are returned. |
| 24 | |
| 25 | Multiple values for a single restrictBy can be separated by the "|" operator, |
| 26 | so to look for all products created by Canon, Sony, or Apple: |
| 27 | |
| 28 | restrictBy = 'brand:canon|sony|apple' |
| 29 | |
| 30 | Multiple restricting parameters should be separated by a comma, so for |
| 31 | products created by Sony with the word "32GB" in the title: |
| 32 | |
| 33 | restrictBy = 'brand:sony,title:32GB' |
| 34 | """ |
| 35 | client = build("shopping", SHOPPING_API_VERSION, developerKey=DEVELOPER_KEY) |
| 36 | resource = client.products() |
| 37 | request = resource.list( |
| 38 | source="public", country="US", restrictBy="brand:canon", q="Digital Camera" |
| 39 | ) |
| 40 | response = request.execute() |
| 41 | pprint.pprint(response) |
| 42 | |
| 43 | |
| 44 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…