Entries
ここのサイトはほぼ画像のレスポンスだけで
構成されるので、Images Response Groupの詳細について記載してます。
The Images response group returns the URLs to all available images of an item in three sizes: small, medium, and large. For example, if a blender is for sale and there are four images of it, this response group returns the URLs of twelve images: four images, each in three sizes.
画像のURLを返しますとさ。small, medium, largeの3種類。4枚画像あったら、12種類あるわけさ。
In addition to returning the URLs of the images, the response groups also returns the height and width dimensions of each image. Use these values to help you display the images correctly.
URLのほかにも、画像のheightとwidthを返すから、しっかり使えばしっかり表示されるっちゃ。
ふーん。
The images returned are associated with the merchant selling the item. For that reason, you must specify the merchant ID in the request when you use the Images response group. MerchantId, however, defaults to "Amazon." So, if the item is being sold by Amazon, specifying a MerchantId is not required. If you do not specify a MerchantId and a merchant other than Amazon is selling the item, ECS will not return images.
associatedタグついてっから、大丈夫さ。
へぇ。
<SearchIndex>
<IndexName>DVD</IndexName>
<Results>7</Results>
<Pages>3</Pages>
<RelevanceRank>2</RelevanceRank>
<ASIN>B00005TNFV</ASIN>
<ASIN>B0002NRRBA</ASIN>
<ASIN>B000A2XB9U</ASIN>
</SearchIndex>
<Item>
<ASIN>B00005TNFV</ASIN>
<SmallImage>
<URL>http://ec1.images-amazon.com/images/P/B00005TNFV.01._SCTHUMBZZZ_.jpg</URL>
<Height Units="pixels">60</Height>
<Width Units="pixels">43</Width>
</SmallImage>
<MediumImage>
<URL>http://ec1.images-amazon.com/images/P/B00005TNFV.01._SCMZZZZZZZ_.jpg</URL>
<Height Units="pixels">140</Height>
<Width Units="pixels">99</Width>
</MediumImage>
<LargeImage>
<URL>http://ec1.images-amazon.com/images/P/B00005TNFV.01._SCLZZZZZZZ_.jpg</URL>
<Height Units="pixels">475</Height>
<Width Units="pixels">336</Width>
</LargeImage>
<ImageSets>
<ImageSet Category="primary">
<SmallImage>
<URL>http://ec1.images-amazon.com/images/P/B00005TNFV.01._SCTHUMBZZZ_.jpg</URL>
<Height Units="pixels">60</Height>
<Width Units="pixels">43</Width>
</SmallImage>
aws:LargeImage/aws:URL、aws:ItemAttributes/aws:Title、aws:DetailPageURL
このあたりを利用して、画像のリンクを生成してあげれば、
終わりです。
サンプルのxslは←のジャケット検索にあります。
ページ遷移はとりあえず、
<xsl:if test="$i <= 400">
にしとけばOK!
AWS.RestrictedParameterValueCombinationリクエストには、使用できないパラメータの組み合わせが含まれています。SearchIndexがBlendedである場合、 Sortは使えません。
使えないなら、使わないようにすればいいだけのこと。
さぁ、、あ、あああぁ?
The Operation parameter is invalid. Please modify the Operation parameter and retry. Valid values for the Operation parameter include TagLookup, ListLookup, CartGet, SellerListingLookup, CustomerContentLookup, ItemLookup, SimilarityLookup, SellerLookup, ItemSearch, VehiclePartLookup, BrowseNodeLookup, CartModify, ListSearch, CartClear, VehiclePartSearch, CustomerContentSearch, CartCreate, TransactionLookup, VehicleSearch, SellerListingSearch, CartAdd, Help.
パラーメータ間違ったな・・・。
まずはパラメータの取得から。
<xsl:variable name="sortparam" select="aws:Items/aws:Request/aws:ItemSearchRequest/aws:Sort" />
次に、プルダウンを生成。
<select name="sortValue">
<option value="0">--ならび替え--</option>
<option value="1" selected="true">発売日が新しい順</option>
<option value="2">発売日が古い順</option>
<option value="3">人気順</option>
<option value="4">タイトル順</option>
</select>
xslで置き換え。
<select>
<xsl:attribute name="name">sortValue</xsl:attribute>
<option>
<xsl:attribute name="value">0</xsl:attribute>
<xsl:if test="$sortparam=''"><xsl:attribute name="selected">true</xsl:attribute></xsl:if>
--ならび替え--
</option>
<option>
<xsl:attribute name="value">1</xsl:attribute>
<xsl:if test="$sortparam='-releasedate'"><xsl:attribute name="selected">true</xsl:attribute></xsl:if>
発売日が新しい順
</option>
<option>
<xsl:attribute name="value">2</xsl:attribute>
<xsl:if test="$sortparam='releasedate'"><xsl:attribute name="selected">true</xsl:attribute></xsl:if>
発売日が古い順
</option>
<option>
<xsl:attribute name="value">3</xsl:attribute>
<xsl:if test="$sortparam='salesrank'"><xsl:attribute name="selected">true</xsl:attribute></xsl:if>
人気順
</option>
<option>
<xsl:attribute name="value">4</xsl:attribute>
<xsl:if test="$sortparam='titlerank'"><xsl:attribute name="selected">true</xsl:attribute></xsl:if>
タイトル順
</option>
</select>
DVDだけならこれだけど、ジャンルによって変えなきゃイケナイ。。面倒だな。
あと、DVDのソート順は
salesrank Bestselling
pricerank Price: low to high
-pricerank Price: high to low
price Price: low to high
-price Price: high to low
titlerank Alphabetical: A to Z
-titlerank Alphabetical: Z to A
-orig-rel-date Release date: newer to older
orig-rel-date Release date: older to newer
releasedate Release date: older to newer
-releasedate Release date: newer to older
これだけある。
とりあえず、4パターンでやってみる。
続きは↓のECSカテゴリで!!!
サンプルは←のジャケット検索で!!!
もちろんxslもあります!!!
<公式開発者ガイドはこちら
Amazon E-Commerce Service Developer Guide (API Version 2007-07-16)
ガイドがどこにあるのか検索してもなかなか見つかりませんでした。。
RESTではsortする場合は検索するカテゴリ(SearchIndex)によってvalue値を変えなければならないという仕様です。。やってられません。
Javascriptで対応ですね。
ソートパラメータ一覧
<script type="text/javascript">
<!--
function func1() {
var i;
if (!document.sortform.issort.checked) {
document.amazon.submit();
return;
}
for (i = 0; i < document.amazon.SearchIndex.length; i++) {
if (document.amazon.SearchIndex[i].checked) {
if (document.amazon.SearchIndex[i].value == 'Books') {
document.amazon.Sort.value = 'daterank';
} else if (document.amazon.SearchIndex[i].value == 'DVD') {
document.amazon.Sort.value = '-releasedate';
} else if (document.amazon.SearchIndex[i].value == 'Toys') {
document.amazon.Sort.value = '-release-date';
} else if (document.amazon.SearchIndex[i].value == 'Music') {
document.amazon.Sort.value = '-releasedate';
} else if (document.amazon.SearchIndex[i].value == 'VideoGames') {
document.amazon.Sort.value = '-release-date';
} else if (document.amazon.SearchIndex[i].value == 'Software') {
document.amazon.Sort.value = '-release-date';
}
}
}
document.amazon.submit();
}
// -->
</script>
新着順に並べるだけでこれだけ。アホか・・・。
どんな仕様なんだよ。
ジャンルが増えているので早くまとめてほしいですね。
もっと細分化されたら困りますが。。。
SEO対策サイトより、学ぶことが多いです。
一般的なものがほとんどですが、忘れることのないようにしておきましょう。
タイトルに関する問題: ページ タイトルがない、重複しているなど、ページの title タグに関する潜在的な問題です。
description メタ タグに関する問題: 重複しているなど、descriptions メタ タグに関する潜在的な問題です。
インデックス登録できないコンテンツ: Flash ファイル、動画、画像など、インデックスに登録できないコンテンツを含むページです。
各ページ一律同じdescriptionにしていたらエラーでまくり(´・ω・`)
SEO対策としてもdescriptionはしっかり動的に要約してあげないと駄目です。長いメタデータや短いメタデータもだめ。
同じだったときのエラーメッセージ。
Google 検索結果ページでのサイトの掲載順位に悪影響を与える可能性のある問題をいくつか検出しました。
これらの問題が原因で、サイトのクロールやインデックス登録が行われなくなるわけではありませんが、問題を解決することで、
検索結果でのサイトの掲載順位が向上したり、サイトへのリンクをクリックするユーザーが増加する可能性が高まります。
2. Googlebot のクロール情報 を見てみましょう。
これらの統計情報は、Googlebot がサイトをどのようにクロールしているかを示しています。 リストされているキーワードやフレーズは、サイトへのリンクのアンカー テキストです。 この情報により、他のサイトが自分のサイトをどのように理解しているかを把握できます。 Googleではアンカー テキストをサイトに関する追加情報として使用するため、アンカー テキストが説明的または有益でない場合 (「ここをクリック」というリンクのテキストは有益なデータとはなりません)、サイト運営者と連携して変更することもお勧めします。
・わかりやすい階層とテキスト リンクを持つサイト構造にする。 各ページには、少なくとも 1 つの静的なテキスト リンクからアクセスできるようにします。
・サイトの主要なページへのリンクを記載したサイトマップを用意する。 サイトマップ内にリンクが 100 以上ある場合は、サイトマップを複数のページに分けます。
・情報量が豊富で便利なサイトを作成し、コンテンツをわかりやすく正確に記述する。
・ユーザーがサイトを探すときに入力する可能性の高いキーワードをサイトに含める。
・重要な名前、コンテンツ、またはリンクを表示するときは、画像の代わりにテキストを使用する。 Google のクローラでは、画像に含まれたテキストは認識されません。
・TITLE タグと ALT 属性の説明をわかりやすく正確なものにする。
・無効なリンクがないかどうか確認し、HTML を修正する。
・動的なページ (URL に "?" が含まれているページなど) を使用する場合、検索エンジンのスパイダーによっては、静的なページと同じようにはクロールされない場合があることを考慮する。 パラメータを短くしたり、数を少なくすると、クローラで見つけやすくなります。
・ページのリンクの数を適切な数に抑える (100 未満)。
・検索エンジンではなく、ユーザーの利便性を考慮してページを作成する。 ユーザーを騙すようなコンテンツや、「クローキング」を行って検索エンジン用とは異なるコンテンツを表示しないでください。
・検索エンジンでの掲載位置を上げるための不正行為を行わない。 ユーザーや、ランクを競っているサイトに対して自分が行った対策を明確に説明できるかを判断の目安としてください。 その他にも、ユーザーにとって役立つかどうか、 検索エンジンがなくても同じことをするかどうか、などのポイントを確認してみてください。
・サイトの順位や PageRank を上げるように設計されたリンク プログラムに参加しない。 特にウェブ スパマーや不正なウェブサイトへのリンクは行わないでください。これらのリンクにより、サイトのランクが下がることがあります。
・プログラムの送信や掲載順位の確認に不正なコンピュータ プログラムを使用しない。このようなプログラムはリソースを消費し、Google の利用規約に違反します。 Google は、自動化またはプログラム化されたクエリを Google に送信する WebPosition Gold? のような製品の使用は推奨していません。
3. サイトマップ
ほとんどのサイトでは、すべてのページがインデックスに登録されるわけではありません。
Google がサイトをクロールしてインデックスに登録する方法を改善する。
ブログ側で自動生成できますので、そのURLを指定しておきましょう。
リンク一覧と更新日付が一覧化されるので、クロールしやすくなるはずです。
4. 上位の検索クエリ
上位の検索クエリには、サイトが表示された上位 20 個の検索クエリが表示されます。クリックにつながった上位のクエリには、サイトのリンクを実際にクリックしたユーザーの検索クエリが表示されます。
通常、上位の検索クエリには、サイトの掲載順位が高いキーワードが表示され、クリックにつながった上位のクエリには、サイトの価値が高いと判断したユーザーが使用した検索クエリが表示されます。 上位の検索クエリに予想したキーワードが表示されていない場合、コンテンツを見直し、関連性を高める必要があります。 また、robots.txt を確認して、インデックスに登録するページを Googlebot のクロールから誤ってブロックしていないか確認することもお勧めします。 関連性の高い検索クエリが上位の検索クエリに表示されているが、クリックにつながった上位のクエリには表示されていない場合、サイトが検索結果に表示されたときにユーザーがクリックするよう、サイトを改善する必要があります。 検索結果にはページのタイトルが表示されるため、タイトルは関連性が高く、正確なものにします。 Google はページのメタタグの説明にあるテキストを取得して検索結果に表示するため、メタタグにページのコンテンツの有益な説明が含めるよう見直します。
SEO対策する場合には見逃せない項目です。
Amazonの公式APIリファレンスはこちら
htmlとxslを無料サーバにおくだけで、動的なサイトが作れちゃいます。
画像を取得するくらいならこれくらいのパラメータだけで大丈夫。
| Parameter | Definition | 必須? | Valid Values |
|---|---|---|---|
AssociateTag |
An alphanumeric token that uniquely identifies an Associate. This token is the means by which Amazon identifies the Associate to credit for a sale.
If a request is made without identifying an Associate, Associate fees are not paid by Amazon.
If the AssociateTag is included in the CartCreate request, the value for AssociateTag is automatically included in the PurchaseURL,
which is returned by CartCreate.
To obtain an Associate Tag, go to http://aws.amazon.com.
For more information, see Associate Tag.アソシエイトを識別する英数字のトークンです。このトークンは、アマゾンの売り上げを関連付けます。 requestした場合にAssociateTagがないとアマゾンアソシエイトの手数料が支払われません。(´・ω・`) AssociateTagは商品のリンクを生成すると、自動的に付与されます。 AssociateTagを取得するにはhttp://aws.amazon.comにレッツゴー。詳細については、Associate Tagを参照してください。 |
No |
An alphanumeric token distributed by Amazon that uniquely identifies an Associate. Use this value in all requests to receive credit for the customer's purchase. アソシエイト識別するAmazonから発行される英数字のトークン。この値をrequestに付与すれば購入情報が分かります。 |
AWSAccessKeyId |
An alphanumeric token that uniquely identifies a seller. To get an AWSAccessKeyId, go to http://aws.amazon.com.. アソシエイトユーザを識別する英数字のトークン。 AWSAccessKeyIdを取得するためには、http://aws.amazon.comに。 |
Yes | Access Key ID distributed by Amazon |
ContentType |
Specifies the format of the content in the response. Generally,
ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.
For example, to transform your ECS response into HTML, set ContentType to text/html.
See Style. responseのフォーマットです。responseをECSのHTMLに変換する場合はContentTypeの設定をtext/htmlに変更します。 |
No | text/xml (Default) text/html |
MerchantId |
An alphanumeric token distributed by Amazon that uniquely identifies a merchant. The value can be:
アマゾンで配信される英数字のトークンを識別する商人です。値には、 : すべてのですか?すべての商店で販売されるアイテムの応答に含まれています。 特定商ですか、特定のマーチャントIDです。アマゾンのマーチャントIDを配布ベンダーです。 アマゾン(デフォルト)ですか?アマゾンとは、特定の商品IDです。アウトを別々に呼ばれることはなぜならこれは、デフォルトのパラメータの値です。これは、指定されていないときに身分証明書を要求するマーチャントは、アマゾンで販売されるアイテムのみが返されます。リクエストの検索結果を返す場合には、 merchantidの値を変更してみてください"すべて"です。 featuredbuyboxmerchant ?マーチャント勝者として識別さの箱を購入、これは、ベンダーに関連付けられて載っているアイテムを購入するアイテムの詳細ページのボックスをオンにします。箱の購入が含まれ、デフォルトの詳細ページにあるアイテムを販売して顧客から購入するときにカートに追加]ボタンをクリックしてください。 | No |
All Amazon (Default) BoxMerchant FeaturedBuyBox Specific Merchant ID |
Operation |
Specifies the ECS operation to execute. ECS実行時の操作を指定します。 |
Yes | An ECS operation, for example, ItemLookup |
Service |
Specifies the ECS service. There is only one value for all ECS operations. AWSECommerceServiceを指定します。 |
Yes | AWSECommerceService |
Style |
Controls the format of the data returned in ECS responses. Style only pertains to REST requests.
Set this parameter to "XML," the default, to generate a pure XML response. Set this parameter to the URL of an XSLT stylesheet to have ECS transform the XML response.
See ContentType. responseデータのフォーマットを制御する。StyleはRESTのrequestでのみ有効です。 XMLを指定すると、単純なレスポンスを生成します。XSLTスタイルシートを指定すると、ECSのresponseを変換してくれます。 ContentTypeの指定もお忘れなく。 |
No |
XML (Default) URL of an XSLT stylesheet. |
Validate |
Prevents an operation from executing. Set the Validate parameter to True to test your request without actually executing it.
When present, Validate must equal True; the default value is False. If a request is not actually executed (Validate=True),
only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request. 実行する操作を防ぐからです。このパラメータをtrueに設定してテストを検証することなく実際にお客様のリクエストを実行することです。プレゼントする際は、真の平等を検証する必要があります;のデフォルト値はfalseです。実際にリクエストを実行する場合ではない(検証=真)は、エラーのサブセットのみを要求するため、いくつかのエラーが返されることが(例えば、 no_exact_matches )は、リクエストの実行中に生成されます。 | No | False (Default) True |
Version
| The version of the ECS software and WSDL to use. By default, the 2005-10-05 version is used. Alternately, specify a software version, such as 2006-02-15. For a list of valid version numbers, refer to the ECS Release Notes. Note that the latest version of ECS is not used by default. このバージョンのソフトウェアとなるECS wsdlを使用する。デフォルトでは、 2005-10-05バージョンが使用されています。交互には、ソフトウェアのバージョンを指定するなど、 2006年2月15日です。有効なバージョン番号のリストのため、なるECSリリースノートを参照してください。注意して、最新バージョンのECSは、デフォルトで使用されていない。 | No | Valid WSDL version date, for example, 2006-02-15. The default is 2005-10-05. |
XMLEscaping
| Specifies whether responses are XML-encoded in a single pass or a double pass. By default, XMLEscaping is Single, and ECS responses are encoded only once in XML. For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&). If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&). The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements. XMLのエンコードを指定するかどうかの回答は、 1つのパスまたは二重に合格した。デフォルトでは、 1つのxmlescapingは、 1回のみとなるECSの対応は、 XMLでエンコードされます。たとえば、応答データが含まれている場合は、アンパサンド( & )は、定期的には、 XMLの文字エンコーディングが返される( & ) 。 xmlescaping場合には、二重のは、同じ文字がアンパサンド( & )を2回XMLで符号化されます。 xmlescaping値は、二重に役立ついくつかのクライアントでは、 PHPのような、テキスト内でデコードしていないXML要素です。 | No | Single (Default) Double |
サンプル。
<form name="amazon" method="GET" action="http://webservices.amazon.co.jp/onca/xml?">
<input type="hidden" name="Service" value="AWSECommerceService">
<input type="hidden" name="AWSAccessKeyId" value="[yourAWSAccessKeyId]">
<input type="hidden" name="AssociateTag" value="[yourAssociateTag]">
<input type="hidden" name="Version" value="2005-10-05">
<input type="hidden" name="ResponseGroup" value="Small,Request,ItemAttributes,OfferFull,Images">
<input type="hidden" name="Operation" value="ItemSearch">
<input type="hidden" name="Style" value="http://example.com/amazon.xsl">
<input type="hidden" name="ContentType" value="text/html">
<input type="hidden" name="ItemPage" value="1">
<input type="hidden" name="SearchIndex" value="Blended">
<input type="text" name="Keywords" style="width:300px;" value="">
ECS Response Groupsはこれだけ。
Accessories
AlternateVersions
BrowseNodeInfo
BrowseNodes
Cart
CartNewReleases
CartTopSellers
CartSimilarities
Collections
CustomerFull
CustomerInfo
CustomerLists
CustomerReviews
EditorialReview
Help
Images
ItemAttributes
ItemIds
Large
ListFull
ListInfo
ListItems
ListmaniaLists
ListMinimum
Medium
MerchantItemAttributes
NewReleases
OfferFull
OfferListings
Offers
OfferSummary
PromotionDetails
PromotionSummary
Request
Reviews
SalesRank
SearchBins
Seller
SellerListing
Similarities
Small
Subjects
TaggedGuides
TaggedItems
TaggedListmaniaLists
Tags
TagsSummary
TopSellers
Tracks
TransactionDetails
VariationMinimum
Variations
VariationImages
VariationMatrix
VariationOffers
VariationSummary
Amazon Web サービス(AWS)はソフトウェア開発者向けのサービスで、Amazonが保持しているテクノロジー・プラットフォームと商品データに直接アクセスする仕組みを提供します。ソフトウェアの開発者やWebサイトのオーナーであれば、Amazon WebサービスファミリーのひとつであるAmazon E-Commerce Service(ECS)を利用することで、Amazonの商品データとEコマースに関わるさまざまな機能を活用して商品カタログにアクセスし、Amazon.co.jp のショッピングカートに商品を追加し、さらにはチェックアウトの手順を開始することもできるようになります。Amazon.co.jp のアソシエイトメンバーにとっては、タイムリーで正確な価格と発送可能時期の情報を含む、商品カタログのさまざまなデータを利用して、リッチなコンテンツを提供する効率のいいWebサイトを構築できることを意味します。