Bowmark AIdocs

Web search

Find pages on the web when you do not already know the URL — the step before read.page.

Find pages on the web when you do not already know the URL — the step before read.page. Returns ranked results with title, destination URL and snippet. news is the same read over news coverage, with real publication dates and the outlet's name. ONE ENGINE TODAY (Bing), so if it is down this fails rather than degrading — it throws, and never reports an outage as zero results. Two things that engine cannot do, measured on web: it never returns an empty list even when nothing matches, and it ignores search operators like site:.

Also known as: web search, find, lookup, query, serp, news, search engine

Call it

bowmark.search.web(query: string | { query: string, limit?: number }, limit?: number, options?: CallOptions): Promise<SearchWebResult>
bowmark.search.news(query: string | { query: string, limit?: number }, limit?: number, options?: CallOptions): Promise<SearchNewsResult>

Functions

FunctionWhat it does
webSearches the web and returns ranked results — title, destination URL, snippet — from the first engine in the chain that answers.
newsSearches news coverage and returns stories with the headline, the outlet's own article URL, a summary, the publisher's name and a real publication timestamp.

Types

type SearchResult = {
  source: string              // which ENGINE produced this row ("bing")
  rank: number                // 1-based, in that engine's own ranking
  title: string
  url: string                 // the destination page, already unwrapped from any
                              // click-tracker — pass it straight to read.page
  snippet: string | null      // the engine's blurb; null when it published none
  published: string | null    // ISO. On `web` this is often the engine's CRAWL
                              // date, not the page's — do not report it as one
}
type SearchWebResult = {
  query: string
  engine: string              // who actually answered. With a fallback chain this
                              // is the difference between the primary engine's
                              // ranking and the standby's
  results: SearchResult[]
  warnings: string[]          // always present. Names every engine tried and
                              // FAILED before the one that answered
}

// news adds the two things a news index has and a web index does not
type NewsResult = SearchResult & {
  publisher: string | null    // the outlet
  imageUrl: string | null     // usually the engine's cached thumbnail
}
type SearchNewsResult = {
  query: string
  engine: string
  results: NewsResult[]
  warnings: string[]
}

type CallOptions = {
  timeoutMs?: number   // per-provider budget in ms, default 30000, clamped to 1000-55000.
                       // A provider slower than this is DROPPED from the results and
                       // NAMED in warnings — never silently absent
}

Providers behind it

Provider
bingBing