0

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
Luuklag
  • 3,897
  • 11
  • 38
  • 57
m2bb
  • 1
  • 2

2 Answers2

1

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)
0

I think you need to put the itemID like this

{ "ItemID": "000000000000" }

johnashu
  • 2,167
  • 4
  • 19
  • 44