Using eBay's finding API (Python)

503 views Asked by At

I'm trying to query eBay (UK) using the ebaysdk (eBay developers program) in python. Even with few item filters and broad keywords (see the code I tried below), I get 'ResponseDataObject' object has no attribute 'item' because there were no items returned. If I go to "ebay.co.uk" in the browser I can find multiple pages of results.

From examples and their API documentation (which I find extremely confusing) I have tried this basic example using their finding API:

from ebaysdk.finding import Connection

api = Connection(
    siteid='EBAY-GB',
    domain='svcs.sandbox.ebay.com',
    appid='my_real_app_id_is_here',
    config_file=None)

request = {
    'keywords': "iPhone",
    'itemFilter': [
        {'name': 'Condition', 'value': 'Used'},
    ]
}
response = api.execute('findItemsByKeywords', request)

if response.reply.ack == 'Success':
    for item in response.reply.searchResult.item:
        print(f"""
            Title: {item.title}\n
            Price: {item.sellingStatus.currentPrice.value} {item.sellingStatus.currentPrice.currencyId}\n
            Location: {item.location}\n
            Thumbnail: {item.galleryURL}\n"""
              )

With some very specific keywords I can find some results on 'EBAY-US'. I have also tried other item filters and the API "findItemsAdvanced" API call. Am I doing something wrong or missing something? Why am I receiving no items in the response?

1

There are 1 answers

1
samjarvis On

It seems to work as expected when using the production app ID and domain ("svcs.ebay.com") instead of the sandbox app ID and domain ("svcs.sandbox.ebay.com"). Hope this helps someone at some point in time.