Amazon API usage, Amazon API uses
As mentioned above, a Japanese friend wants to open a shop in Amazon and ask me to do a little app for him. The main function He wants to achieve is to regularly get the lowest price of a product, and if the price is not within his set, send him an email alert.
To help me complete the program, he also found me a Japanese blog that describes how to use the Amazon API. Its principle is to use a complex set of rules to stitch a URL, and then access the URL to obtain the Amazon returned XML format data, and then get the desired commodity price information. When I downloaded and read the official Amazon documents, I found a more effort-saving approach. In fact, Amazon has provided users with a convenient website, through which they can customize their own query content, directly query or generate code. This site is named Amazon Scratchpad (this shows the settings for Nichia, if you need to query China Amazon, just change marketplace to Chinese).
The Setup section is as follows:
The resulting code is represented as follows:
Save the generated code in a method (for example, called GenerateURL, the last few lines of code need a little correction, the resulting URL as the return object of the method instead of Echo), and then use the same method as below.
$url = GenerateURL ($asin), $responseXML = file_get_contents ($url); $parsedXML = simplexml_load_string ($responseXML);
http://www.bkjia.com/PHPjc/1069128.html www.bkjia.com true http://www.bkjia.com/PHPjc/1069128.html techarticle Amazon API use, Amazon API use as mentioned above, a Japanese friend wants to open a shop in the Amazon, ask me to help him do a small application. The main function he wanted to achieve was to get it timed ...