Reputation: 880
i am using google shopping api to get the sellers data as an atom feed but sometimes the google atom feed have less shops that the actual number of shops that i can see on the google shopping website when using the same search keyword or ean code.
what might cause this, are the there options for shops to make their product data hidden in the atom feed?!
Upvotes: 0
Views: 334
Reputation: 37249
EDIT: As paging is not the issue, the OP is correct in stating that there is a way for merchants to exclude their results from API requests. On the Product Feed Specification, there is an excluded_destination
parameter which can be configured for a particular destination.
You are likely running into a paging
situation. Google (and other) APIs will usually not return all of the results for a particular query in the response (think if you were to query something that returned 10,000,000 results - that could be a lot for your program to handle as well as burdensome for the provider to provide).
In order to circumvent this, many APIs provide a parameter that lets you go to the 'next page' of results. The Shopping API provides just such a parameter (nextLink
), which you can append to your query to get the page of results following the current one
From the 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
]
}
Where nextLink
= Link to the next page of products, omitted if there is no next page
Upvotes: 1