Giter VIP home page Giter VIP logo

duckduckgo.net's Introduction

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.

duckduckgo.net's People

Contributors

koenmetsu avatar timkly avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.