Amazon APIでジャンルをALLにして検索する時は、キーワード検索しかできません。 PHPを使って複数キーワードによるAND/NOT検索をしようとしたら色々つまずいたので、調べてみた。 Amazonに投げるリクエストはこんな感じ(前後に付ける署名等はとりあえず省略)。 http://ecs.amazonaws.jp/onca/xml?…&Keywords=カポーティ クリスマス&… この「カポーティ クリスマス」という日本語文字列を普通にURLエンコードすれば良いのかと思ったら、ちょっと違うっぽい。 公式によれば以下の通り。 B) パラメータ名と値を、以下のルールに従ってURLエンコードします。 ・RFC3986で規定された非予約文字はURLエンコードしてはいけません。非予約文字とは、A-Z, a-z, 09-, ハイフン(-)、アンダーバー(_)、ピリオド(.)およびチルダ