Use of Amazon APIs

Source: Internet
Author: User
: This article mainly introduces the use of Amazon API. For more information about PHP tutorials, see. As mentioned above, a Japanese friend wants ShopAsk me to help him with a small application. The main function he wants to achieve is to regularly obtain the lowest price of a product. if the price is not within his set range, give it to him. Send emailReminder.

To help me complete the program, he also found a Japanese blog to show me how to use Amazon APIs. The principle is to concatenate a URL through a complex set of rules, access the URL to obtain data in the XML format returned by Amazon, and then obtain the expected product price intelligence. When I directly downloaded and read the official documentation of Amazon, I found a more labor-saving method. In fact, Amazon has provided users with a convenient website through which they can customize their own query content and directly query or generate code. This website name is Amazon Scratchpad (this shows the settings for Japan and Asia. to query China's Amazon, you only need to change the Marketplace to China ).

The settings are as follows:

The generated code is as follows:

Save the generated code to a method (for example, generateURL). The last few lines of the code must be slightly corrected, use the final generated url as the return object of the method instead of echo), and then use this method as follows.

$ Url = generateURL ($ asin); $ responseXML = file_get_contents ($ url); $ parsedXML = simplexml_load_string ($ responseXML );

The above introduces the use of Amazon API, including opening a shop and sending emails. I hope my friends who are interested in the PHP Tutorial will be helpful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.