通过 UPC 进行商品查找的 Amazon Web 服务
我的工作环境是 Visual Studio 2008 + C#
我正在使用 Amazon WebService,我想使用 SOAP 从 Amazon 获取数据,但是当我尝试传递 IDType = UPC 时,它给了我以下错误消息,那么我该怎么办?
错误:
036725229884 不是 ItemId 的有效值。请更改此值并重试您的请求
MyCode:
ItemLookupRequest request1 = new ItemLookupRequest();
request1.IdType = ItemLookupRequestIdType.UPC;
request1.IdTypeSpecified = true;
request1.ItemId = new string[] { ProductID };
request1.ResponseGroup = new string[] { "Request", "Large", "OfferFull", "BrowseNodes" };
request1.MerchantId = "All";
request1.Condition = Condition.All;
request1.SearchIndex = "Books";
注意: 如何添加多个 SearchIndex,例如(“书籍”、“照片”、“视频”)?
我使用了以下WebService: http://webservices.amazon.com/AWSECommerceService/2009- 11-01/US/AWSECommerceService.wsdl
My working envirnment is Visual Studio 2008 + C#
I am working on Amazon WebService, I want to fetch the data from Amazon using SOAP but when I am trying to pass IDType = UPC it gives me below error message, so what can I do for this ?
Error:
036725229884 is not a valid value for ItemId. Please change this value and retry your request
MyCode:
ItemLookupRequest request1 = new ItemLookupRequest();
request1.IdType = ItemLookupRequestIdType.UPC;
request1.IdTypeSpecified = true;
request1.ItemId = new string[] { ProductID };
request1.ResponseGroup = new string[] { "Request", "Large", "OfferFull", "BrowseNodes" };
request1.MerchantId = "All";
request1.Condition = Condition.All;
request1.SearchIndex = "Books";
Note:
How can I add multiple SearchIndex like ("Books","Photo","Video")?
I have used following WebService:
http://webservices.amazon.com/AWSECommerceService/2009-11-01/US/AWSECommerceService.wsdl
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
还要注意 UPC 和 EAN 之间的差异。
如果您只是在 Amazon.com 上输入 UPC
738678251584
(12 位数字)或 EAN3253581057803
(13 位数字),则两者都会在 Amazon.com 中显示为 UPC描述,但使用 API 时,您必须在搜索时指定 EAN。我们有同时具有这两种功能的产品,您需要相应地指定搜索类型,否则将找不到。
编辑:或者您可以在任意 12 位数字前面添加 0,并始终搜索 EAN。这可能是最好的解决方案。根据定义 "0" + UPC = EAN
此请求对我有用(searchType 是 UPC 或 EAN ):
Also be weary of the difference between UPC and EAN.
If you just punch in a UPC
738678251584
(12 digits) or EAN3253581057803
(13 digits) to Amazon.com it will show both as being UPC in the description, but using the API you must specify EAN when searching.We have products with both and you need to specify the search type accordingly or it won't get found.
Edit: OR you can just prepend a 0 to any 12 digit numbers and always search for EAN. This is probably the best solution. By definition "0" + UPC = EAN
This request worked for me (searchType is either UPC or EAN):
我认为亚马逊不支持跨多个搜索索引的查询。但是,有一个名为
All
特殊索引> 您可以将其与 UPC 查找一起使用。此索引使用的参数有一些限制,但由于您为MerchantId
和Condition
指定了All
,因此它可能会起作用。如果没有,您可以在不使用这些参数的情况下执行查询,然后在获得您感兴趣的 UPC 的 ASIN 后发出新查询。I don't think Amazon supports queries across multiple search indices. However, there is a special index named
All
that you can use with UPC lookups. There are some limitations on the parameters used with this index but since you are specifyingAll
forMerchantId
andCondition
it may work. If not, you could do the query without those parameters and then issue a new query once you have the ASINs for the UPCs you are interested in.