Introducing the Amazon API


Amazon's API presents two different methods of interaction: REST (Representational State Transfer) and SOAP (Simple Object Access Protocol). The majority of the examples within this chapter utilize the SOAP method; I will, however, initially present an interaction using REST for completeness. I have selected SOAP for use within the chapter because of the relatively clean level of abstraction that can be obtained by using a SOAP class such as NuSOAP, and to offer a counterpoint to Amazon's own examples, which are almost exclusively REST. This chapter covers a few common methods of interacting with Amazon's API; a full listing of available interfaces is presented in Appendix C.

Registering for the Amazon API

You can register for the Amazon API by visiting the root page (www.amazon.[com/jp/ca/co.uk/, and so on]) for the desired version of Amazon. Scroll to the bottom of the page and click the Join Associates link. This will bring you to the previously unseen Make Money tab. From there, click the Web Services link underneath the tab bar, and then click Register for AWS on the left side. This will provide you with a developer tag, which will allow you to begin running queries against the API; however, you can't earn any referral fees yet. In order to earn any referral fees, you need to register as an Associate. To register as an Associate, return to the Make Money tab, select the Associates subtab, and click the Join Now button on the left. Registering as an Amazon Associate will provide you with an associate id. This id will be passed with your requests, and the resulting URLs will have that id coded in, to allow Amazon to track which customers you send its way.

Limitations of the Amazon API

The Google API was quite restrictive in the number of queries you could run per day — only 1,000 (which is really only like 40 requests per hour). However, the Amazon API is much more giving, allowing one request per second. This likely stems from the fact that results presented with the Google API represent a loss in revenue (because API results do not include advertisements, one of Google's primary revenue streams), whereas results presented from Amazon's API represent potential revenue for Amazon and you.

Possibilities with the Amazon API

Amazon allows a tremendous variety of different requests to be run against its service. Items can be searched for by a multitude of criteria (keyword being only one of them), shopping carts can be created and loaded to the brim (50 unique items), and Amazon's lists can be accessed. All of this gives you a variety of ways to determine which products to display to your visitor, and a variety of ways to make revenue from those referrals.




Professional Web APIs with PHP. eBay, Google, PayPal, Amazon, FedEx, Plus Web Feeds
Professional Web APIs with PHP. eBay, Google, PayPal, Amazon, FedEx, Plus Web Feeds
ISBN: 764589547
EAN: N/A
Year: 2006
Pages: 130

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net