PHP Use the Amazon API to Get Product Prices

Amazon API Logo


Getting prices using the Amazon API

I am going to show you how to use the script below to get a price using the Amazon API, the easiest way. I appreciate you linking back to my website if you find this useful.

Here is a great script to grab the prices from the Amazon. I found this well written script by this SITE. What I found is that it printed out the raw API information which I couldn’t use.

Then I found this website and a post from Alejandro which helped explain how to use it.


The just of it is to use the following call to get the price for the product you provide from the $response = getAmazonPrice(“com”, $asin);

Snippet of code to grab the price from the $response

Notice the return $response[‘price’]; This will deliver the price you are looking for for the product. $response[‘code’]; will provide the currency such as USD or CAD

I think take the price and update my database tables daily with the Amazon prices. I am not sure if the prices have to be done in real time but figured this would just slow down my website, so I thought updating maybe once or twice a day would be sufficient.


Amazon.PHP API get Price code


Updating DB with Prices

Populating your mySQL Database with the Prices which you can query later, I run this nightly, you may find this useful.

I just run it on the command line, php -f price.php. You don’t need the html.


Please go ahead and comment…

I would love to hear from you and if I have missed anything, let me know and I will add it.

I would appreciate you linking back to my blog if you found any of these articles useful.


You may also be interested in the Email Form Post.



Steven has a technical background in System Design, Unix Systems and Enterprise Architecture & Design. He also has a background with 15 years of Unix Systems Primarily HP-UX, Linux and AIX Open Systems. He also has a background in programming languages such as C, Perl, PHP, CGI and Web Environments.

4 thoughts to “PHP Use the Amazon API to Get Product Prices”

Leave a Reply

Your email address will not be published. Required fields are marked *