A DotNet instant answer library written in C# for the DuckDuckGo Instant Answer API
Access the DuckDuckGo API with [C#].
Version 1.0.1
Target framework - 4 Target Test framework - 4.5 (not required for production release)
System.Web to be referenced if using .Net client profile option
To install, download project and reference the DuckDuckGo.Net library in your project
Via GitHub
Via [NuGet] (https://www.nuget.org/packages/DuckDuckGo.Net/)
Nuget Console:
PM> Install-Package DuckDuckGo.Net
Once you have referenced the library in your project, ensure you include a using reference in the file which will be consuming it
using DuckDuckGo.Net;
Create a new instance of the DuckDuckGo Search using the default settings
var search = new Search();
Create a new instance of the DuckDuckGo Search using custom settings during initialisation (all settings shown).
var search = new Search
{
NoHtml = true,
NoRedirects = true,
IsSecure = true,
SkipDisambiguation = true,
ApiClient = new HttpWebApi()
};
Settings may also be configured after initialisation but before the query is performed
search.NoHtml = false;
search.ApiClient = new FileApi();
Perform a query and return the result as a SearchResult object
var searchResult = search.Query("apple", ApplicationName);
Perform a query and return the result as a JSON formatted string
var jsonString = search.TextQuery("apple", ApplicationName, ResponseFormat.Json);
Perform a query and return the result as a XML formatted string
var xmlString = search.TextQuery("apple", ApplicationName, ResponseFormat.Xml);
Github - timkly
Twitter - @timkly
MIT LICENSE--see file /LICENSE
This project has no affiliation with the company DuckDuckGo.