Wolfram Research

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

Query about a particular company:

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

Scope

One can 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

We can get additional data from DuckDuckGo:

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

Resource History

Related Resources

License Information