Skip to content

Instantly share code, notes, and snippets.

@davidtsadler
Last active February 19, 2024 03:06
Show Gist options
  • Star 32 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • 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
@snehilchopra
Copy link

I keep getting the following error, whenever i try to run any of the examples above. Any clues as to what might be the issue?

'findItemsAdvanced: Internal Server Error, Domain: Security, Severity: Error, errorId: 10001, Service call has exceeded the number of times the operation is allowed to be called'

@josjaf
Copy link

josjaf commented Aug 24, 2019

Sounds like you are out of API calls

@ggg22
Copy link

ggg22 commented Feb 9, 2020

This was asked before but no reply and wonder if somebody can assist since documentation is not clear on this.

{'name': 'Condition', 'value': 'Used'},

how to add another value above. This is a more general question and not only related to the Condition filter. There are many filters that support multiple values and I wish there are examples how to do this in this SDK since it's pretty basic feature. All examples are showing a single value only.

@fsmosca
Copy link

fsmosca commented Mar 31, 2020

I don't think anybody answered the pagination question. Any ideas?

Perhaps put the whole thing in the function and make the page a variable.

def find_item_advanced(page_num):
    api = Connection( ...
    ....
    'pageNumber': page_num
    ...

def main():
    total_pages = 8  # Input
    total_pages = min(total_pages, 100)

    for p in range(1, total_pages + 1):
        find_item_advanced(p)

if __name__ == '__main__':
    main()

Ref: https://developer.ebay.com/DevZone/finding/CallRef/findItemsIneBayStores.html#Request.paginationInput

...
You can return up to the first 100 pages of the result set by issuing multiple requests and specifying, in sequence, the pages to return.
Min: 1. Max: 100. Default: 1.

@Dhairya40
Copy link

Hi every one can any one please show me how to change ebay order status python api? Please

@fsmosca
Copy link

fsmosca commented Apr 3, 2020

Hi every one can any one please show me how to change ebay order status python api? Please

I saw orders.py from ebaysdk-python. This might help in what your are trying to achieve.
https://github.com/timotheus/ebaysdk-python/blob/master/ebaysdk/poller/orders.py

@carlcrott
Copy link

Anyone know of a replacement for the dump module for python3?

@brianmcaudill
Copy link

#This file contains all the above fixes and is working for me as of 09-June-2020

import ebaysdk
from ebaysdk.finding import Connection as finding

api = finding(domain='svcs.sandbox.ebay.com', debug=True, appid='YOUR_APP_ID', config_file=None)

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'])
print("Title: %s" % item['title'])
print("CategoryID: %s" % item['primaryCategory']['categoryId'])

@Dhairya40
Copy link

Dhairya40 commented Jun 12, 2020 via email

@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