WebService::Blekko - access the Blekko JSON APIs


 use WebService::Blekko;

 my $blekko = WebService::Blekko->new( auth => 'webservice-blekko-example', );

 $res = $blekko->query( "obama /date" );

 if ( $res->error ) { ... }

 while ( my $r = $res->next ) {
    print $r->url, $r->title; # etc.


 This API wraps the Blekko search engine API(s). You can query for results,
 manipulate slashtags, get tool-bar-useful information, and so forth.

 For the Terms and Conditions for using Blekko data, please see

 To get an API Auth key, please contact


new( %opts )

Options include

 server => server to talk to, defaults to
 auth => api auth key, gotten by contacting
 source => the name of your program/service
 page_size => number of results to return, default 20, max of 100
 scheme => http, defaults to https if available
 qps => API calls per second, defaults to 1. Do not make this greater than 1 without asking.
 agent => the user-agent to be used by LWP::UserAgent. Defaults to the package name_version.

 cookie_jar_file => cookie jar file to use, see LWP::UserAgent
 cookie_jar => cookie jar object to use, see LWP::UserAgent

Additional options are passed to LWP::UserAgent.

query( query_string, %opts )

Queries the server, and returns a WebService::Blekko::QueryResultSet.

Options include page_size (see above) and p, to get the pth page of results, counting from zero.

pagestats( url )

Returns information about a webpage, suitable for toolbar use. Returns a WebService::Blekko::Pagestats object, with methods host_inlinks, host_rank, etc.

login( username, password )

Logs into blekko, which is needed before you create/add to/delete slashtags. Requires a cookie jar file or object to work.

Returns WebService::Blekko::Result, which has methods error, result, and http_code. Check error before using result.


Logs out of blekko. Does not throw an error if you are already logged out.


Returns the username of the currently logged-in user. Useful in toolbars, where the user logs directly into blekko.

create_slashtag( $slashtag, \@urls, $description )

Creates a slashtag.

add_urls( $slashtag, \@urls )

Adds urls to an existing slashtag.

list_urls( $slashtag )

Returns an arrayref of the urls in the slashtag

delete_urls( $slashtag, \@urls )

Deletes urls in a slashtag.

remove_slashtag( $slashtag )

Removes a slashtag.


 L<WebService::Yahoo::BOSS>, L<Google::Search>


"Greg Lindahl", <>

Thanks to Fred Moyer for commenting on the interfaces.


Copyright (C) 2011 by blekko, inc.

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