Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【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