ASP.NET Amazon ItemSearch

Does anyone know of any good examples or don't want to explain how to do a similar Amazon search, http://blogs.msdn.com/b/coding4fun/archive/2006/10/31/912260.aspx , I would just use this, but it seems to be out of date, and the source is no longer available. Ideal. I would like it to be found on one of the keywords like star track or right up the UPC. I would like to return - this is the name, description, year and link to the image, type (dvd, books, music). Any help would be great, thanks.

+5
source share
4 answers

AWS SprightlySoft for .NET lets you interact with the Amazon Product Advertising API. Here is sample code for finding an UPC based item. Get the component for free at http://sprightlysoft.com/ . The component comes with sample code that shows how to do ItemSearch using the product’s advertising API.

//Product Advertising API, ItemLookup: http://docs.amazonwebservices.com/AWSECommerceService/2010-10-01/DG/ItemLookup.html

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

String RequestURL;
RequestURL = "https://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&Operation=ItemLookup&Version=2010-10-01";
RequestURL += "&AWSAccessKeyId=" + System.Uri.EscapeDataString(TextBoxAWSAccessKeyId.Text) + "&SignatureVersion=2&SignatureMethod=HmacSHA256&Timestamp=" + Uri.EscapeDataString(DateTime.UtcNow.ToString("yyyy-MM-dd\\THH:mm:ss.fff\\Z"));
RequestURL += "&ItemId=025192022272";
RequestURL += "&IdType=UPC";
RequestURL += "&SearchIndex=DVD";

String RequestMethod;
RequestMethod = "GET";

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

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);

    MyXmlNamespaceManager = new System.Xml.XmlNamespaceManager(MyXmlDocument.NameTable);
    MyXmlNamespaceManager.AddNamespace("amz", "http://webservices.amazon.com/AWSECommerceService/2010-10-01");

    MyXmlNodeList = MyXmlDocument.SelectNodes("amz:ItemLookupResponse/amz:Items/amz:Item", MyXmlNamespaceManager);

    if (MyXmlNodeList.Count == 0)
    {
        ResponseMessage = "Item not found.";
    }
    else
    {
        foreach (System.Xml.XmlNode ItemXmlNode in MyXmlNodeList)
        {
            MyXmlNode = ItemXmlNode.SelectSingleNode("amz:ItemAttributes/amz:Title", MyXmlNamespaceManager);
            ResponseMessage += "Title = " + MyXmlNode.InnerText;

            ResponseMessage += Environment.NewLine;
        }
    }

    MessageBox.Show(ResponseMessage);
}
else
{
    MessageBox.Show(MyREST.ResponseStringFormatted);
}
+1
source

I wrote a little C # Wrapper for Amazon ItemLookup , which returns you a convenient graph of objects. It only supports ItemLookup right now. I have a source in BitBucket .

You can make calls such as:

var item = client.LookupByAsin("B0037X9N5U");
double? price = item.GetLowestPrice();
+4
source

, nuget Nager.AmazonProductAdvertising

NuGet

PM> Install-Package Nager.AmazonProductAdvertising

var authentication = new AmazonAuthentication();
authentication.AccessKey = "accesskey";
authentication.SecretKey = "secretkey";

var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.DE);
var result = wrapper.Lookup("B0037X9N5U");
+1

All Articles