question

discmaster85 avatar image
0 Likes"
discmaster85 asked

Best way to check remaining quantity for a large number of items

I'm new to the ebay APIs so am still finding my way around. I am using findItemsByCategory to create a list of available items for users of my app and using GetItemStatus to check if the cached items are still available. However, I noticed there are many listings with quantities greater than one. Most importantly, and unexpectedly, if the quantity remaining is zero ebay still classifies the listing as live even though nobody can buy the item. It's not efficient to call GetSingleItem on everything, so anyone have a better solution to get the remaining quantity fora large number of items?

finditemsbycategorygetitemstatusgetsingleiem
· 3
10 |600

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

if you only check items of sellers your app is connected to, you should use GetSellerList, every page shows you 200 items. using the outputfilter you can only request the needed

fields, i.e. : Quantity, QuantitySold, ItemId

0 Likes 0 ·
This might work. I'll check the number of unique sellers but I fear it is just as many as the unique items. Thanks for the suggestion and please let me know if anything else comes to mind!
0 Likes 0 ·
another idea is, to rethink the whole process. instead of checking which item no longer has quantity, you can use ebays notifications to increase quantity after every buy to keep an item alive forever. this is a common practice as long you have enough in stock. managing stock does not necessarily mean you have to use "real" quantity in your items :)
0 Likes 0 ·
helios825 avatar image
0 Likes"
helios825 answered

GetItemStatus should be able to handle up to 20 items in a singular request. Do you need more than that?

10 |600

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

discmaster85 avatar image
0 Likes"
discmaster85 answered

Would I like more to get more than 20 items from GetItemStatus? Of course, who wouldn't? I'd love to just make one call. Alas, I don't think I'll be able to change ebay's design of the API. I am currently using GetItemStatus to grab blocks of 20 items. However, the issue I have is that the item status is Active even if the item is out of stock.

Here is a concrete example. This item is no longer available. It's out of stock. Sold out.

However, when I call GetItemStatus, I get the following.

{
    'ItemID': '383656593331',
    'EndTime': '2022-01-30T12:55:13.000Z',
    'BidCount': 0,
    'ConvertedCurrentPrice': {
            'Value': 44.0, 
            'CurrencyID': 'USD'
     },
    'ListingStatus': 'Active', // this is where the issue is
    'TimeLeft': 'P26DT10H40M9S'
}

Therefore, I need to make a subsequent call to GetSingleItem in order to get more product detail. It is only after I make the second call that I know the available quantity is zero and this item should be treated as inactive. The GetSingleItem calls are expensive in that they are one-to-one. Perhaps there is another call that I can make to get the same quantity detail, but 20 items at a time or more?

· 1
10 |600

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

Meant as a response to @helios825 but wouldn't fit in the comment box.
0 Likes 0 ·
foulfoot avatar image
1 Like"
foulfoot answered

See GetMultipleItems. It handles up to 20 items per call. Additionally, if you use multi-cURL, you can do up to 18 simultaneous calls in one go. So 20x18 = 360 item statuses at once.

Note that any problems with the finding API are probably not going to be fixed (they haven't updated the finding API in years). eBay is switching to the Browse API and will be discontinuing the finding API at some point in the near future.

Foul

· 5
10 |600

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

I think this is the best solution. The calls don't need to be made in parallel for my use case. Making the calls over two to three minutes sequentially is fine for me, my users won't notice that lag and the items churn isn't massive.

Note, that this call alone is doesn't work. I needed to call this passing IncludeSelector=Details and everything is there. I can actually replace my call to GetItemStatus and just use this for 20 item blocks. I will do some more testing and accept if it works (I think it will).

0 Likes 0 ·
This worked beautifully. Not sure how I could have missed this field. Thanks much @
0 Likes 0 ·
you cannot do endless parallel connections because there is a limit (even if not 100% clearly communicated by ebay) and ebay is monitoring this internally.


https://forums.developer.ebay.com/questions/31865/18-simultaneous-threads.html

-1 Like -1 ·
I didn't say "endless parallel connections", I said 18, which is answered in the thread you posted.
-1 Like -1 ·
who said, you said "endless"? nobody. it was just a notice for people reading this and thinking they can do endless parallel connections to solve some problems. so don't feel attacked.
-1 Like -1 ·

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.