question

shanomun avatar image
0 Likes"
shanomun asked

Returning 100 items using the findItemsAdvanced

Hi Guys, Hope you are all well, Just looking for some advice/help. I have an API sample that i have modified for getting sellers with their items, the issue i have it returns only 100 items, i have read that you can return 100 items per page with a maximum of 100 pages which is 10,000. This is not returning the amount for me, just some context i added the use of Datatables for exporting and render the results. Any ideas or help appreciated, let me know what info you need.
finditemsadvancedresultslimit
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

helios825 avatar image
0 Likes"
helios825 answered
It's unclear what you are seeking. You state that your API call only returned 100 items. Then you correctly state that API will return a max of 100 items per page. What's the problem, again? How many items are you expecting?
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shanomun avatar image
0 Likes"
shanomun answered
The results that come back are 100 items, do i need to then paginate for each page. For instance how would i call more than 100 items?
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

helios825 avatar image
0 Likes"
helios825 answered
For more than 100 items, yes, you need to make additional pagination API calls. For items 101 through 200, you need to call the API again and specify page 2.
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shanomun avatar image
0 Likes"
shanomun answered
Is there a possibility of showing me the code or a sample where pagination is visible to call the second page or other pages, I have tried altering the with the following "&paginationInput.entriesPerPage=$maxEntries" . "&paginationInput.totalPages=5" Once i see an example i can work off it and see how it works.
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

clickimusprime avatar image
0 Likes"
clickimusprime answered
You're doing it the right way, but you're mixing up request and response variables. totalPages is a response value not a request value. Read the manual for paginationInput: https://developer.ebay.com/devzone/finding/callref/findItemsAdvanced.html#Request.paginationInput
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shanomun avatar image
0 Likes"
shanomun answered
Thank you for pointing that out, i now have working code, this is what i have now done and please feel free to provide some alternatives or best practice. With @clickimusprime comment i have change totalPages to pageNumber and assigned this a variable. "&paginationInput.entriesPerPage=$maxEntries" . "&paginationInput.pageNumber=$pageNum" With the variable assigned i have now added as part of my submit form a "page select" dropdown with a list of 50 numbers to fetch (i could add 100 as this is the limit abyway). In my submit form i have then assigned the sellerID variable i have as a value for the input box like below. value=" " So now all i do is search for the seller and the form will bring page one back as its the default page, then i change this to page two and search again retrieving more more result. Any changes or best practice i could do?
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.