lundi 2 mars 2015

Amazon API book search

I am trying to get get some keywords or tags from an amazon book. Example the book How To Lose 10 Pounds In A Week (http://ift.tt/1CiyDXa) I would like a list of keywords that match this book, but everything RequestGroup i try that might have this list ether returns "Feature Tags is deprecated." or no result at all.


Is it even possible to get such a list from amazon, or do i have to extract the keywords myself?


Short: What ResponseGroup do i need to add to my Amazon API call to get a list of keyword/tag for the book i am requesting information for?


Here is the code that i am using to test with:



SprightlySoftAWS.REST MyREST = new SprightlySoftAWS.REST();

String RequestURL;
RequestURL = "http://ift.tt/1wJHsSX";
RequestURL += "&AWSAccessKeyId=" + System.Uri.EscapeDataString(MY_AWS_ACCESS_KEY_ID) + "&SignatureVersion=2&SignatureMethod=HmacSHA256&Timestamp=" + Uri.EscapeDataString(DateTime.UtcNow.ToString("yyyy-MM-dd\\THH:mm:ss.fff\\Z"));
RequestURL += "&ItemId=B00L9B7IKE";
RequestURL += "&IdType=ASIN";
//RequestURL += "&SearchIndex=Books";
RequestURL += "&AssociateTag=" + MY_AWS_Associate_Tag;
RequestURL += "&ResponseGroup=Large,SalesRank";

String RequestMethod;
RequestMethod = "GET";

String SignatureValue;
SignatureValue = MyREST.GetSignatureVersion2Value(RequestURL, RequestMethod, "", MY_AWS_SECRET_KEY);

RequestURL += "&Signature=" + System.Uri.EscapeDataString(SignatureValue);

Boolean RetBool;
RetBool = MyREST.MakeRequest(RequestURL, RequestMethod, null);
System.Diagnostics.Debug.Print(MyREST.LogData);

if (RetBool == true)
{
String ResponseMessage = "";
System.Xml.XmlDocument MyXmlDocument;
System.Xml.XmlNamespaceManager MyXmlNamespaceManager;
System.Xml.XmlNode MyXmlNode;
System.Xml.XmlNodeList MyXmlNodeList;

MyXmlDocument = new System.Xml.XmlDocument();
MyXmlDocument.LoadXml(MyREST.ResponseString);
File.WriteAllText("output.xml", MyREST.ResponseString);
}
else
{
Console.WriteLine(MyREST.ResponseStringFormatted);
Console.ReadLine();
}




Aucun commentaire:

Enregistrer un commentaire