Разобрался. Это код, который я использовал в итоге:
<?php
class AmazonMusicSearch extends AmazonECS {
protected $asin;
protected $detailPageUrl;
protected $ecs;
function __get($name) {
return $this->$name;
}
function __construct() {
$this->ecs = new parent(AZ_APP_ID, AZ_APP_SECRET, 'com', AZ_ASSOCIATE_TAG);
}
function searchByAsin($asin) {
$search = $this->ecs->responseGroup('Small')->category('Music')->search($asin);
$this->asin = $asin;
if(isset($search['Items']['Item']['DetailPageURL'])) {
$this->detailPageUrl = $search['Items']['Item']['DetailPageURL'];
} elseif(isset($search['Items']['Item'][0]['DetailPageURL'])) {
$this->detailPageUrl = $search['Items']['Item'][0]['DetailPageURL'];
} else {
return false;
}
return $this;
}
function detailPageFromAsin($asin) {
return $this->searchByAsin($asin)->detailPageUrl;
}
}
?>