0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AmazonのSDKでASINからJANを取得する方法

Posted at

ASINからJANは取得できないかと思っていたが、どうやらできる模様

amazon-php-sdk/src/com/amazon/paapi5/v1/GetItemsResource.php

の49行目にある

const ITEM_INFOEXTERNAL_IDS = 'ItemInfo.ExternalIds';

が外部のIDを取得するResourceのようだ

$resourcesにITEM_INFOEXTERNAL_IDSを追加して

$resources = [
GetItemsResource::ITEM_INFOTITLE,
GetItemsResource::ITEM_INFOEXTERNAL_IDS];

のように(どこでも良いが一番下に追加)する

リクエストした結果から

$jan = $item->getItemInfo()->getexternalIds()->geteANs()->getdisplayValues()[0];

JANを取得できました

めでたしめでたし

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?