Skip to content
A dot.net instant answer library written in C# for the DuckDuckGo Search API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.nuget
DuckDuckGo.Net.Tests
Properties
.gitattributes
.gitignore
ApiClient.cs
DuckDuckGo.Net.csproj
DuckDuckGo.Net.sln
LICENSE.txt
README.md
Search.cs
SearchResult.cs
packages.config

README.md

DuckDuckGo.Net

A DotNet instant answer library written in C# for the DuckDuckGo Instant Answer API

Access the DuckDuckGo API with [C#].

Version 1.0.1

Requirements

Target framework - 4 Target Test framework - 4.5 (not required for production release)

System.Web to be referenced if using .Net client profile option

Installation

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

Usage

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);

Contact

Github - timkly

Twitter - @timkly

LICENSE

MIT LICENSE--see file /LICENSE

This project has no affiliation with the company DuckDuckGo.

You can’t perform that action at this time.