【问题标题】:Google Shopping atom feed and actual google shopping website data谷歌购物原子提要和实际谷歌购物网站数据
【发布时间】:2012-10-29 13:53:23
【问题描述】:

我正在使用 google 购物 api 将卖家数据作为 atom 提要获取,但有时 google atom 提要的商店少于我在使用相同搜索关键字或 ean 时可以在 google 购物网站上看到的实际商店数量代码。

可能是什么原因造成的,商店是否可以选择将其产品数据隐藏在 atom 提要中?!

【问题讨论】:

    标签: google-shopping-api


    【解决方案1】:

    编辑:由于分页不是问题,OP 正确地指出商家可以通过 API 请求排除其结果。在Product Feed Specification 上有一个excluded_destination 参数,可以为particular destination 配置。


    您很可能会遇到paging 的情况。 Google(和其他)API 通常不会在响应中返回特定查询的所有结果(想想如果您要查询返回 10,000,000 个结果的东西 - 这对您的程序来说可能会很繁重,对提供者)。

    为了避免这种情况,许多 API 提供了一个参数,让您可以转到结果的“下一页”。 Shopping API 提供了这样一个参数 (nextLink),您可以将其附加到查询中以获取当前结果页面之后的结果

    来自documentation

    {
      "kind": "shopping#products",
      "etag": value,
      "id": "tag:google.com,2010:shopping/products",
    
      "selfLink": value,
      "nextLink": value,
      "previousLink": value,
    
      "totalItems": value,
      "startIndex": value,
      "itemsPerPage": value,
      "currentItemCount": value,
    
      content module,
      ...
      content module,
    
      "items": [
        product resource
      ]
    }
    

    在哪里nextLink = Link to the next page of products, omitted if there is no next page

    【讨论】:

    • 分页不是问题,我希望是这样,例如,网站显示了 3 个商店的产品,在 atom 提要中我得到 2 个
    • @user1570048 啊,明白了(对不起,可能应该假设你会知道:))。至于原因,我认为您实际上是正确的 - 看起来有一个选项可以专门从 API 中排除产品(请参阅groups.google.com/d/msg/google-search-api-for-shopping/…)。我会更深入地研究你是如何做到这一点的,并为后代更新答案:)
    • @user1570048 更新了答案,基本上只是证实了你的怀疑:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-12
    • 1970-01-01
    相关资源
    最近更新 更多