Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would use the Amazon Product Advertising API ItemSearch API (see doc: <a href="http://docs.amazonwebservices.com/AWSECommerceService/2010-11-01/DG/ItemSearch.html" rel="nofollow">http://docs.amazonwebservices.com/AWSECommerceService/2010-11-01/DG/ItemSearch.html</a>)</p> <p>When forming your request, you will need to pass a number of parameters such as "Title", "SearchIndex" ("Books" in your case) and additional mandatory parameters (Note that you can try adding more request parameters, such as "Author" or "Keywords" to fine tune your query). </p> <p>If you search for "The Bad Beginning" (by Lemony Snicket), the request URL would look like:</p> <pre><code>http://ecs.amazonaws.com/onca/xml? Service=AWSECommerceService&amp; AWSAccessKeyId=[AWS Access Key ID]&amp; Operation=ItemSearch&amp; Title=The%20Bad%20Beginning&amp; SearchIndex=Books &amp;Timestamp=[YYYY-MM-DDThh:mm:ssZ] &amp;Signature=[Request Signature] </code></pre> <p>The response, which can contain 0 to n items, will look like:</p> <pre><code>&lt;TotalResults&gt;111&lt;/TotalResults&gt; &lt;TotalPages&gt;12&lt;/TotalPages&gt; &lt;Item&gt; &lt;ASIN&gt;006029809X&lt;/ASIN&gt; &lt;DetailPageURL&gt;http://www.amazon.com/dp/006029809X&lt;/DetailPageURL&gt; &lt;ItemAttributes&gt; &lt;ProductGroup&gt;Books&lt;/ProductGroup&gt; &lt;Title&gt;The Trouble Begins: A Box of Unfortunate Events, Books 1-3 (The Bad Beginning; The Reptile Room; The Wide Window)&lt;/Title&gt; &lt;/ItemAttributes&gt; &lt;/Item&gt; &lt;Item&gt; &lt;ASIN&gt;006075589X&lt;/ASIN&gt; &lt;DetailPageURL&gt;http://www.amazon.com/dp/006075589X&lt;/DetailPageURL&gt; &lt;ItemAttributes&gt; &lt;ProductGroup&gt;Books&lt;/ProductGroup&gt; &lt;Title&gt;The Bad Beginning&lt;/Title&gt; &lt;/ItemAttributes&gt; &lt;/Item&gt; ... </code></pre> <p>You can then parse the XML to get the information you want (the ASIN in your case).</p> <p>A few words of warnings: </p> <ul> <li>Do not expect the results to be 100% correct. You will most certainly have to clean up the results by hand.</li> <li>If you get one or more items in your XML response, the first result may not be the book you are expecting (see the response above: the first item in the response actually corresponds to a box set that includes the book you are looking for...).</li> <li>You could try performing some post-processing to compare your title with the title of each item returned by the ItemSearch API, but any trivial comparison (such as testing for the same "exact title") will yield a high number of false negative due to typos or inconsistencies in the Amazon Database.</li> <li>Even in the case where your title matches perfectly with one of the items in the response, the ASIN may correspond to a different book (same title, different author), to a different edition (you have a 4th edition textbook, but Amazon returns information about the 8th edition) or to a different binding (you have a paperback but Amazon returns the hardcover version).</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload