Reputation: 1734
On a website I'm building a search for Amazon products. This should display some information on the products I can pick up using their affiliate API. I can look up information on the products using this dependency (which I'm not entirely happy about, because I should probably create my own package from their provided WSDL), but I'm not entirely sure what would be the best way to implement an autocomplete in a searchbox for their products.
I want to load the autocomplete information from my own server rather than one of Amazon's, but I am not certain what the recommended way to do this would be. Through the provided Amazon affiliate API or is there a better way?
As a summary, I am looking for a way where I have a textbox with autocompletion on my website, that uses my own server to do the autocompletion (example.com/search/autocomplete/%QUERY%), which should then call some autocompletion functionality on the Amazon API.
Upvotes: 7
Views: 7503
Reputation: 1495
I created a vanilla JavaScript plugin to integrate the Amazon Autocomplete webservice into a search input.
Fortunately, the Amazon webservice is JSONP enabled so it let you handle the requests via <script>
tags and callbacks, which is already implemented in the plugin.
https://github.com/caroso1222/amazon-autocomplete
Upvotes: 2
Reputation: 1734
Amazon offers -next to their affiliate API- a webservice which can be used to get their autocomplete information. It can be utilized by calling an URL in the style of:
http://completion.amazon.com/search/complete?search-alias=aps&client=amazon-search-ui&mkt=1&q=canon
Where the contents of q is the query that you want autocompleted.
Upvotes: 14