Blog

How to use AWS for searching products’ info from amazon databases

2013.12.17Cat:プログラマー

There are many services(api) provided by Amazon Web Services (AWS).

  • Amazon Elastic Compute Cloud (Amazon EC2)
  • Amazon Simple Notification Service (SNS)
  • Amazon Simple Queue Service (SQS)
  • Amazon CloudFront
  • Amazon Simple Storage Service (S3)
  • Amazon CloudSearch
  • Amazon Simple Workflow Service (SWF)
  • Product Advertising API etc ..

Among them, if we would like to extract product information that hosted on amazon databases, we could use

Product Advertising API (API Version 2011-08-01) [formerly called ECS].

Developer Guide:

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/Welcome.html

Getting Started Guide:

http://docs.aws.amazon.com/AWSECommerceService/latest/GSG/Welcome.html

Testing and Debugging:

http://associates-amazon.s3.amazonaws.com/scratchpad/index.html

http://associates-amazon.s3.amazonaws.com/signed-requests/helper/index.html

To make an api request to amazon, we need to get respective access key, secret key and associate tag or associate ID. How to get those keys and tag is stated on the following link:

http://docs.aws.amazon.com/AWSECommerceService/2011-08-01/GSG/GettingSetUp.html

The briefly procedure is as follow: we firstly need to create (1)an amazon aws account(.co.jp). With that account, we have to create (2)Associate Tag(Japan end with -22, eg; asdf-22). After that, on Associate Tage admin page, we will find (3)”Product Advertising API” tag and we can create product advertising api account(.co.jp) from that tag. If we have created product advertising api account, we will get amazon access key and secret key.

When we create aws account,  Associate Tag and product advertising account, those works only in the locale in which you register. There are many locale provided by amazon: de, com, co.uk, ca, fr, co.jp, it, cn, es

For each locale, there is a respective database. If we choose co.jp locale, our api request will go to amazon’s jp database instead of .com database and then get required data from it.

After we have got all keys and tag, we could make an api request to amazon web services with request type: REST or SOAP.

Request type:

REST and SOAP

Response format:

XML

The following operations are available in the Product Advertising API.

  • BrowseNodeLookup
  • CartAdd
  • CartClear
  • CartCreate
  • CartGet
  • CartModify
  • ItemLookup
  • ItemSearch
  • SimilarityLookup

When we make an api request to amazon, the response will include huge amount of data. So if we would like to narrow response data scope according to our specific requirement, we could customize “Response Groups” on api request.

http://docs.aws.amazon.com/AWSECommerceService/2011-08-01/DG/CHAP_ResponseGroupsList.html

In each Response Groups, we could choose desired “Response Elements” again according to our need.

http://docs.aws.amazon.com/AWSECommerceService/2011-08-01/DG/RG_ItemAttributes.html

After preparing all of the requirements stated above, we will get actual api request to amazon:

Sample API request:

http://webservices.amazon.co.jp/onca/xml?

AWSAccessKeyId=ACCESSKEYHERE

&AssociateTag=ASSOCIATETAGHERE

&Condition=All

&Keywords=1449319793 (ISBN)

&Operation=ItemSearch

&ResponseGroup=Images%2CItemAttributes%2COffers

&SearchIndex=Books

&Service=AWSECommerceService

&Timestamp=2013-12-17T02%3A35%3A47.000Z

&Version=2011-08-01

&Signature=SIGNATUREHERE

If you properly setup the api request link and put it in browser’s address bar, you will get amazon’s response with XML format.

Enjoy!!!

Author Profile

Sterfield
» 投稿一覧
  • Launch Cart次世代ECサイト構築システム 初期月額無料
  • LaunchMovie ECに特化した動画制作サービス

Archive

ページTOPへ