I don't get prices with Amazon Product Advertising API
To get prices for an item you need to include a ResponseGroup
parameter of Offers
or OfferFull
and a MerchantId
parameter of All
:
$params = array( 'AWSAccessKeyId' => self::API_KEY, 'AssociateTag' => self::API_ASSOCIATE_TAG, 'Version' => "2010-11-01", 'Operation' => "ItemLookup", 'Service' => "AWSECommerceService", 'Condition' => "All", 'IdType' => 'ASIN', 'ResponseGroup' => 'Offers', <- important 'MerchantId' => 'All', <- important 'ItemId' => $artNr);
If you don't include the MerchantId
of All
you will only get offer listings for Amazon (the default MerchantId
). This will return the offer listings and your response will include something like the following:
<Items> ... <Item> ... <Offers> ... <Offer> ... <OfferListing> <Price> <Amount>1350</Amount> <CurrencyCode>USD</CurrencyCode> <FormattedPrice>$13.50</FormattedPrice> </Price> ... </OfferListing> ... </Offer> ...
See the documentation for the Offers Response Group for more information. Also see the Response Group request parameter description for the ItemLookup operation for more valid Response Groups.
I suggest you use the OfferSummary response Group which will return something like this:...
["Items"]=> object(stdClass)#72 (2) { ... ["Item"]=> object(stdClass)#75 (2) { ["ASIN"]=> string(10) "1405910232" ["OfferSummary"]=> object(stdClass)#76 (6) { ["LowestNewPrice"]=> object(stdClass)#77 (3) { ["Amount"]=> int(247) ["CurrencyCode"]=> string(3) "GBP" ["FormattedPrice"]=> string(6) "£2.47" } ["LowestUsedPrice"]=> object(stdClass)#78 (3) { ["Amount"]=> int(297) ["CurrencyCode"]=> string(3) "GBP" ["FormattedPrice"]=> string(6) "£2.97" }
...
Use "medium" for "ResponseGroup" parameter, allowed values small, medium and large. small response will not have the price details.
http://docs.aws.amazon.com/AWSECommerceService/latest/DG/RG_Small.html