NAME

Net::Async::WebSearch::Provider::Google - Google Programmable Search (CSE) JSON API provider

VERSION

version 0.002

SYNOPSIS

my $g = Net::Async::WebSearch::Provider::Google->new(
  api_key => $ENV{GOOGLE_API_KEY},
  cx      => $ENV{GOOGLE_CSE_ID},
);

DESCRIPTION

Provider for Google Programmable Search (Custom Search Engine) JSON API. Returns the items array, capped at 10 per call by the upstream API.

API KEY

Two moving parts, both free at low volume:

  1. Create a Programmable Search Engine at https://programmablesearchengine.google.com. That hands you the cx value ("Search engine ID"). By default a PSE is scoped to specific sites you list — for full-web results, open the engine's Search features panel and turn Search the entire web on. (The toggle has been moved around and buried over the years but it's still there.)

  2. Enable the Custom Search API in a Google Cloud project (https://console.cloud.google.com/apis/library/customsearch.googleapis.com) and mint an API key under Credentials. No credit card needed at the free tier.

Quota: 100 free queries/day; paid is $5 / 1000 up to 10,000/day.

api_key

Required. Your Google API key.

cx

Required. The Programmable Search Engine id (a.k.a. cx).

endpoint

Override the endpoint URL. Default https://www.googleapis.com/customsearch/v1.

Honours limit (num, capped at 10), language (hl), region (gl), safesearch (safe), date_restrict (dateRestrict).

SEE ALSO

https://developers.google.com/custom-search/v1/overview

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-net-async-websearch/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudss.us/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

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