duckduckgo

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImageURL

func BuildImageURL(q core.Query) (string, error)

BuildImageURL builds a DuckDuckGo image search URL from Query fields. It returns an error when query text or date parameters are invalid.

func BuildURL

func BuildURL(q core.Query, page int) (string, error)

BuildURL builds a DuckDuckGo web search URL for the provided query and page index. It returns an error when query text or date parameters are invalid.

Types

type DuckDuckGo

type DuckDuckGo struct {
	core.Browser
	core.SearchEngineOptions
	// contains filtered or unexported fields
}

DuckDuckGo implements core.SearchEngine for DuckDuckGo SERP pages.

func New

func New(browser core.Browser, opts core.SearchEngineOptions) *DuckDuckGo

New creates a DuckDuckGo engine instance with browser/runtime options applied.

func (*DuckDuckGo) GetRateLimiter

func (ddg *DuckDuckGo) GetRateLimiter() *rate.Limiter

GetRateLimiter returns a limiter configured from SearchEngineOptions.

func (*DuckDuckGo) Name

func (ddg *DuckDuckGo) Name() string

Name returns the stable engine identifier.

func (*DuckDuckGo) Search

func (ddg *DuckDuckGo) Search(ctx context.Context, query core.Query) (results []core.SearchResult, err error)

Search executes a DuckDuckGo web search and returns normalized search results. It may return core.ErrCaptcha or core.ErrSearchTimeout.

func (*DuckDuckGo) SearchImage

func (ddg *DuckDuckGo) SearchImage(ctx context.Context, query core.Query) ([]core.SearchResult, error)

SearchImage executes a DuckDuckGo image search and returns normalized image results. It may return core.ErrCaptcha or core.ErrSearchTimeout.

Jump to

Keyboard shortcuts

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