duckduck_answer {duckduckr}R Documentation

Call DuckDuckGo Instant Answer API


Makes a synchronous API call to the DuckDuckGo Instant Answer API. Take a look at DuckDuckGo's terms of use ( before using it.


duckduck_answer(query, no_redirect = FALSE, no_html = FALSE,
  skip_disambig = FALSE, app_name = "duckduckr")



the query string


TRUE to skip HTTP redirects (for !bang commands)


TRUE to remove html from results


TRUE to to skip disambiguation (D) Type.


the appname used to identify your application.


Always returns a list. If the API call was successful it contains the response of the duckduckgo API as parsed by fromJSON. In addition the object's attributes contain additional meta data. Especially the status attribute indicates if something went wrong during the HTTP call or parsing of the JSON text.

In case the call was successful the status attribute is equal to "OK".

In case something went wrong, the status attribute is equal to "error" and in the error attribute you will find more information. In particular the type, which is either "http_error" or "json_parse_error" depending on the error's source.

In case of a "http_error", there is an additional message and http_status element.

In case of "json_parse_error", there is an additional message element.

In addition there is always a source element with the URL used to query the data.

See Also for more information on the API and their terms of use.


## Not run: 
tmp <- duckduck_answer("duckduckgo")

## End(Not run)

[Package duckduckr version 1.0.0 Index]