【Python】Amazon Product Advertising APIを使ってASINから商品の重量・高さ・横幅・奥行きを取得する方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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