NAME

WebService::YTSearch - Search YouTube

VERSION

version 0.0401

SYNOPSIS

use WebService::YTSearch;

my $w = WebService::YTSearch->new( key => '1234567890abcdefghij' );

my $r = $w->search( q => 'foo', maxResults => 10 );
print Dumper $r;

DESCRIPTION

WebService::YTSearch searches YouTube with your API key.

ATTRIBUTES

key

Your authorized access key.

base

The base URL.

Default: https://www.googleapis.com

ua

The user agent.

Default: Mojo::UserAgent->new

METHODS

new

$w = WebService::YTSearch->new(key => $key);

Create a new WebService::YTSearch object given your API key.

$r = $w->search(%arguments);

Fetch the results given the arguments.

To provide a command other than search, use the cmd argument. For example:

$r = $w->search(%arguments, cmd => 'commentThreads', videoId => 'abc123xyz');

For all the accepted arguments, please see the YouTube reference linked below.

SEE ALSO

The examples in the eg/ directory.

The tests in t/01-methods.t

https://developers.google.com/youtube/v3/docs/search/list

Mojo::JSON

Mojo::URL

Mojo::UserAgent

Moo

Try::Tiny

AUTHOR

Gene Boggs <gene@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021-2025 by Gene Boggs.

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