Use of Amazon API, Amazon API use_PHP tutorial

WBOY
Release: 2016-07-12 09:05:18
Original
1545 people have browsed it

Use of Amazon API,Use of Amazon API

As mentioned above, a Japanese friend wanted to open a store on Amazon and asked me to help him make a small application. The main function he wants to achieve is to regularly obtain the lowest price of a certain product. If the price is not within the range he set, send him an email reminder.

In order to help me complete the program, he also found me a Japanese blog that introduced how to use Amazon’s API. Its principle is to splice a URL through a complex set of rules, then access this URL to obtain the XML format data returned by Amazon, and then obtain the desired product price information. When I directly downloaded and read Amazon's official documentation, 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, directly query or generate codes. This website is called Amazon Scratchpad (the settings shown here are for Japan and Asia. If you need to query Amazon in China, just change the Marketplace to China).

The setting part is as follows:

The generated code is expressed as follows:

Save the code it generates into a method (for example, it is called generateURL. The last few lines of the code need to be slightly modified, and the last generated URL is used as the return object of the method instead of echoing it out), and then when using it Just use this method as below.

$url = generateURL($asin);
$responseXML = file_get_contents($url);
$parsedXML = simplexml_load_string($responseXML);
Copy after login

 

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1069128.htmlTechArticleThe use of Amazon API, the use of Amazon API As mentioned above, a Japanese friend wants to open a store on Amazon, please ask me Help him make a small application. The main function he wants to achieve is to obtain regularly...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!