我使用谷歌购物api来获取卖家数据作为atom馈送,但有时谷歌atom馈送的店铺数量少于我在使用相同搜索关键字或ean代码时在谷歌购物网站上看到的实际店铺数量。
什么可能会导致这种情况,商店有哪些选项可以将他们的产品数据隐藏在atom提要中?!
发布于 2012-10-29 22:03:59
编辑: As分页不是问题,OP的声明是正确的,商家有一种方法可以从API请求中排除他们的结果。在Product Feed Specification上有一个excluded_destination参数,可以为particular destination配置该参数。
您很可能会遇到paging的情况。Google (和其他)API通常不会在响应中返回特定查询的所有结果(想象一下,如果您要查询返回10,000,000个结果的内容-这可能是您的程序要处理的大量问题,同时也是提供程序的负担)。
为了规避这一点,许多API都提供了一个参数,让您可以转到结果的“下一页”。Shopping API就提供了这样一个参数(nextLink),您可以将其附加到查询中,以获得当前结果页面之后的结果页面
{
"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
https://stackoverflow.com/questions/13122978
复制相似问题