Hideaki Tanaka
and 1 contributors

NAME

WebService::Rakuten - A Perl interface to the Rakuten WebService API

SYNOPSIS

  use WebService::Rakuten;

  my $api = WebService::Rakuten->new(
      dev_id => 'YOUR DEVELOPER ID',
      aff_id => 'YOUR AFFILIATE ID',
  );

  # Item Search
  my $rs = $api->item_search(
      'Wii',
      {
          shopCode => 'xyz',
          hits     => 30,
          page     => 1,
          sort     => '-itemPrice',
      }
  );

  if ($res->status eq 'Success') {
      for (@{ $rs->items }) {
          print $_->itemName;
          print $_->itemCode;
          print $_->itemPrice;
          print $_->itemCaption;
          print $_->itemUrl;
          print $_->affiliateUrl;
          print $_->smallImageUrl;
          print $_->mediumImageUrl;
          print $_->availability;
          print $_->taxFlag;
          print $_->postageFlag;
          print $_->creditCardFlag;
          print $_->shopOfTheYearFlag;
          print $_->affiliateRate;
          print $_->startTime;
          print $_->endTime;
          print $_->reviewCount;
          print $_->reviewAverage;
          print $_->shopName;
          print $_->shopCode;
          print $_->shopUrl;
          print $_->genreId;
      }
  }

  # Genre Search
  $rs = $api->genre_search(
      0,
      { genrePath => 0 }
  );

  if ($res->status eq 'Success') {
      for (@{ $rs->childs }) {
          print $_->genreId;
          print $_->genreName;
          print $_->genreLavel;
      }
  }

DESCRIPTION

WebService::Rakuten is a simple Perl interface to the Rakuten WebService API.

Rakuten Ichiba is the biggest online shopping mall in Japan. For details, see http://www.rakuten.co.jp/.

FUNCTIONS

new(dev_id => 'Developer ID', aff_id => 'Affiliate ID')

Returns an instance of this module. You must create an instace before searching.

Developer ID required. If you have Affiliate ID, you can set affiliate link to products.

item_search($keyword, \%options)

Returns search results. Results is a WebService::Rakuten::ItemResult object. It's contains status, pager and WebService::Rakuten::Item objects.

genre_search($genre_id, \%options)

Returns genre search results. It's contains status and genre objects (parent/current/child).

SEE ALSO

  • http://webservice.rakuten.co.jp/

AUTHOR

Hideaki Tanaka <tanakahda@gmail.com>

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.