Howtos ItemSearch

Exeu edited this page Dec 3, 2010 · 6 revisions

First of all instantiate AmazonECS

$amazonEcs = new AmazonECS('API KEY', 'SECRET KEY', 'LANG');

The parameter LANG is optional.
It could be: US, UK, DE, JP, FR, CA.

If you have an object you can start with your first request.

$response = $amazonEcs->category('DVD')->responseGroup('Images')->search("Matrix Revolutions");

We say: Go to category “DVD”, search for “Matrix Revolutions” and give me “Images” only. *

The Sample above will give you an ArrayObject with all information you requestet.

Note: It is important to know what you are getting back. For this please read the API Guide from Amazon.

To change the format to something like this:


Repeat the example from above and you will get back an pure array.

Maybe you want to see whats going on, on the US market?

$response = $amazonEcs->country('us')->search('MySql');

Note: The location is from now on changed to US. You can change it the same way with locations from above.

Assign optional parameters and multiple responsegroups to your request.

$response = $amazonEcs->responseGroup('Small,Images')->optionalParameters(array('ItemPage' => 2))->search('Bruce Willis');

Back to index