The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


WWW::NicoVideo - Perl interface to Nico Nico Video service


  use utf8;
  use WWW::NicoVideo;
  binmode STDOUT, ":encoding(euc-jp)";

  my $nv = new WWW::NicoVideo(mail => '',
                              passwd => "ritchan-wa-kawaiidesuyo");
  $nv->login or die "Login failed";

  my @entries = $nv->getEntriesByTagNames("律子ソロ") or die "get failed";
  foreach my $e (@entries) {
    print $e->title, "\n";


This module allows you to get information from Nico Nico Video service ( and also allows you to search from it.


$nv = new WWW::NicoVideo(%OPTS)

Constructs a new WWW::NicoVideo object and returns it. Key/value pair options may be provided to set the default value. Following options are accepted:

agent / cookies

LWP::UserAgent / HTTP::Cookies object.

retry / retryInterval

Retry count / retry interval in second. As Nico Nico Video rejects mass access, you have to give appropriate interval between accesses.

mail / passwd

Mail address / password to access Nico Nico Video.

All options except "cookies" can be accessed via accessor methods. (e.g. $nv->agent) You may access cookies via "agent". (e.g. $nv->agent->cookie_jar)


Login to Nico Nico Video. You have to call this method before calling getEntries* methods;

$nv->getEntriesByTagNames(%OPTS) / $nv->getEntriesByKeywords(%OPTS)

Returns entry list for given tag name(s) / keyword(s). In scalar context, this method returns a reference to array of WWW::NicoVideo::Entry or undef on errors. In list context, this method returns list of WWW::NicoVideo::Entry or null list on errors. Following options are accepted:

key / keys

Tagname(s) or keyword(s). "key" takes a scalar value, "keys" takes a reference to array.


Page number.


Sort type. "f" for post date, "v" for number of views, "r" for number of comments, undef for last comment date.


Sort order. "a" for ASC, "d" or undef for DESC.


perl(1), Web::Scraper, WWW::NicoVideo::Entry


HIRATA Yasuyuki, <>


This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.


The latest version of this module is available from our Subversion repository at: