skip to Main Content

Currenly i am working in ebaysdk. I am facing the problem which is the weight of the product. how can i can get product weight ? I used trading api but most of weight of the products equal to 0. is there any way to get every product weight? I requested like this:

response = api_trading.execute('GetItem' , 
{"ItemID":"184097524395",'DestinationPostalCode':'2940','DestinationCountryCode':'GB'})

2

Answers


  1. Chosen as BEST ANSWER

    It seems like if the seller does not indicate a weight in the first place, the api has nothing to show for it.

    If shipping is free, most likely the seller does not bother entering the weight of the item. So perhaps find those products whose shipping is not free, maybe the seller will indicate the weight for shipping calculations.

    "ShippingDetails": {"ShippingType": "Calculated"}
    

    I also tried GetItem and it can show weight of the item as long as weight is available. I also tried GetItemShipping and it can show weight of item if available, but needs DestinationPostalCode.

    Souce:https://github.com/timotheus/ebaysdk-python/issues/304


  2. Some items have their weight included in the "Items Specifics" section, which can only be extracted by setting "IncludeItemSpecifics" to "true" in the trading api execution:

    response = api_trading.execute('GetItem' , {"ItemID":"254350593466", "IncludeItemSpecifics": "true"})
    

    Then, one possible way to get the details of interest is by looping through the dictionary:

    for d in response.dict()['Item']['ItemSpecifics']['NameValueList']: 
        print(d)
    

    The weight Name and Value will be in one of those dictionaries:

    ...
    {'Name': 'Item Length', 'Value': '1', 'Source': 'ItemSpecific'}
    {'Name': 'Item Weight', 'Value': '2.25', 'Source': 'ItemSpecific'}
    {'Name': 'Item Width', 'Value': '1', 'Source': 'ItemSpecific'}
    ...
    

    Source:
    https://developer.ebay.com/devzone/guides/features-guide/default.html#development/ItemSpecifics.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search