I'm trying to get the details of Amazon product from its ASIN. The product API allows to do a Itemlookup with ASIN
, but the return value is in XML
.
I want to do this call for Itemlookup from client side, so would like to do a JSONP
call, which I couldn't find.
I found some articles on the web to convert the XML to JSON
format using XSLT stylesheet:
(a) https://bitbucket.org/basti/python-amazon-product-api/src/tip/examples/json-results.py
I tried using this python-amazon-product-api
and this example, but I couldn't get a JSON
return.
(b) http://www.kokogiak.com/gedankengang/2006/05/consuming-amazons-web-api-directly.html
The request I tried to send is:
http://xml-us.amznxslt.com/onca/xml?AWSAccessKeyId=[ACCESS KEY]&AssociateTag=[ASSOCIATE TAG]&ContentType=text%2Fjavascript&IdType=ASIN&ItemId=B008IEGS9W&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes&Service=AWSECommerceService&Style=http%3A%2F%2Fforums.delphiforums.com%2Fdelphidocsz%2Famazon%2Fjson.xsl&Timestamp=2012-09-04T06%3A40%3A11Z&Signature=AGOqXvVSeMp3YyVkT4mGNXVx0cFGG%2Bh%2FdAebevbbF9o%3D
Please help with getting a JSON format with Amazon product API
.
The OP can run this style-sheet (input document not used) to determine his XSLT version.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="xsl msxsl">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
<head><title>About your XSLT Processor</title></head>
<body>
<ul>
<li>xsl:version=<xsl:value-of select="system-property('xsl:version')" /></li>
<li>xsl:vendor=<xsl:value-of select="system-property('xsl:vendor')" /></li>
<li>xsl:vendor-url=<xsl:value-of select="system-property('xsl:vendor-url')" /></li>
<li>xsl:product-name=<xsl:value-of select="system-property('xsl:product-name')" /></li>
<li>xsl:product-version=<xsl:value-of select="system-property('xsl:product-version')" /></li>
<li>xsl:is-schema-aware=<xsl:value-of select="system-property('xsl:is-schema-aware')" /></li>
<li>xsl:supports-serialization=<xsl:value-of select="system-property('xsl:supports-serialization')" /></li>
<li>xsl:supports-backwards-compatibility=<xsl:value-of select="system-property('xsl:supports-backwards-compatibility')" /></li>
<li>msxsl:version=<xsl:value-of select="system-property('msxsl:version')" /></li>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>