question

sridhar1982 avatar image
0 Likes"
sridhar1982 asked ·

a few filters are not working.

I noticed that some filters of ebay API product search is not working for me. here are those ones: TopRatedSellerOnly','ReturnsAcceptedOnly','Expedited','MaxHandlingTime','Currency' These one work fine: 'condition','Max price'. I have posted this problem with my `python script` in Stack Overflow over [here][1]. It would be very helpful if some can help me out on fixing this issues. Thank you [1]: http://stackoverflow.com/questions/21297320/some-filters-in-ebay-api-are-not-working-in-python
pythonfilterapi-search
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

helios825 avatar image
0 Likes"
helios825 answered ·
A couple things right off the bat that may help: 1) Use the current SERVICE-VERSION (1.12.0) . 2) Be explicit about your GLOBAL-ID . Theoretically setting neither should make much of a difference, but it might, so worth a try. Also try seeing if XML response, by comparison, makes any difference. Also, I'm not sure if you need to URL encode the keywords or not. I don't work with json, so I'm not sure, but you might want to replace those spaces in there with %20 .
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sridhar1982 avatar image
0 Likes"
sridhar1982 answered ·
I tried the following code. As you can see below, all the commented-out filters are not working. you could just run this and see. code: import requests import json from bs4 import BeautifulSoup def add_ebay(): #api_url = ' http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords api_url = ' http://svcs.ebay.com/services/search/FindingService/v1' apikey = ' ' parameters = { 'OPERATION-NAME':'findItemsByKeywords', 'SERVICE-VERSION':'1.0.0', 'SECURITY-APPNAME':apikey, 'RESPONSE-DATA-FORMAT':'json', 'keywords':'harry potter phoenix', 'itemFilter(0).name':'Condition', 'itemFilter(0).value':'New', 'itemFilter(1).name':'MaxPrice', 'itemFilter(1).value':'750.00' #'itemFilter(2).name':'TopRatedSellerOnly', #'itemFilter(2).value':'true', #'itemFilter(3).name':'ReturnsAcceptedOnly', #'itemFilter(3).value':'true' #'itemFilter(4).name':'ExpeditedShippingType', #'itemFilter(4).value':'Expedited', #'itemFilter(5).name':'MaxHandlingTime', #'itemFilter(5).value':'1' #'itemFilter(6).name':'Currency', #'itemFilter(6).value':'USD' } resp = requests.get(api_url, params=parameters) resp.raise_for_status() data = json.loads(resp.text) print data print "\n\n" print data['findItemsByKeywordsResponse'][0]['searchResult'][0]['item'][0]['title'] return data def parse_source(html, encoding='utf-8'): html=open('craigslist_results.html','r') parsed = BeautifulSoup(html, from_encoding=encoding) return parsed parse_source(add_ebay())
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zhuowei.developersupport@ebay.com avatar image
0 Likes"
zhuowei.developersupport@ebay.com answered ·
Hi sridhar1982, When you say some of the filters are not working, can you be more specific? For example, there is no issue when I query by **TopRatedSellerOnly** fileter as below: http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.12.0&SECURITY-APPNAME=YOUR APPNAME&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&outputSelector=SellerInfo⁢emFilter(0).name=TopRatedSellerOnly⁢emFilter(0).value=true&paginationInput.entriesPerPage=10&keywords=piano Success 1.12.0 2014-02-05T23:56:06.526Z 331122744770 EBAY-US 38088 Electronic Keyboards http://thumbs3.ebaystatic.com/m/mxDaCnKlU_oZzj-2C1O5iUg/140.jpg http://www.ebay.com/itm/New-Silver-61-Key-Electronic-Music-Keyboard-Gift-Electric-Piano-Organ-61-/331122744770?pt=Keyboards_MIDI 72455468 PayPal false 33304 Fort Lauderdale,FL,USA US mixwholesale 29181 99.4 TurquoiseShooting true 0.0 Free Worldwide false false 0 43.0 43.0 28 Active P0DT0H8M32S false false 2014-02-05T00:04:38.000Z 2014-02-06T00:04:38.000Z Auction false false 1000 New false true 380797307620 EBAY-US Premium Quality! Same Day Shipping! Blowout Prices! 38088 Electronic Keyboards http://thumbs1.ebaystatic.com/m/m1vy8csTBR-ZdL7KtXKz4hQ/140.jpg http://www.ebay.com/itm/61-Key-Electronic-Music-Keyboard-Gift-Electric-Piano-Organ-61-Silver-New-/380797307620?pt=Keyboards_MIDI 72455468 PayPal false 91730 Rancho Cucamonga,CA,USA US bestchoiceproducts 307292 99.6 RedShooting true 0.0 Free US false false 1 49.95 49.95 Active P8DT19H8M17S false false 2013-12-16T18:59:23.000Z 2014-02-14T19:04:23.000Z FixedPrice false false 1000 New false 114.95 STP true false true 1 2 50121 100242 http://www.ebay.com/sch/i.html?LH_TopRatedSellers=1&_nkw=piano&_ddo=1&_ipg=2&_os=S%7CD&_pgn=1 Best Regards,
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.