Skip to content

About

A type-safe, zero-dependency TypeScript SDK for search and web content across nine providers.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

SearchSuite

中文文档

CI Node.js >=24 ESM only License: MIT

npm version · Project website

One typed API for Baidu, Doubao, Tavily, Exa, Serper, DeepSeek, Zhipu, Bocha, and Alibaba search, with Tavily, Exa, DeepSeek, and Zhipu page content fetching.

SearchSuite is a framework-independent TypeScript SDK. Choose a Provider by name, then use the operation you need:

SearchSuite architecture

See the architecture guide for the request lifecycle and component responsibilities.

import { SearchSuite } from 'searchsuite'

const client = new SearchSuite()
const response = await client.search({
  provider: 'tavily',
  query: 'Recent advances in AI agent search',
  maxResults: 5,
})

const page = await client.fetch({
  provider: 'deepseek',
  url: 'https://example.com/article',
})

Highlights

  • Provider-aware TypeScript inference for providerOptions and responses.
  • Normalized results, usage, latency, warnings, and stable error classes.
  • Native fetch and AbortSignal; ESM-only and zero runtime dependencies.
  • Thin provider adapters with no hidden retries, fallback, routing, or caching.
  • A fetch() API for provider-backed page content, plus an exported WebFetchProvider contract compatible with dsh-web.

Requirements

  • Node.js 24 or newer
  • An ESM project; CommonJS and require() are not supported

Installation

Install SearchSuite from npm:

npm install searchsuite

Quick start

Set the provider credential in the server environment, then use the SDK:

import { SearchSuite } from 'searchsuite'

// searchsuite reads the configured TAVILY_API_KEY
const client = new SearchSuite()
const response = await client.search({
  provider: 'tavily',
  query: 'Recent advances in AI agent search',
  maxResults: 5,
})

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

SearchSuite reads environment variables when a provider is first used. It does not load .env files itself; use Node.js --env-file=.env or your deployment environment. Never expose provider credentials in browser bundles or source control.

Providers

Provider Default search mode Environment variable
Baidu baidu:web, baidu:ai BAIDU_API_KEY or QIANFAN_API_KEY
Doubao doubao:custom, doubao:global DOUBAO_API_KEY or DOUBAO_SEARCH_API_KEY
Tavily tavily:basic, tavily:advanced, tavily:fast, tavily:ultra-fast TAVILY_API_KEY
Exa exa:auto, exa:keyword, exa:neural EXA_API_KEY
Serper serper:google SERPER_API_KEY
DeepSeek deepseek:web DEEPSEEK_API_KEY
Zhipu zhipu:web ZHIPU_API_KEY
Bocha bocha:web BOCHA_API_KEY
Alibaba alibaba:web DASHSCOPE_API_KEY; explicit workspace baseUrl required

Switching providers only requires changing provider:

const response = await client.search({
  provider: 'exa',
  query: 'Recent advances in AI agent search',
})

Explicit provider configuration takes precedence over environment variables, which take precedence over provider defaults. See the provider guide for capabilities, limits, options, and normalized fields.

Alibaba requires an explicit workspace region origin in addition to its API key:

const alibaba = new SearchSuite({
  providers: { alibaba: { baseUrl: 'https://dashscope.aliyuncs.com' } },
})
const response = await alibaba.search({
  provider: 'alibaba',
  query: 'Recent AI research',
  providerOptions: { model: 'qwen-plus' },
})

Choose the origin matching your workspace. Alibaba generates an answer with search sources; model/token and search charges may both apply. maxResults only caps the returned sources locally. The four new providers support search; Tavily, Exa, DeepSeek, and Zhipu provide page content fetching.

Scope

v0.1 provides the framework-agnostic search SDK, nine search Provider adapters, and four page-content fetch adapters. It does not include routing, fallback, retries, multi-key selection, result fusion, reranking, caching, Crawl, a gateway, SaaS features, or a DeepSeek Harness plugin.

Documentation

Contributing and security

See CONTRIBUTING.md for development and review guidelines, SUPPORT.md for questions and bug reports, and SECURITY.md for private vulnerability reports. Do not include API keys, authorization headers, .env files, or unredacted provider data in issues or pull requests.

License

SearchSuite is released under the MIT License.

About

A type-safe, zero-dependency TypeScript SDK for search and web content across nine providers.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages