Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created June 5, 2016 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/5ce2f23297d0f72d2bc413f654615ee8 to your computer and use it in GitHub Desktop.
Save kurozumi/5ce2f23297d0f72d2bc413f654615ee8 to your computer and use it in GitHub Desktop.
【Python】Amazon Product Advertising APIを使ってASINから商品の重量・高さ・横幅・奥行きを取得する方法
from amazon.api import AmazonAPI
AMAZON_ACCESS_KEY = "amazon_access_key"
AMAZON_SECRET_KEY = "amazon_secret_key"
AMAZON_ASSOC_TAG = "amazon_assoc_tag"
amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, region="JP")
try:
product = amazon.lookup(ItemId="B00BMKMP6Y")
print product.get_attributes(['ItemDimensions.Width', 'ItemDimensions.Height', 'ItemDimensions.Length', 'ItemDimensions.Weight'])
except Exception, e:
print e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment