websearch

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchMetadata

type FetchMetadata struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Language    string `json:"language,omitempty"`
	StatusCode  int    `json:"statusCode,omitempty"`
}

type FetchRequest

type FetchRequest struct {
	URL             string `json:"url"`
	Provider        string `json:"provider,omitempty"`
	Format          string `json:"format,omitempty"` // "markdown", "text", "html"
	Depth           int    `json:"depth,omitempty"`
	WaitForSelector string `json:"wait_for_selector,omitempty"`
	IncludeMetadata bool   `json:"include_metadata,omitempty"`
}

type FetchResponse

type FetchResponse struct {
	Provider      string         `json:"provider"`
	URL           string         `json:"url"`
	Content       string         `json:"content"`
	Links         []string       `json:"links,omitempty"`
	Metadata      *FetchMetadata `json:"metadata,omitempty"`
	ScreenshotURL string         `json:"screenshot_url,omitempty"`
}

func Fetch

func Fetch(ctx context.Context, req FetchRequest) (*FetchResponse, error)

Fetch extracts readable content and metadata from a target web URL.

type MapRequest

type MapRequest struct {
	URL                   string `json:"url"`
	Limit                 int    `json:"limit,omitempty"`
	Search                string `json:"search,omitempty"`
	Sitemap               string `json:"sitemap,omitempty"`
	IncludeSubdomains     bool   `json:"includeSubdomains,omitempty"`
	IgnoreQueryParameters bool   `json:"ignoreQueryParameters,omitempty"`
}

type MapResponse

type MapResponse struct {
	Success bool     `json:"success"`
	Links   []string `json:"links"`
}

func Map

func Map(ctx context.Context, req MapRequest) (*MapResponse, error)

Map extracts links and sitemap information from a web domain.

type SearchRequest

type SearchRequest struct {
	Query      string `json:"query"`
	Provider   string `json:"provider,omitempty"`
	MaxResults int    `json:"max_results,omitempty"`
	SearchType string `json:"search_type,omitempty"`
}

type SearchResponse

type SearchResponse struct {
	Query    string             `json:"query"`
	Provider string             `json:"provider"`
	Results  []SearchResultItem `json:"results"`
	Total    int                `json:"total"`
}
func Search(ctx context.Context, req SearchRequest) (*SearchResponse, error)

Search conducts web search using DuckDuckGo lite HTML parser with zero API key dependencies.

type SearchResultItem

type SearchResultItem struct {
	Title   string `json:"title"`
	URL     string `json:"url"`
	Snippet string `json:"snippet"`
	Content string `json:"content,omitempty"`
}

Jump to

Keyboard shortcuts

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