Amazon MWSで商品の情報を取得する

今までAmazonでは、Amazon Product Advertising API(PA-API)を使用して商品情報が取得できていたのですが、このAPIは2012/8末で廃止になります。
代わりに用意されたAmazon MWSの商品APIを使用して商品情報を取得する方法を説明します。

Amazon MWSとは?

Amazon MWSは、Amazon Marketplace Web Serviceの略で、アマゾンのマーケットプレースに出品している人が、WebAPIベースで作業を行うためのサービスですこれを使用する事によって、Amazonのサイトにブラウザでアクセスしなくても、出品・出荷・価格改定etcの作業を行う事が可能です。

また、Amazon MWSは小口の出品者は使用することが出来ません。4,900円/月の利用料を払っている大口出品者のみが利用可能です。


商品APIとは?


Amazon MWS 商品APIは、出品者が出品している商品に対して、競合他社の出品状況を取得する事が可能です。これにより、出品予定の商品やの情報や、価格改定時の情報が取得可能になります。商品APIを使用する事によって、商品属性や現在の価格等の情報を入手できます。


商品APIには、以下のWebAPIが存在します(詳細は後述)。

ListMatchingProducts
GetMatchingProduct
GetMatchingProductForId
GetCompetitivePricingForSKU
GetLowestOfferListingsForSKU
GetLowestOfferListingsForASIN
GetMyPriceForSKU
GetMyPriceForASIN
GetServiceStatus




APIによっては、複数のASINを指定できます。複数指定可能なのは以下の5つとなります。

GetMatchingProduct
GetCompetitivePricingForSKU
GetCompetitivePricingForASIN
GetLowestOfferListingsForSKU
GetLowestOfferListingsForASIN



複数指定するにはパラメータの末尾に連番を付けて、以下のような感じでクエリを投げます。

https://mws.amazonservices.com/Products/2011-10-01?AWSAccessKeyId=...
&ASINList.ASIN.1=4900000001
&ASINList.ASIN.2=4900000002
&ASINList.ASIN.3=4900000003




API一覧

Amazon 商品APIで用意されている各APIの説明です。

ListMatchingProducts

Description
    商品検索のAPI
    条件を指定して、一致する商品と属性のリストを関連性の高い順に取得する
    最大10アイテムの情報が返る。
 
Args
    MarketplaceId
    Query
    QueryContextId
 
Rerurn
    Product
    Identifiers
    AttributeSets
    Relationships
    SalesRankings





GetMatchingProduct

Description
    ASIN指定(複数可)で、商品の情報を最高で10件取得する
 
Args
    MarketplaceId
    ASINList
 
Rerurn
    ListMatchingProductsと同じ





GetMatchingProductForId

Description
    商品ID(ASIN,SellerSKU,UPC,EAN,ISBN,JAN)指定で、商品の情報を取得する
 
Args
    MarketplaceId
    IdType
    IdList
 
Rerurn
    ListMatchingProductsと同じ






GetCompetitivePricingForSKU

Description
    SellerSKUと、MarketplaceIdを指定して、同一商品を出品している競合他社の価格情報を取得する
    MarketplaceIdは、クエリを投げた自分のIDのみが指定可能(?)
 
Args
    MarketplaceId
    SellerSKUList
 
Rerurn
    Product
    Identifiers
    CompetitivePricing
    SalesRankings






GetLowestOfferListingsForSKU

Description
    SellerSKU指定で商品のコンディションごとの最低価格情報を取得する
 
Args
    MarketplaceId
    SellerSKUList
    ItemCondition
    ExcludeMe
 
Rerurn
    AllOfferListingsConsidered
    Product
    Identifiers






GetLowestOfferListingsForASIN

Description
    ASIN指定で商品のコンディションごとの最低価格情報を取得する
 
Args
    MarketplaceId
    ASINList
    ItemCondition
 
Rerurn
    GetLowestOfferListingsForSKUと同じ






GetMyPriceForSKU

Description
    SellerSKU指定で商品を自分が何円で出品しているかを取得する
 
Args
    MarketplaceId
    SellerSKUList
    ItemCondition
 
Rerurn
    Identifiers
    BuyingPrice
    RegularPrice
    FulfillmentChannel
    ItemCondition
    ItemSubCondition
    SellerId
    SellerSKU






GetMyPriceForASIN

Description
    ASIN指定で商品を自分が何円で出品しているかを取得する
 
Args
    MarketplaceId
    ASINList
    ItemCondition
 
Rerurn
    GetMyPriceForSKUと同じ





GetServiceStatus

Description
    MWS APIのサービス提供状況を取得する
 
Args
    なし
 
Rerurn
    省略







API実行例

以下は、GetLowestOfferListingsForASINのAPI実行結果例です。

リクエストURL

mws.amazonservices.jp/Products/2011-10-01
  ?AWSAccessKeyId  =xxxx
  &Action          =GetLowestOfferListingsForASIN
  &SellerId        =xxxx
  &SignatureVersion=2
  &Timestamp       =2012-08-19T07%3A57%3A14Z
  &Version         =2011-10-01
  &Signature       =xxxx
  &SignatureMethod =HmacSHA256
  &MarketplaceId   =xxxx
  &ASINList.ASIN.1 =4906638015



レスポンス

<?xml version="1.0"?>
<GetLowestOfferListingsForASINResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
<GetLowestOfferListingsForASINResult ASIN="4906638015" status="Success">
  <AllOfferListingsConsidered>false</AllOfferListingsConsidered>
  <Product xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01" 
            xmlns:ns2="http://mws.amazonservices.com/schema/Products/2011-10-01/default.xsd">
    <Identifiers>
      <MarketplaceASIN>
        <MarketplaceId>A1VC38T7YXB528</MarketplaceId>
        <ASIN>4906638015</ASIN>
      </MarketplaceASIN>
    </Identifiers>
    <LowestOfferListings>
      <LowestOfferListing>
        <Qualifiers>
          <ItemCondition>Used</ItemCondition>
          <ItemSubcondition>Good</ItemSubcondition>
          <FulfillmentChannel>Merchant</FulfillmentChannel>
          <ShipsDomestically>True</ShipsDomestically>
          <ShippingTime>
            <Max>0-2 days</Max>
          </ShippingTime>
          <SellerPositiveFeedbackRating>98-100%</SellerPositiveFeedbackRating>
        </Qualifiers>
        <NumberOfOfferListingsConsidered>3</NumberOfOfferListingsConsidered>
        <SellerFeedbackCount>497</SellerFeedbackCount>
        <Price>
          <LandedPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1448.00</Amount>
          </LandedPrice>
          <ListingPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1198.00</Amount>
          </ListingPrice>
          <Shipping>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>250.00</Amount>
          </Shipping>
        </Price>
        <MultipleOffersAtLowestPrice>False</MultipleOffersAtLowestPrice>
      </LowestOfferListing>
      <LowestOfferListing>
        <Qualifiers>
          <ItemCondition>Used</ItemCondition>
          <ItemSubcondition>Good</ItemSubcondition>
          <FulfillmentChannel>Merchant</FulfillmentChannel>
          <ShipsDomestically>True</ShipsDomestically>
          <ShippingTime>
            <Max>0-2 days</Max>
          </ShippingTime>
          <SellerPositiveFeedbackRating>95-97%</SellerPositiveFeedbackRating>
        </Qualifiers>
        <NumberOfOfferListingsConsidered>8</NumberOfOfferListingsConsidered>
        <SellerFeedbackCount>4411</SellerFeedbackCount>
        <Price>
          <LandedPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1449.00</Amount>
          </LandedPrice>
          <ListingPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1199.00</Amount>
          </ListingPrice>
          <Shipping>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>250.00</Amount>
          </Shipping>
        </Price>
        <MultipleOffersAtLowestPrice>False</MultipleOffersAtLowestPrice>
      </LowestOfferListing>
      <LowestOfferListing>
        <Qualifiers>
          <ItemCondition>Used</ItemCondition>
          <ItemSubcondition>Acceptable</ItemSubcondition>
          <FulfillmentChannel>Merchant</FulfillmentChannel>
          <ShipsDomestically>True</ShipsDomestically>
          <ShippingTime>
            <Max>0-2 days</Max>
          </ShippingTime>
          <SellerPositiveFeedbackRating>95-97%</SellerPositiveFeedbackRating>
        </Qualifiers>
        <NumberOfOfferListingsConsidered>1</NumberOfOfferListingsConsidered>
        <SellerFeedbackCount>190</SellerFeedbackCount>
        <Price>
          <LandedPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1450.00</Amount>
          </LandedPrice>
          <ListingPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1200.00</Amount>
          </ListingPrice>
          <Shipping>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>250.00</Amount>
          </Shipping>
        </Price>
        <MultipleOffersAtLowestPrice>False</MultipleOffersAtLowestPrice>
      </LowestOfferListing>
      <LowestOfferListing>
        <Qualifiers>
          <ItemCondition>Used</ItemCondition>
          <ItemSubcondition>Good</ItemSubcondition>
          <FulfillmentChannel>Amazon</FulfillmentChannel>
          <ShipsDomestically>True</ShipsDomestically>
          <ShippingTime>
            <Max>0-2 days</Max>
          </ShippingTime>
          <SellerPositiveFeedbackRating>90-94%</SellerPositiveFeedbackRating>
        </Qualifiers>
        <NumberOfOfferListingsConsidered>1</NumberOfOfferListingsConsidered>
        <SellerFeedbackCount>163</SellerFeedbackCount>
        <Price>
          <LandedPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1550.00</Amount>
          </LandedPrice>
          <ListingPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1550.00</Amount>
          </ListingPrice>
          <Shipping>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>0.00</Amount>
          </Shipping>
        </Price>
        <MultipleOffersAtLowestPrice>False</MultipleOffersAtLowestPrice>
      </LowestOfferListing>
      <LowestOfferListing>
        <Qualifiers>
          <ItemCondition>Used</ItemCondition>
          <ItemSubcondition>VeryGood</ItemSubcondition>
          <FulfillmentChannel>Merchant</FulfillmentChannel>
          <ShipsDomestically>True</ShipsDomestically>
          <ShippingTime>
            <Max>0-2 days</Max>
          </ShippingTime>
          <SellerPositiveFeedbackRating>Less than 70%</SellerPositiveFeedbackRating>
        </Qualifiers>
        <NumberOfOfferListingsConsidered>1</NumberOfOfferListingsConsidered>
        <SellerFeedbackCount>1</SellerFeedbackCount>
        <Price>
          <LandedPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1550.00</Amount>
          </LandedPrice>
          <ListingPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1300.00</Amount>
          </ListingPrice>
          <Shipping>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>250.00</Amount>
          </Shipping>
        </Price>
        <MultipleOffersAtLowestPrice>False</MultipleOffersAtLowestPrice>
      </LowestOfferListing>
      <LowestOfferListing>
        <Qualifiers>
          <ItemCondition>Used</ItemCondition>
          <ItemSubcondition>VeryGood</ItemSubcondition>
          <FulfillmentChannel>Merchant</FulfillmentChannel>
          <ShipsDomestically>True</ShipsDomestically>
          <ShippingTime>
            <Max>0-2 days</Max>
          </ShippingTime>
          <SellerPositiveFeedbackRating>95-97%</SellerPositiveFeedbackRating>
        </Qualifiers>
        <NumberOfOfferListingsConsidered>2</NumberOfOfferListingsConsidered>
        <SellerFeedbackCount>8242</SellerFeedbackCount>
        <Price>
          <LandedPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1573.00</Amount>
          </LandedPrice>
          <ListingPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1323.00</Amount>
          </ListingPrice>
          <Shipping>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>250.00</Amount>
          </Shipping>
        </Price>
        <MultipleOffersAtLowestPrice>True</MultipleOffersAtLowestPrice>
      </LowestOfferListing>
      <LowestOfferListing>
        <Qualifiers>
          <ItemCondition>Used</ItemCondition>
          <ItemSubcondition>Good</ItemSubcondition>
          <FulfillmentChannel>Merchant</FulfillmentChannel>
          <ShipsDomestically>Unknown</ShipsDomestically>
          <ShippingTime>
            <Max>0-2 days</Max>
          </ShippingTime>
          <SellerPositiveFeedbackRating>98-100%</SellerPositiveFeedbackRating>
        </Qualifiers>
        <NumberOfOfferListingsConsidered>2</NumberOfOfferListingsConsidered>
        <SellerFeedbackCount>1891</SellerFeedbackCount>
        <Price>
          <LandedPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1590.00</Amount>
          </LandedPrice>
          <ListingPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1340.00</Amount>
          </ListingPrice>
          <Shipping>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>250.00</Amount>
          </Shipping>
        </Price>
        <MultipleOffersAtLowestPrice>False</MultipleOffersAtLowestPrice>
      </LowestOfferListing>
      <LowestOfferListing>
        <Qualifiers>
          <ItemCondition>Used</ItemCondition>
          <ItemSubcondition>Acceptable</ItemSubcondition>
          <FulfillmentChannel>Merchant</FulfillmentChannel>
          <ShipsDomestically>Unknown</ShipsDomestically>
          <ShippingTime>
            <Max>0-2 days</Max>
          </ShippingTime>
          <SellerPositiveFeedbackRating>98-100%</SellerPositiveFeedbackRating>
        </Qualifiers>
        <NumberOfOfferListingsConsidered>1</NumberOfOfferListingsConsidered>
        <SellerFeedbackCount>1855</SellerFeedbackCount>
        <Price>
          <LandedPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1597.00</Amount>
          </LandedPrice>
          <ListingPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1347.00</Amount>
          </ListingPrice>
          <Shipping>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>250.00</Amount>
          </Shipping>
        </Price>
        <MultipleOffersAtLowestPrice>False</MultipleOffersAtLowestPrice>
      </LowestOfferListing>
      <LowestOfferListing>
        <Qualifiers>
          <ItemCondition>Used</ItemCondition>
          <ItemSubcondition>VeryGood</ItemSubcondition>
          <FulfillmentChannel>Amazon</FulfillmentChannel>
          <ShipsDomestically>True</ShipsDomestically>
          <ShippingTime>
            <Max>0-2 days</Max>
          </ShippingTime>
          <SellerPositiveFeedbackRating>95-97%</SellerPositiveFeedbackRating>
        </Qualifiers>
        <NumberOfOfferListingsConsidered>1</NumberOfOfferListingsConsidered>
        <SellerFeedbackCount>126</SellerFeedbackCount>
        <Price>
          <LandedPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1647.00</Amount>
          </LandedPrice>
          <ListingPrice>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>1647.00</Amount>
          </ListingPrice>
          <Shipping>
            <CurrencyCode>JPY</CurrencyCode>
            <Amount>0.00</Amount>
          </Shipping>
        </Price>
        <MultipleOffersAtLowestPrice>False</MultipleOffersAtLowestPrice>
      </LowestOfferListing>
    </LowestOfferListings>
  </Product>
</GetLowestOfferListingsForASINResult>
<ResponseMetadata>
  <RequestId>xxxx</RequestId>
</ResponseMetadata>
</GetLowestOfferListingsForASINResponse>




レスポンスが長いので見づらいですが、良く確認してみるとProduct.LowestOfferListings.LowestOfferListingノード以下に、以下のような出品情報がセットされていることが分かります。

LowestOfferListing.Qualifiers.ItemCondition         Used
LowestOfferListing.Qualifiers.ItemSubcondition      Good
LowestOfferListing.Qualifiers.FulfillmentChannel    Merchant
LowestOfferListing.Qualifiers.ShipsDomestically     True
LowestOfferListing.Qualifiers.ShippingTime.Max      0-2 days
LowestOfferListing.NumberOfOfferListingsConsidered  3
LowestOfferListing.SellerFeedbackCount              497
LowestOfferListing.Price.LandedPrice.CurrencyCode   JPY
LowestOfferListing.Price.LandedPrice.Amount         1448.00
LowestOfferListing.Price.ListingPrice.CurrencyCode  JPY
LowestOfferListing.Price.ListingPrice.Amount        1198.00
LowestOfferListing.Price.Shipping.CurrencyCode      JPY
LowestOfferListing.Price.Shipping.Amount            250.00
LowestOfferListing.MultipleOffersAtLowestPrice      False



他のAPI呼び出し結果は、こちらの記事を参照してください。
Amazon MWS商品APIの実行結果例

サンプルプログラム

本APIを使用した、C#とPHPのサンプルプログラムを作成しました。
実際にプログラムを書いてみたい人は、参考にしてください。
C#でAmazonのMWSを使用して,マケプレの出品情報を取得する
PHPでAmazonのMWSを使用して,マケプレの出品情報を取得する

C#の記事のほうではDLLも用意しているので、DLLの読み込みが出来れば他の言語でも同様に作業できるかと思います。

リンク集

Amazonから提供されているドキュメントです。

Amazon マーケットプレイスWeb サービス 商品API セクションリファレンス
Amazon MWS Scratchpad
APIリファレンス
Product Advertising APIから商品 APIセクションへの移行ガイド

関連記事

コメントを残す

メールアドレスが公開されることはありません。