2014-01-23 3 views
0

여기에 내가 이해하지 못하는 것은 item_lookup()에 사용되는 Identifierpython-amazon-product-apipython-amazon-product-api의 항목 식별자는 무엇입니까?

>>> api = API(locale='uk') 
>>> result = api.item_lookup('B006H3MIV8') 
>>> for item in result.Items.Item: 
...  print '%s (%s) in group %s' % (
...   item.ItemAttributes.Title, item.ASIN) 
... 
Chimes of Freedom: The Songs of Bob Dylan (B006H3MIV8) 

에서 샘플 코드입니다. 제 아이디어는 여기에 표시된대로 제품에 대해 리뷰를 얻는 것입니다. 그러나 identifer 대신 제품 이름을 사용하고 싶습니다. 예 : Bamboo stylus. 이것을 어떻게 할 수 있습니까?

>>> api.item_lookup('0316067938', ResponseGroup='Reviews', 
...  TruncateReviewsAt=256, IncludeReviewsSummary=False) 

는 편집 : 나는이 시도 :하지만 나는이 시도 AttributeError: no such child

for item in api.item_search('DVD', Actor="Keanu Reaves",limit=10): 
    print '%s: "%s"' % (item.ItemAttributes.Identifier, 
         item.ItemAttributes.Title) 

던졌습니다 :하지만 난 다른 오류 얻을 :

mazonproduct.errors.AWSError: AWS.MinimumParameterRequirement: Your request should have atleast 1 of the following parameters: 'Keywords','Title','Power','BrowseNode','Artist','Author','Actor','Director','AudienceRating','Manufacturer','MusicLabel','Composer','Publisher','Brand','Conductor','Orchestra','TextStream','Cuisine','City','Neighborhood'.

for item in api.item_search('Blended', keywords="Keanu Reaves"): 
    print '%s: "%s"' % (item.ItemAttributes.Actor, 
        item.ItemAttributes.Title) 

주의를 내가 가진 keywords은 0입니다.

+0

당신은'키워드'가 대문자 K로 시작하고 당신이'키워드'를 작은 k로 썼다는 것을 알 수 있습니까? –

답변

1

item_search이 필요합니다. Bamboo stylus은 단일 제품을 식별하기에는 너무 일반적인 용어입니다. 식별자는 일종의 기본 키와 같습니다. 먼저 item_search을 사용하여 제품을 검색하고 항목을 가져 와서 해당 항목의 식별자를 사용하여 리뷰를 가져옵니다. 예 : - 당신이 query로 보낼 수있는 매개 변수의

>>> api.item_search('Blended', Keywords='Mustang') 

목록은 in the doc 나열됩니다.

+0

item_search를 사용하여 $ 20 이하의 가격으로 Bamboo Stylus의 식별자를 얻으려면 어떻게해야합니까? –

+0

'item_search'에 전달할 수있는 매개 변수는 http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemSearch.html에서 확인할 수 있습니다. 필요한 것을 적용하십시오. –

+0

고마워요! 필터링에 사용할 수있는 유용한 매개 변수가 많이 있지만 검색에서 '식별자'를 추출하는 방법은 무엇입니까? –

관련 문제