timotheus / ebaysdk-python

eBay API SDK for Python
https://developer.ebay.com/tools/sdks
Other
795 stars 324 forks source link

Trading API and GetSellerList #170

Open darecAdirondack opened 7 years ago

darecAdirondack commented 7 years ago

im trying to retrieve the active and completed items under a list of specified sellers, Ive read a few things in a few different places, but havent really been able to find something that i understand or anything i could work with. I think it might have something to do with my headers or maybe authentication or something. but im also uncertain if its just the way that im setting up my request? i have only ever used the Finding API, and it looks like i need to use Trading instead, but im not sure what little details i might be missing when i tried to switch API's

`from ebaysdk.trading import Connection as trading api = trading(appid='API_KEY_HERE', config_file=None)
api_request = { 'keywords': 'new'} 'outputSelector': 'SellerInfo', 'itemFilter': [ {'name': 'UserId', 'value': 'SELLER_NAME_HERE'}, {'name': 'StartTimeFrom', 'value': QueryTime_Start}, {'name': 'StartTimeTo', 'value': QueryTime_Complete}]}

response = api.execute('GetSellerList', api_request).`

and my complete error message: Traceback (most recent call last): File "C:\Users\dc500\Downloads\All 3.0\All 3\Python\3Pies\Project\_Ordered Tools\practice_getsellerlist.py", line 24, in <module> response = api.execute('GetSellerList', api_request) File "C:\Users\dc500\AppData\Local\Programs\Python\Python35\lib\site-packages\ebaysdk\connection.py", line 120, in execute self.execute_request() File "C:\Users\dc500\AppData\Local\Programs\Python\Python35\lib\site-packages\ebaysdk\connection.py", line 184, in execute_request allow_redirects=True File "C:\Users\dc500\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "C:\Users\dc500\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\adapters.py", line 376, in send timeout=timeout File "C:\Users\dc500\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 559, in urlopen body=body, headers=headers) File "C:\Users\dc500\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 353, in _make_request conn.request(method, url, **httplib_request_kw) File "C:\Users\dc500\AppData\Local\Programs\Python\Python35\lib\http\client.py", line 1084, in request self._send_request(method, url, body, headers) File "C:\Users\dc500\AppData\Local\Programs\Python\Python35\lib\http\client.py", line 1124, in _send_request self.putheader(hdr, value) File "C:\Users\dc500\AppData\Local\Programs\Python\Python35\lib\http\client.py", line 1060, in putheader if _is_illegal_header_value(values[i]): TypeError: expected string or bytes-like object

Bobspadger commented 7 years ago

I'm also trying to get all active listings, I can get a returned result, but it appears to include all expired as well.

Here is a snippet of my code which works:

items = api.execute('GetSellerList', {
    'StartTimeFrom': "2016-08-30T00:00:00",
    'StartTimeTo': "2016-11-01T00:00:00",
    "Pagination": {
        "EntriesPerPage":
            100,
        "PageNumber": 1
    },
    'DetailLevel': 'ReturnAll'
    }
                    )
timotheus commented 7 years ago

You can also use findItemsAdvanced api using an itemFilter that pulls for a given seller or set of sellers. This will return active listings.

http://developer.ebay.com/devzone/finding/callref/extra/fndItmsAdvncd.Rqst.tmFltr.nm.html http://developer.ebay.com/devzone/finding/callref/extra/fndItmsAdvncd.Rqst.tmFltr.nm.html

http://developer.ebay.com/devzone/finding/callref/finditemsadvanced.html http://developer.ebay.com/devzone/finding/callref/finditemsadvanced.html

-Tim

On Nov 3, 2016, at 4:38 AM, Bobspadger notifications@github.com wrote:

I'm also trying to get all active listings, I can get a returned result, but it appears to include all expired as well.

Here is a snippet of my code which works:

items = api.execute('GetSellerList', { 'StartTimeFrom': "2016-08-30T00:00:00", 'StartTimeTo': "2016-11-01T00:00:00", "Pagination": { "EntriesPerPage": 100, "PageNumber": 1 }, 'DetailLevel': 'ReturnAll' } ) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/timotheus/ebaysdk-python/issues/170#issuecomment-258120400, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGoX18s7Cxm0JwymxHMQzGZQmlwBicSks5q6ce5gaJpZM4KOz6s.

Bobspadger commented 7 years ago

@timotheus would this API call just return our own listings - or is it ANY item from ebay from a search ?

Bobspadger commented 7 years ago

@timotheus I've also got the following working:

acitvelist = api.execute('GetMyeBaySelling', {'ActiveList': True,
                                                  'DetailLevel': 'ReturnAll',
                                                  'PageNumber': page})

BUT, this returns ALL listings, across ALL of our ebay Sites (DE, UK, FR etc) but the returned data makes no reference to which site the product is listed on (therefor giving us multiple listings per product and no way to differentiate between them)

maayanz commented 7 years ago

Hey there, I encounter a similar issue, when I am using Trading API for getting seller listings I get the following error: requests.exceptions.InvalidHeader: Header value None must be of type str or bytes, not <class 'NoneType'>

Were you able to resolve that or do you have a workaround? working with findItemsAdvanced API does not provide what I need.

Bobspadger commented 7 years ago

@maayanz yes, the fix in the other thread #172 worked for me and I no longer get duplicates

fsmosca commented 4 years ago

Been experimenting this getSellerList(), but there are output limitations.

This getSellerList() is becoming like a getItemTransactions()

getItemTransactions()

The GetItemTransactions is functioning as expected. In order to retrieve transactional data you must be an authenticated caller that is either the buyer or seller of the transaction.

The discussions of developer support and user/developer: https://forums.developer.ebay.com/questions/33211/getitemtransactions-cant-return-transactionarray-f.html

Protecting sensitive info

It seems to me like ebay is protecting the info on transactions between seller and buyer. Ok you can only get it if the caller is involved in the transaction.

gelodefaultbrain commented 2 years ago

Can someone help me? I am trying to get a seller's list of items along with its data. I am so confused with the documentation. I don't know how to implement it with code.