Resources for Developers Using Amazon's Product Advertising API
· Home  
· Search  
· Browse Nodes  
· Data Feed?  
· FAQs  
· One-Second Rule  
· PHP Examples  
· Tips for Associates  
· Tools  
· Understanding A2S  

Create a custom Amazon Associate Store in minutes with
Associate-O-Matic.

Disappointed by Amazon.com and the Associates program?

Please consider
Shareasale

Shareasale manages affiliate programs for thousands of merchants. The site makes it easier to apply to programs and create links. And simple-to-use datafeeds are offered by most merchants.

PHP Examples

A Simple Way to Determine the Search Index for a Browse Node
The following PHP code illustrates a simple method for determining an appropriate search index to use for a given browse node ID. The getIndex function is passed the browse node ID and returns the search index as a string (or '-unknown-' if the... [More]
Getting REST Results with Simple Caching
Here is a function with demonstrates how to combine fetching REST results from Amazon's A2S servers with a simple caching scheme using a MySQL database. function getPage($url, $maxage=7, $cache = true) { $body = ""; if ($cache) ... [More]
PHP A2S Demo 1 - ItemLookup
The following is a simple example of using PHP to perform an A2S ItemLookup operation and display the information in HTML. It uses functions usually included in PHP version 4 and later. <?... [More]
REST Authentication for PHP4
Amazon has announced that, starting in August of 2009, A2S (now renamed "Product Advertising API") queries will require authentication. This will require you to change any code which accesses the web services. The following PHP code should help. ... [More]
Trimming Descriptions and Reviews
Often you would like to trim a product description or customer review to a shorter length. The following PHP function will trim a string to a desired length. It breaks the string at a space. function cutString($text, $limit) { $text =... [More]
Using CURL to Get Results from ECS
The following PHP function allows you to fetch results from an A2S query including the status code. It returns the text returned from the URL. It also returns the HTTP status code and the HTTP headers. function getAmazonPage($url,... [More]

Copyright © 2017 by Roger Smith