Skip to article

web.search

The portable request for ranked web results, with capability checks before dispatch.

On this page

Request fields

FieldContract
query: stringRequired, nonblank; forwarded unchanged.
limit?: numberInteger 1–20; default 5. Output ceiling.
includeDomains?: readonly string[]Nonempty hostname allowlist within every provider's capacity.
excludeDomains?: readonly string[]Nonempty hostname blocklist within every provider's capacity.

Call options

TypeScript
const controller = new AbortController();
// client is a configured createSearch() client.
const response = await client.web.search(
  { query: 'SQLite write concurrency', limit: 5 },
  { signal: controller.signal },
);

Only signal is accepted in normalized call options. Unknown request or option fields reject with invalid_request; a required capability missing from any configured provider rejects with unsupported_option. Native options belong on the provider-native surface.

Result-count behavior

A successful response can contain zero or fewer than the requested number of results. Empty success does not trigger fallback. TinyFish fetches one first page; Context requests at least ten native results and trims to the requested ceiling. The SDK does not silently paginate.