Simple product search API

Oli picture Oli · Oct 11, 2010 · Viewed 13.5k times · Source

I'm trying to do something for a webapp I'm building:

  1. The user inputs a fuzzy product title, eg: Bob Dylan Blonde On Blonde
  2. The app presents a list of products matching that string sorted by relevance.

I've tried doing this through the Amazon ECS API. I realise that would lock me to Amazon but right now, I'm okay with that.

The problem with ECS is when the user searches, I don't know what the product band is, and there appears to be a limitation whereby the results come back in a really strange order, not relevance or popularity (if they're not the same thing). For example, searching ECS for "Bob Dylan" returns posters as the first two items, then a video, then a random CD and then more videos and posters.

What I really want is something like Amazon's real search. If you went to Amazon and fired in "Bob Dylan", you get back a load of CDs (as you should). Now I'm sure I'm technically able to scrape Amazon or Google Shopping... But I'm sure that's against some terms of service.

So my questions:

  1. Can you search and sort Amazon's ECS in the same way they do for their user-facing website?

  2. Is there a Google Product Search/Shopping API that I could use instead in a similar (completely behind the scenes - not on-the-page JS) way?

Edit for the bounty-seekers.

At the moment I'm doing this:

  1. Querying Google's AJAX search (this apparently works on the backend like their SOAP version did, just with AJAX, not sure if I'm allowed to or not) with site:amazon.co.uk and inurl:/dp/ along with the search string and this brings me back a list of products in a sensible popularity-sorted order.

  2. For each product, I extract the procuct code from the Google-given URL and I'm querying Amazon ECS for the product title, price, link, etc.

So for one search with five results, I'm doing 6 requests. It's pretty hideous. If somebody can find me a simplified way of doing this just through Amazon (or another API), I'd be really appreciative (to the tune of 525 reputation)

Answer

Ali Afshar picture Ali Afshar · Jan 24, 2011