PHP Use the Amazon API to Get Product Prices

Amazon Price API

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.

Price.PHP

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.

About the Author Steven

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.

follow me on:

Leave a Comment:

4 comments
Creating a YouTube Pop Up Window (onClick) - Geeky Frog says November 16, 2017

[…] may also be interested in the Amazon API Post or the AWS Cloud as Personal Server […]

Reply
PHP - Infinite Scroll Pagination using JQuery Ajax Example - Geeky Frog says November 18, 2017

[…] may also be interested in the Amazon API Post or the AWS Cloud as Personal WebServer […]

Reply
Wordpress Blue Line on top of table - Geeky Frog says December 3, 2017

[…] may also be interested in the Amazon API Post or the PHP Email […]

Reply
Wordpress - Creating a Simple mySQL Query Plugin - Geeky Frog says December 5, 2017

[…] may also be interested in the Amazon API Post or the PHP Email […]

Reply
Add Your Reply