Question

I only get 100 results. Code excerpt:

FindingServicePortTypeClient client = FindingServiceClientFactory.getServiceClient(config);

FindItemsByCategoryRequest req = new FindItemsByCategoryRequest();
req.categoryId = new string[] { "1249" };
req.sortOrder = SortOrderType.BestMatch;
req.sortOrderSpecified = true;
req.itemFilter = new ItemFilter[]
{
    new ItemFilter()
    {
        name = ItemFilterType.EndTimeFrom,
        value = new string[]
        {
            DateTime.Now.Add(TimeSpan.FromHours(1)).ToString("yyyy-MM-ddTHH:mm:ss")
        }
    }
};

PaginationInput pi = new PaginationInput();
pi.entriesPerPage = int.MaxValue;
pi.entriesPerPageSpecified = true;
req.paginationInput = pi;

FindItemsByCategoryResponse response = client.findItemsByCategory(req);

As you can see I tried using int.MaxValue, but to no avail. Is it not possible to get all items from a category?

Was it helpful?

Solution

Well first-off eBay will limit your pagination input entries per page to 100, and your total items returned to 10,000 on any particular search (see http://developer.ebay.com/Devzone/finding/CallRef/findItemsByCategory.html#Request.paginationInput). So this won't work whether it's logical or not. Think of the immense server load they would have to deal with if you could return a result of 100,000+ items in one call.

Now, you might think there's still a clever way to get past the block of limits and just stay under the quantified limits. But according to http://developer.ebay.com/Devzone/finding/CallRef/findItemsByCategory.html#Request.paginationInput.pageNumber (2 entries below the first link) you can't even access results past the 100th page. So at 100 results per page and 100 pages you really only can get any of the first 10,000 (point being that you can not start at page 101, because it's simply disallowed). Again, this is probably because of the resources it would take them to access past that point. This must be somewhat disappointing...

Sorry about that :/, but it's the full story.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top