问题
I'm really new with amazon.
What I want to do is to get amazon product descriptions to my localhost server by using product ASIN number and PHP (can i do this???). I haven't done this before and don't know how to perform this action.
I think that just scraping the price from the Amazon website is bad idea and better to use an API. Can I use Amazon AWS for this? I have created an account in https://aws.amazon.com/ (is this the right place?) and see this big screen with many amazon aws options.
Surfing in internet I found some examples but I think I need keyId, secretKey, associateId - to try this example. Can somebody help be get a better understanding of what to do and where to look? Thanks.
回答1:
If you are not familiar with AWS that's a fair assumption to make.
Actually AWS is completely separate to Amazon.com (the online retailer).
Amazon Web Services (AWS) is a cloud computing platform that allows you to run virtual servers, databases, storage, and many higher level managed services. You should consider running your PHP server on there, a good starting point for absolute beginners is LightSail, where you can create a LAMP stack in minutes.
Back to your original question, to get product details you need to use Amazon Marketplace Web Services (MWS), specifically the GetMatchingProductForId and pass in your ASIN number.
See here for a PHP Example, the important parts of that example, for you to expand on, are:
public function getProductById($ProductID, $IdType = 'ASIN') {
$request = new MarketplaceWebServiceProducts_Model_GetMatchingProductForIdRequest();
$request->setSellerId($this->MySellerId);
$request->setMarketplaceId($this->MyMarketplaceId);
$request->setIdType($IdType);
if (!is_array($ProductID)) {
$ProductID = array($ProductID);
}
$idList = new MarketplaceWebServiceProducts_Model_IdListType();
$idList->setId($ProductID);
$request->setIdList($idList);
$response = $this->service->GetMatchingProductForId($request);
return $response;
}
来源:https://stackoverflow.com/questions/53222070/can-i-use-aws-to-get-product-descriptions-about-amazon-com-retail-products