-
Notifications
You must be signed in to change notification settings - Fork 0
Item Lookup
bonsaiben edited this page Jun 22, 2012
·
2 revisions
Rakuten Market Item Code Search (here, Item Lookup) API
Rakumarket.item_lookup "act-corp:10000670"
# => returns the item with the code "act-corp:10000670"
Rakumarket.item_lookup "act-corp:10000670", :mobile => true
# => returns response for mobile devices
:affiliate_id => 'affiliate_id'
:call_back => 'call_back'
:mobile => false|true
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槽式", "洗濯機関連用品", "その他"]