Skip to content
bonsaiben edited this page Jun 22, 2012 · 2 revisions

Rakuten Market Item Code Search (here, Item Lookup) API

Basic Request

Rakumarket.item_lookup "act-corp:10000670"
# => returns the item with the code "act-corp:10000670"

Request with Options

Rakumarket.item_lookup "act-corp:10000670", :mobile => true
# => returns response for mobile devices

Available Options

affiliate_id

:affiliate_id => 'affiliate_id'

call_back

:call_back => 'call_back'

mobile

:mobile => false|true

Response

The returned response is a Hashie::Mash, a hash with method-like accessors for hash keys.

$ response = Rakumarket.genre_search 204491
$ response.keys
=> ["current", "parent", "children"]

$ response.current
=> #<Hashie::Mash genre_id=204491 genre_level=3 genre_name="洗濯機">

$ response.current.genre_name
=> "洗濯機"

$ response.children.size
=> 6

$ response.children.map(&:genre_name)
=> ["ドラム式", "全自動(乾燥機能あり)", "全自動(乾燥機能なし)", "2槽式", "洗濯機関連用品", "その他"]