Skip to article

Search, with the details intact.

A TypeScript SDK for web retrieval. Choose a provider, preserve source identity, and make failure behavior explicit.

One normalized search request
  1. Your serverquery + options
  2. Web adapterprovider request
  3. SearchResponsesources + attempts

Provider-native clients are a separate surface, with their own operations and response shapes.

On this page

One search contract

The normalized API is client.web.search(request, options?). Web adapters share a small request and response shape while preserving provider order, source URLs, native text, and retrieval provenance. Context.dev and TinyFish are the priority integrations; the provider catalog describes each supported boundary.

search.ts · server
import { createSearch } from '@belweave/search-sdk';
import { context } from '@belweave/search-sdk/context';

const apiKey = process.env.CONTEXT_API_KEY;
if (!apiKey) throw new Error('CONTEXT_API_KEY is required');

const client = createSearch({
  provider: context({ apiKey }),
  timeoutMs: 10_000,
});

const response = await client.web.search({
  query: 'SQLite write concurrency',
  limit: 5,
});

for (const result of response.results) {
  console.log(result.title ?? result.url, result.url);
}
console.log(response.provider, response.attempts);

Choose your path

Web results and native operations

Normalized search is a deliberately narrow surface. Provider-native clients preserve different operations and response shapes; their documentation is separate. A search snippet, an extracted page, a generated answer, and a corpus passage carry different meaning.