Getting the red price listed on products on amazon through the product services api
I'm trying to get a list of products and their prices using the item_search api, that corresponds to the list of products on amazon. I am able to get a matching set of products, but am not able to consistently get the prices listed in red on the website. I am getting the price through the first offer, Offers>>Offer>>OfferListing>>Price>>FormattedPrice, and am guessing that's not the right way to get the 'r开发者_C百科ed' price. Was wondering if someone could help me out.
Thanks
If by "red price" you mean the $17.87
pointed to in the image above then this is the price that the product is sold at by the MerchantId
of Amazon.com
which is returned in the OfferFull
response group.
To get only Amazon.com
offer listings returned in the response, set the MerchantId
request attribute to Amazon
. You can then use the node you've been using (Offers > Offer > OfferListing > Price > FormattedPrice
) to consistently get the "red price".
If there are no offers returned when using the Amazon.com
MerchantId
, then Amazon does not have the product in stock and it's perhaps only sold by third parties.
For example, the following pseudo request will get only the offer listings that are sold by Amazon.com
:
http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=[AWS Access Key ID]&
Operation=ItemLookup&
ItemId=1451648537&
Condition=All&
ResponseGroup=OfferFull& <- make sure you have this set to OfferFull
MerchantId=Amazon& <- set this one to get only Amazon.com offers
Version=2009-03-31&
Timestamp=[YYYY-MM-DDThh:mm:ssZ]&
Signature=[Request Signature]
See the documentation for OfferFull response group for more info.
精彩评论