如何限制谷歌购物API的价格范围 [英] how to restrict price range in google shopping API

查看:129
本文介绍了如何限制谷歌购物API的价格范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using the Google Shopping API to try to retrieve products that have an "order" of magnitud of a certain number, or approximation to this. For example If I would to select products that are between th $40 - $60 price range : $50 +/- $10. What should I add in the URL search string?

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

I know I can rank by price like this (according to the API):

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


推荐答案

Nevermind ,正确的方法是使用flask和jinja2以及ajax。使用Google购物API主'商品'对象时,必须注意使用JSON以及它如何正确映射到其等效的python对象:

Nevermind, the correct way to do this was using flask and jinja2 along with ajax. One has to be aware of using JSON and how it maps correctly to its equivalent python objects, when using the google shopping API main 'items' objects :

"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
    }
  ],
}

这篇关于如何限制谷歌购物API的价格范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆