07-17-2023 01:28 PM
I'm trying to retrieve search results by using Finding API/findItemsAdvanced,
It seems to inconsistent a count of searchResult and paginationOutput.
For example, following is containing 'adidas' as keywords.
const url = `https://svcs.ebay.com/services/search/FindingService/v1\
?OPERATION-NAME=findItemsAdvanced\
&SERVICE-VERSION=1.0.0\
&SECURITY-APPNAME=${clientId}\
&RESPONSE-DATA-FORMAT=JSON\
&REST-PAYLOAD\
&keywords=adidas`
In my case, searchResult.count was 10,
but expected count is 100 due to pagenationOutput as following.
"paginationOutput": [
{
"pageNumber": [
"1"
],
"entriesPerPage": [
"100"
],
"totalPages": [
"21201"
],
"totalEntries": [
"2120034"
]
}
],
Other cases also return few count of search result.
Is the count of search results limited implicitly with some reason?
Solved! Go to Best Answer
07-17-2023 02:54 PM
The Finding API will return no more than 10,000 items, and since that count can include variations, the number of actual listings can be considerably fewer than the item count. To eliminate variations from affecting the number of returnable items, include an indexed itemFilter:
&itemFilter(index).name=HideDuplicateItems
&itemFilter(index).value=true
The Finding API can return up to 100 items per page, and will only return one page per call. If the call returned only 10 items on page 1, and 100 items were expected, the variations have influenced the number.
Beginning in Feb 2018, even with variations/duplicates turned off, eBay began returning the totalPages and totalEntries based on the larger number that included variations. In modifying my code, I had to look at the returned number of items on each page to determine if the last page had been reached. In some cases, the last page ended with an even count, so, rather than struggling with that (and with some items moving to the next or prior page, due to the timing of each page call), I settled on an array-sort to remove duplicate entries.
07-17-2023 02:54 PM
The Finding API will return no more than 10,000 items, and since that count can include variations, the number of actual listings can be considerably fewer than the item count. To eliminate variations from affecting the number of returnable items, include an indexed itemFilter:
&itemFilter(index).name=HideDuplicateItems
&itemFilter(index).value=true
The Finding API can return up to 100 items per page, and will only return one page per call. If the call returned only 10 items on page 1, and 100 items were expected, the variations have influenced the number.
Beginning in Feb 2018, even with variations/duplicates turned off, eBay began returning the totalPages and totalEntries based on the larger number that included variations. In modifying my code, I had to look at the returned number of items on each page to determine if the last page had been reached. In some cases, the last page ended with an even count, so, rather than struggling with that (and with some items moving to the next or prior page, due to the timing of each page call), I settled on an array-sort to remove duplicate entries.
07-17-2023 03:19 PM
Thanks for detailed explanation!
As you said, it went well with enabling HideDuplicateItems.
10-29-2023 01:18 AM
Thank you so much!!! I was losing my mind with this problem.