
In simple English
When your AI agent needs to search the web, it talks to this gateway. If your main search provider breaks or hits a rate limit, the gateway automatically tries the next one on your list. It unifies ten different search and crawling services behind a single format. You can run it on your own server, use it inside a Cloudflare Worker, or load it as a library in your own code. It costs you whatever time you spend setting up your API keys and your hosting.
What it is
A self-hosted search and crawling gateway written in TypeScript that aggregates multiple search providers into a single Perplexity-compatible API. It supports automatic fallback, an MCP (Model Context Protocol, a way for AI models to talk to local tools and data sources) server, and a TypeScript library.
What it is good for
Solo builders who want to give their AI agents reliable web search without depending on a single search vendor or writing custom failover logic for every API.
- Automatically switches to backup search providers if the primary one fails or rate limits.
- Provides a Model Context Protocol server out of the box for tools like Claude and Cursor.
- Runs on Node, Bun, Docker, or Cloudflare Workers from the same codebase.
- Requires you to bring your own paid API keys for the underlying search providers.
- Requires basic familiarity with environment variables and command-line tools to set up.
- Node, npm, and a TypeScript build environment are needed if you modify the source code.
Writing custom fallback logic and glue code for multiple search APIs.
Claude Desktop or Cursor for AI tool use.
- searxng/searxng39k stars
A free internet metasearch engine that aggregates results from many search services, while search2ai acts as a gateway for AI agents.
- firecrawl/firecrawl194k stars
Turns entire websites into clean markdown for LLMs, while search2ai focuses on unified search and provider fallback.
- ggml-org/llama.cpp132k stars
A C and C++ library and command-line tool for running language models locally.
- EleutherAI/lm-evaluation-harness14k stars
Runs standard question sets against a language model and reports the scores.
- mudler/LocalAI50k stars
Serves text, vision, speech, image and video models from one self-hosted service that imitates the paid interfaces.
npm i search2ai SEARCH1API_KEY=your_key npx search2ai serve