简体   繁体   English

亚马逊产品广告 API 的 C# 库

[英]C# library for Amazon Product Advertising API

I'm trying to retrieve data from 'Amazon Product Advertising API', and I see that I need to sign my request, and then the response is an XML document which should be parsed.我正在尝试从“亚马逊产品广告 API”检索数据,我发现我需要对我的请求进行签名,然后响应是一个应该被解析的 XML 文档。

I wonder if there is any library which I can send my requests throught, and recieve the response back as an object.我想知道是否有任何库可以发送我的请求,并将响应作为对象接收。

If not, what should I do to convert those XML reponses to an object ?如果没有,我应该怎么做才能将这些 XML 响应转换为对象? I've read about schemas, but where do I get those schemas from and where do I get from the defention for the response objects so I could define them my self.我已经阅读了关于模式的内容,但是我从哪里获取这些模式以及从响应对象的防御中获取到哪里,以便我可以自己定义它们。

Thanks alot!非常感谢!

You can use the following nuget package您可以使用以下nuget

PM> Install-Package Nager.AmazonProductAdvertising

Example:例子:

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

var client = new AmazonProductAdvertisingClient(authentication, AmazonEndpoint.DE);
//Search
var result = await client.SearchItemsAsync("canon eos");
//Lookup
var result = await client.GetItemsAsync("B00BYPW00I");

There is a library that helps you sign requests AND process the responses by converting the XML into a relatively easy-to-use object.有一个库可以帮助您签署请求并通过将 XML 转换为相对易于使用的对象来处理响应。 I've been using it for a few weeks now and wrote my own helper classes to really make querying the API fast and easy.我已经使用它几个星期了,并编写了我自己的帮助类来真正使查询 API 变得快速而简单。

I wrote a demo console C# app where you can just plug in your Amazon credentials and start playing around here: https://github.com/zoenberger/AmazonProductAdvertising我编写了一个演示控制台 C# 应用程序,您可以在其中插入您的 Amazon 凭据并开始在此处播放: https : //github.com/zoenberger/AmazonProductAdvertising

I also answered a similar question here: https://stackoverflow.com/a/33617604/5543992我也在这里回答了类似的问题: https : //stackoverflow.com/a/33617604/5543992

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM