question

grimkben avatar image
0 Likes"
grimkben asked

How to use favourite searches more effectively

I've managed to get to the point of returning a list of favourite searches for a particular user, but once I have them I'm not too sure how to use them effectively. I'm using the below code to return the favourite searches: // asking for the fave searches MyeBaySelectionType oFavouritesList = new MyeBaySelectionType(); oFavouritesList.Include = true; // we will call GetMyeBayBuying to get the WatchList GetMyeBayBuyingCall oGetMyeBayBuyingCall = new GetMyeBayBuyingCall(oContext); // the the Version of the call oGetMyeBayBuyingCall.Version = oContext.Version; // set the Site of the call oGetMyeBayBuyingCall.Site = oContext.Site; // enable the compression feature oGetMyeBayBuyingCall.EnableCompression = true; oGetMyeBayBuyingCall.FavoriteSearches = oFavouritesList; try { // make the GetMyeBayBuying call oGetMyeBayBuyingCall.GetMyeBayBuying(); foreach (MyeBayFavoriteSearchType item in oGetMyeBayBuyingCall.FavoriteSearchesReturn.FavoriteSearch) { This works fine, but the only properties that are returned for each favourite search are "Name" and "SearchQuery". The search query itself it just the URL to use to get the results (as an html page). From here as far as I can see, I have two options: 1 - Break down the URL into individual properties (location, keywords etc) which I can then use to pass to the search API itself 2 - return the html generated from running the URL and parse the html Both options seem quite dangerous, as a change in the way the URL is structure or the page is laid out will break my parsing. Is there a better way to return more results about a saved search, or is this the only way?
searchsearch-apisearch-querysearch-saved
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.

1 Answer

· Write an Answer
devanathan.developersupport@ebay.com avatar image
0 Likes"
devanathan.developersupport@ebay.com answered
Hello grimkben, Yes there is no other way. Only GetMyeBayBuying API call returns the FavoriteSearches container. This container contains all the search filters that the user specified while searching in the site before saving the search result. The details included the QueryKeywords, SortOrder, any min/max price filter, etc.,. Do not break down the SearchQuery for individual properties as the structure is not the same for all the searches. Best Regards, Devanathan eBay Developer Support
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.