#14445: feat: add SerpApi search provider plugin with vertical search support
gateway
agents
stale
size: XL
Cluster:
Web Search Provider Enhancements
## Summary
Add a **serpapi-search** extension plugin that integrates [SerpApi](https://serpapi.com) as a web search provider, with support for 20+ vertical search engines.
Also adds an `engine` parameter to the `web_search` tool schema so LLMs can request specific search verticals directly (e.g. `engine='scholar'`, `engine='news'`).
## Depends on
This PR builds on the extensible search provider architecture from **#11444**. The base branch includes those commits — once #11444 is merged, this PR will have a clean diff of just the SerpApi plugin + engine param.
## Features
- **SerpApi integration** with configurable API key and default engine
- **20+ vertical search engines**: Google (default), News, Scholar, Images, Shopping, Maps, Jobs, Finance, Patents, YouTube, Bing, Baidu, Yandex, Naver, etc.
- **Engine-specific result parsing**: organic results, news articles, scholar papers, shopping products, map places, job listings, etc.
- **Knowledge graph & answer box** extraction when available
- **`engine` parameter** added to `web_search` tool schema and `SearchProviderPlugin` type for vertical routing
- Proper error handling and timeout support
## Files changed
- `extensions/serpapi-search/` — New plugin (index.ts, README, manifest, package.json)
- `src/agents/tools/web-search.ts` — Add `engine` to tool schema and pass through to provider
- `src/plugins/types.ts` — Add `engine?` to SearchProviderPlugin params type
## Testing
Tested locally with SerpApi free tier:
- ✅ Default Google search
- ✅ Google Scholar vertical (`engine='scholar'`)
- ✅ Google News vertical (`engine='news'`)
- ✅ YouTube search (`engine='youtube'`)
- ✅ Engine-specific result parsing
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR introduces a plugin-based registry for `web_search` providers, refactors the built-in Brave and Perplexity implementations into `SearchProviderPlugin`s, and adds a new `serpapi-search` provider plugin with an `engine` parameter for vertical routing (news/scholar/images/shopping/maps/etc.). It also updates tool/config typings to allow arbitrary provider IDs registered by plugins.
Key correctness issue found: the new example `kagi-search` plugin’s manifest schema currently prevents users from configuring the required `apiKey`, which will cause the plugin to fail validation and not load.
<h3>Confidence Score: 4/5</h3>
- Mostly safe to merge once the kagi-search manifest schema mismatch is fixed
- Core refactor to a provider registry is straightforward and keeps built-in Brave/Perplexity behavior encapsulated; main concrete breakage is the kagi-search plugin manifest rejecting its own apiKey config, which would prevent loading when configured.
- extensions/kagi-search/openclaw.plugin.json
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#11444: Add extensible search providers for web_search
by dhc02 · 2026-02-07
87.4%
#19876: feat(web-search): add SerpAPI search provider support
by nksolar-tianjin · 2026-02-18
83.7%
#7738: feat(web-search): add provider fallback and Serper support
by garnetlyx · 2026-02-03
80.2%
#22626: feat(search): add support for SearXNG as a search provider
by sarveshgandhi · 2026-02-21
76.2%
#13665: feat(web-search): add SearXNG as a search provider
by sfo2001 · 2026-02-10
76.1%
#16895: feat(web-search): add SearXNG as a search provider
by rustyorb · 2026-02-15
76.0%
#8715: fix(web-search): safer provider resolution & Perplexity auto-detection
by abhijeet117 · 2026-02-04
75.8%
#17703: feat(web-search): add Parallel search provider
by raktim-mondol · 2026-02-16
75.5%
#22989: feat(web-search): add Google Custom Search Engine provider
by Prakashmaheshwaran · 2026-02-21
75.0%
#12304: feat: add DeSearch as web_search provider
by tatjr13 · 2026-02-09
74.9%