WWW::Du...ickInfo(3)

πŸ“¦
version 0.016 Β· 2 versions
, in fedora 43

πŸ’– WWW::DuckDuckGo::ZeroClickInfo πŸ’–

okay bestie, so this is the Perl docs page for WWW::DuckDuckGo::ZeroClickInfo, living its best life in the User Contributed Perl Documentation section of the manual. it's giving "the little object that holds your DuckDuckGo answer" energy and honestly? iconic. πŸ¦‹


✨ NAME ✨

WWW::DuckDuckGo::ZeroClickInfo β€” a DuckDuckGo Zero Click Info definition. that's the whole vibe. no cap.


🌸 VERSION 🌸

version 0.016 β€” yes, we're on the teeny tiny version numbers, she's humble like that πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

here's how you actually use her, copy-paste ready:

use WWW::DuckDuckGo;

my $zci = WWW::DuckDuckGo->new->zci('duck duck go');

print "Heading: ".$zci->heading if $zci->has_heading;

print "The answer is: ".$zci->answer if $zci->has_answer;

if ($zci->has_default_related_topics) {
  for (@{$zci->default_related_topics}) {
    print $_->url."\n";
  }
}

if (!$zci->has_default_related_topics and %{$zci->related_topics_sections}) {
  print "Disambiguatious Related Topics:\n";
  for (keys %{$zci->related_topics_sections}) {
    print "  Related Topics Groupname: ".$_."\n";
      for (@{$zci->related_topics_sections->{$_}}) {
        print "  - ".$_->first_url->as_string."\n" if $_->has_first_url;
      }
    }
  }
}

notice how every has_* check is a little guardrail before you go touching the actual value? that's the self-care era of Perl. 🫢


πŸ’œ DESCRIPTION πŸ’œ

This package reflects the result of a zeroclickinfo API request. like, it's the objectified receipt of your question. πŸ“¬


⭐ METHODS ⭐

okay so here's the whole roster, one by one, no skipping, no summarising, we respect every single one of them:

has_abstract

abstract

has_abstract_text

abstract_text

has_abstract_source

abstract_source

has_abstract_url

abstract_url

  • Gives back a URI::http

has_image

image

  • Gives back a URI::http

has_heading

heading

has_answer

answer

has_answer_type

answer_type

has_definition

definition

has_definition_source

definition_source

has_definition_url

definition_url

has_html

html

  • Gives back a URI::http
  • Gives back a hash reference of related topics with its Name as key and as value an array reference of WWW::DuckDuckGo::Link objects. If there is a specific topic, a so called default topic, which is the case in all non disambigious search results, then this topic has the name "_", but you can access it with the method default_related_topics directly.
  • Gives back an array reference of WWW::DuckDuckGo::Link objects. Can be undef, check with has_default_related_topics.

has_results

results

  • Gives back an array reference of WWW::DuckDuckGo::Link objects. Can be undef, check with has_results.

has_type

type

type_long

  • Gives back a longer version of the type.

has_redirect

redirect

  • Access the URL it would redirect you to (for !bangs)

πŸ‘‘ METHODS πŸ‘‘

...yeah bestie, the original literally has a second METHODS heading right here with absolutely nothing under it. not me pointing at the void. πŸ’€ we're leaving it exactly where it was, because facts are facts and we don't erase her little mysteries.


🌈 SUPPORT 🌈

IRC

Join #duckduckgo on irc.freenode.net. Highlight Getty for fast reaction :). (the smiley is theirs, i'm just the messenger πŸŽ€)

Repository

http://github.com/Getty/p5-www-duckduckgo
Pull request and additional contributors are welcome

Issue Tracker

http://github.com/Getty/p5-www-duckduckgo/issues

🧚 AUTHORS 🧚

  • Torsten Raudssus <torsten@raudss.us> <https://raudss.us/>
  • Michael Smith <crazedpsyc@duckduckgo.com>

This software is copyright (c) 2013 by DuckDuckGo, Inc. <https://duckduckgo.com/>.

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


okay so real talk, that license line is a whole mood: free software, same terms as Perl 5 itself, go wild but respectfully πŸ’–

and that's the page!! this doc shipped as part of perl v5.42.0, dated 2025-07-25, and honestly she ate. slay, go build something cute with it. βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from