最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【整理】AWS中的ASIN,ItemId,IdType

Amazon crifan 3502浏览 0评论

【背景】

折腾:

【未解决】通过Amazon的API查找某个产品的关键字

过程中,需要去搞懂其中很多AWS中的术语:

ASIN

以及相关的ItemId,IdType

【折腾过程】

1. 参考:

Null ItemDimensions

http://www.caliban.org/ruby/ruby-aws/classes/Amazon/AWS/ItemLookup.html

才知道,原来之前:

http://www.amazon.com/Silver-Linings-Playbook/dp/B00CL68QVQ/ref=sr_1_2?s=instant-video&ie=UTF8&qid=1368688342&sr=1-2

中的

B00008OE6I

是ASIN==ASIN (Amazon Standard Item Number)

2. 但是再参考官网解释,却是:

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CHAP_response_elements.html

ASIN

A positive integer distributed by Amazon that uniquely identifies an item. ASIN of the new release, item, or similar item

Ancestry: Item/ASIN CartItem SavedForLaterItem Cart/NewReleases/NewRelease NewReleases/NewRelease/ASIN OtherCategoriesSimilarProduct/ASIN SimilarProduct SimilarViewedProduct, CustomerReviews/Review

即,全是数字。

例子:

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/RG_ItemIds.html

  <Item>
    <ASIN>0976925524</ASIN>
  </Item>

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemLookup.html

		<Item>
			<ASIN>0316067938</ASIN>

3. 但又参考:

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemLookup.html

Response

Name          
Description

ASIN          
Amazon Standard Identification Number, which is an alphanumeric token assigned by Amazon to an item that uniquely identifies it.

即,又是字母加数字,是我们所期望的了。

4.另外参考:

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemLookup.html

相关的IdType和ItemId:

IdType

Type of item identifier used to look up an item. All IdTypes except ASINx require a SearchIndex to be specified.

Type: String

Default: ASIN

Valid Values: SKU | UPC | EAN | ISBN (US only, when search index is Books). UPC is not valid in the CA locale.

ItemId

One or more (up to ten) positive integers that uniquely identify an item. The meaning of the number is specified by IdType. That is, if IdType is ASIN, the ItemId value is an ASIN. If ItemIdis an ASIN, a search index cannot be specified in the request.

Type: String

Default: None

Constraints: Must be a valid item ID. For more than one ID, use a comma-separated list of up to ten IDs.

5.这里:

AWS Documentation » Amazon Product Advertising API Docs » Developer Guide » Programming Guide » Product Advertising API Terminology and Basic Concepts » Items for Sale

也解释了ASIN:

Item Identifiers

All items for sale on www.amazon.com have identifiers. There are two major kinds. The first identifies items regardless of whether or not they can be purchased:

  • ASIN—Amazon Standard Item Number

    An alphanumeric token that uniquely identifies items in the Amazon marketplace.

    All items in the marketplace have an ASIN. This is by far the most common identifier. ASINs are used by the majority of Product Advertising API operations.

【总结】

目前的推测是:

1.ASIN的含义:

  • 之前旧的是ASIN是全数字的:A positive integer:0316067938

  • (后来产品太多了?全数字的不够用了?所以推出)

  • 新的ASIN是字母加数字的:alphanumeric token:B00008OE6I

2. 另外的:

IdType==ASIN

ItemId==ASIN


【后记 2013-06-22】

1.后来整理了:

【整理】Amazon产品信息抓取心得+AWS心得

其中就有,关于ASIN的方面的特点:

Amazon的产品的页面,比如随便找一个:

http://www.amazon.com/Nokia-Lumia-928-Verizon-Wireless/dp/B00CQAODG4/ref=sr_1_7?s=wireless&ie=UTF8&qid=1371965011&sr=1-7

其中的:B00CQAODG4

就是此产品的ASIN。

而在已知一个ASIN,则可以通过:

http://www.amazon.com/gp/product/ASIN

的方式去访问到产品的页面的信息

此处即:

http://www.amazon.com/gp/product/B00CQAODG4

其和上面的页面地址:

http://www.amazon.com/Nokia-Lumia-928-Verizon-Wireless/dp/B00CQAODG4/ref=sr_1_7?s=wireless&ie=UTF8&qid=1371965011&sr=1-7

也是效果一样的。

 

因为

http://www.amazon.com/Nokia-Lumia-928-Verizon-Wireless/dp/B00CQAODG4/ref=sr_1_7?s=wireless&ie=UTF8&qid=1371965011&sr=1-7

去掉后面的query string即为:

http://www.amazon.com/Nokia-Lumia-928-Verizon-Wireless/dp/B00CQAODG4

其和:

http://www.amazon.com/gp/product/B00CQAODG4

两着是等价的。

 

2.关于IdType和ItemId的关系,后来才搞懂:

AWS中有很多id,ASIN是其中的一种。其他的还有UPC,EAN,ISBN等等。

所以,你发送给amazon服务器一个id的时候,amazon服务器不知道是啥类型的。

所以需要一个参数,用于说明此id是什么类型的,

所以在代码中,会有个参数,叫做IdType。

用的最多的,就属ASIN了。

所以一般会见到:

IdType=ASIN,

然后ItemId=某个产品的ASIN的值,比如:

ItemId=B00CQAODG4

在代码里面,就体现为:

reqDict["IdType"] = "ASIN";
reqDict["ItemId"] = "B00CQAODG4";

详见:

【记录】继续优化C#版的AWS的ItemLookup接口

中的:

【整理】C#版的AWS的ResponseGroup的ItemAttributes示例代码

转载请注明:在路上 » 【整理】AWS中的ASIN,ItemId,IdType

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (2)

  1. 楼主您好,看了你写的东西,觉得真棒。有个问题请教下,我现在可以用amazon api,我的目的是提取出一些书的适合年龄(product detail下面的age range和grade level) 但是通过api(主要是通过Itemlookup中的itemAttributes)试了很久都没有找到这方面的结果。请问如何才能得到呢?api是不是很多产品信息是不全的? thanks!
    Hugo1018年前 (2016-03-30)回复
86 queries in 0.171 seconds, using 22.32MB memory