Skip to main content

Introducing a Ruby Library for the Duck Duck Go API

·1 min

I have just released a new Ruby library for working with the Duck Duck Go Zero-click Info API. It encapsulates the API calls and decoding and populates various objects to hold the results.

Here is the example from the README file, doing a query for Stephen Fry:

require "duck_duck_go"
  
ddg = DuckDuckGo.new
zci = ddg.zeroclickinfo("Stephen Fry") # ZeroClickInfo object
  
zci.heading # Stephen Fry
zci.abstract_text # Stephen John Fry is an English actor, screenwriter, author, playwright, ...
zci.related_topics["_"][0].text # Stephen Fry (cricketer) ...

The Zero Click API supports a number of query types. The example above is for an article search. There are also category searches (i.e. Simpsons Characters) and disambiguation searches (i.e. Apple), amongst others.

Its my first ever RubyGem, having only just taught myself Ruby. I think its OK, but please let me know if you have any feedback.

You can install from RubyGems and the docs are available at RubyDoc. The source code is available at GitHub.


Want great, practical advice on implementing data mesh, data products and data contracts?

In my weekly newsletter I share with you an original post and links to what's new and cool in the world of data mesh, data products, and data contracts.

I also include a little pun, because why not? 😅

(Don’t worry—I hate spam, too, and I’ll NEVER share your email address with anyone!)


Andrew Jones
Author
Andrew Jones
I build data platforms that reduce risk and drive revenue.