Skip to content

Instantly share code, notes, and snippets.

@davidtsadler
Last active February 19, 2024 03:06
Show Gist options
  • Save davidtsadler/6993747 to your computer and use it in GitHub Desktop.
Save davidtsadler/6993747 to your computer and use it in GitHub Desktop.
A very simple example showing how to make an eBay Finding API request with the ebaysdk-python (https://github.com/timotheus/ebaysdk-python). The example will do a keyword search for 'laptops' across the UK eBay site and restrict the search to the two categories Apple Laptops(111422) and PC Laptops & Netbooks(177). In addition the results are fil…
import ebaysdk
from ebaysdk import finding
api = finding(siteid='EBAY-GB', appid='<REPLACE WITH YOUR OWN APPID>')
api.execute('findItemsAdvanced', {
'keywords': 'laptop',
'categoryId' : ['177', '111422'],
'itemFilter': [
{'name': 'Condition', 'value': 'Used'},
{'name': 'MinPrice', 'value': '200', 'paramName': 'Currency', 'paramValue': 'GBP'},
{'name': 'MaxPrice', 'value': '400', 'paramName': 'Currency', 'paramValue': 'GBP'}
],
'paginationInput': {
'entriesPerPage': '25',
'pageNumber': '1'
},
'sortOrder': 'CurrentPriceHighest'
})
dictstr = api.response_dict()
for item in dictstr['searchResult']['item']:
print "ItemID: %s" % item['itemId'].value
print "Title: %s" % item['title'].value
print "CategoryID: %s" % item['primaryCategory']['categoryId'].value
@PhilipPhil
Copy link

How to filter out sellers you don't like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment