2

我正在使用 Google Shopping API 来尝试检索具有特定数量或近似值的“订单”数量的产品。例如,如果我要选择价格在 40 美元到 60 美元之间的产品:50 美元 +/- 10 美元。我应该在 URL 搜索字符串中添加什么?

我知道我可以像这样按价格排名(根据 API):

     GET https://www.googleapis.com/shopping/search/v1/public/products?key=key&country=US&q=%22mp3+player%22%7Cipod&rankBy=price%3Adescending
4

1 回答 1

0

没关系,正确的方法是使用烧瓶和 jinja2 以及 ajax。在使用 google 购物 API 主要“项目”对象时,必须注意使用 JSON 以及它如何正确映射到其等效的 python 对象:

"product": {
  "googleId": "9243781955569725518",
  "author": {
    "name": "CompUPlus.com",
    "accountId": "1209120"
  },
  "creationTime": "2010-03-04T09:51:45.000Z",
  "modificationTime": "2010-11-25T09:24:08.000Z",
  "language": "en",
  "country": "US",
  "title": "Logitech Squeezebox Radio, black",
  "description": "Logitech Squeezebox Radio brings a world of free Internet radio subscription
                  services and your personal digital music collection to any space in your home
                  over your Wi-Fi network.",
  "link": "http://www.compuplus.com/Radios/LOGITECH-Squeezebox-Radio-BLK-930-1115160.html",
  "gtin": "00097855063601",
  "gtins": [
   "00097855063601"
  ],
  "brand": "Logitech",
  "mpn": "930-000101",
  "condition": "new",
  "images": [
    { "link": "http://content.etilize.com/300/1014430207.jpg" }
  ]
  "inventories": [
    {
      "channel": "online",
      "availability": "inStock",
      "currency": "usd",
      "price": 183.19
    }
  ],
}
于 2012-05-02T23:00:38.777 回答