Function Repository Resource:

DuckDuckGoQuery

Source Notebook

Query instant answers from the DuckDuckGo search website API

Contributed by: Daniel de Souza Carvalho

ResourceFunction["DuckDuckGoQuery"][str]

sends the string str to the web search service DuckDuckGo.

Details and Options

Results are given as an Association.
As this function uses an external API, the performance depends on your connection quality. Your firewall should allow HTTP/S requests.

Examples

Basic Examples (1) 

Query about a particular company:

In[1]:=
ResourceFunction["DuckDuckGoQuery"]["Wolfram Research"] // Dataset
Out[1]=

Scope (5) 

Query about a certain notable person:

In[2]:=
ResourceFunction["DuckDuckGoQuery"]["Stephen Wolfram"] // Dataset
Out[2]=

There are lists of links to relevant webpages with a description:

In[3]:=
{#["Text"], #["FirstURL"]} & /@ ResourceFunction["DuckDuckGoQuery"]["NASDAQ"]["RelatedTopics"] // ResourceFunction["NiceGrid"]
Out[3]=

As the web is a source of big data, it is possible to get perspectives from textual unstructured information:

In[4]:=
WHtopics = {#["Text"]} & /@ ResourceFunction["DuckDuckGoQuery"]["White House"]["RelatedTopics"];
WordCloud[DeleteStopwords[StringJoin[Flatten[WHtopics], " "]]]
Out[5]=

It is possible to get relevant data from particular fields:

In[6]:=
{#["AbstractText"], Import[#["Image"]]} &[
  ResourceFunction["DuckDuckGoQuery"]["Wolfram Research"]] // Column[#, Frame -> All] &
Out[6]=

There are many fields in the response and they can be displayed nicely with Dataset:

In[7]:=
ResourceFunction["DuckDuckGoQuery"]["Albert Einstein"] // Dataset
Out[7]=

Neat Examples (1) 

We can get additional data from DuckDuckGo:

In[8]:=
SWPic = ResourceFunction["DuckDuckGoQuery"]["Stephen Wolfram"][
   "Image"];
Import[SWPic]
Out[9]=

Publisher

Daniel de Souza Carvalho

Version History

  • 1.0.0 – 04 October 2019

Related Resources

License Information