duckduckgo

package
v0.0.0-...-ca665c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DDGURL = "https://api.duckduckgo.com/?q=%s&o=json&kp=%d&no_redirect=1&no_html=1&d=%d&t=%s"

DDGURL ddg api url

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Abstract       string
	AbstractText   string
	AbstractSource string
	AbstractURL    string
	Image          string
	Heading        string

	Answer     string
	AnswerType string

	Definition       string
	DefinitionSource string
	DefinitionURL    string

	RelatedTopics []Topic `json:"RelatedTopics,omitempty"`
	Results       []Topic `json:"Results,omitempty"`

	Redirect string
}

Answer ddg api answer

func Query

func Query(client *http.Client, query string, useragent string, safesearch bool, meanings bool) (*Answer, error)

Query query a single answer

type Icon

type Icon struct {
	URL    string
	Height interface{} `json:"Height,omitempty"`
	Width  interface{} `json:"Width,omitempty"`
}

Icon duckduckgo result icon

type Topic

type Topic struct {
	Result   string
	Icon     Icon
	FirstURL string
	Text     string
}

Topic related topic

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL