skip to Main Content

I am trying to get item’s title with “GetSingleItem” method by providing the ItemID, but it does not work.

Here is the code:

from ebaysdk.shopping import Connection as Shopping

api = Shopping(appid='&',certid='&',devid='&',token='&')
ItemID=&
a = print (api.execute('GetSingleItem',{'ItemID':ItemID,'IncludeSelector':['Title']}))
print(a)

The response:

<ebaysdk.response.Response object at 0x003A3B10>
None

2

Answers


  1. I think you need to put the itemID like this

    {
    “ItemID”: “000000000000”
    }

    Login or Signup to reply.
  2. You don’t need to specify title in your GET request. Ebays Shopping API provides that output field by default. You can check in their documentation here

    It should be noted however, that when using ‘InputSelector’ it should come before ‘ItemId’ as the order seems to matter. So your code should look like this.

    api.execute('GetSingleItem', {'IncludeSelector':outputField,'ItemID':ItemID})
    

    Where outputField could be

    Compatibility,
    Description, Details, ItemSpecifics, ShippingCosts, TextDescription, Variations

    To answer your question simply execute:

     response = api.execute('GetSingleItem', {'ItemID':ItemID})
     title = response.dict()['Item']['Title']
     print(title)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search