[Discussion] Add a SearchApi web search provider (remote::searchapi-search)
What would you like to discuss with the community?
Disclosure first: I'm the developer advocate at SearchApi, the API I am proposing here. So I have a direct interest in this landing, and you should weigh the rest accordingly.
Motivation
OGX serves web search through the builtin::websearch toolgroup via remote::tavily-search, remote::brave-search, remote::bing-search, remote::nimble-search, remote::serply-search and remote::exa-search. I would like to add one more option backed by SearchApi's Google Search API, which returns Google organic results as ranked {title, link, snippet} rows. It is a drop-in web grounding choice on the same web_search tool shape, so it needs no API or routing changes.
I am not claiming it beats the existing providers at retrieval quality. It is another Google-backed option for people who already have a SearchApi account or want its other verticals later.
Proposed provider
provider_type: remote::searchapi-search,toolgroup_id: builtin::websearch.- Mirrors the
serply_search/exa_searchlayout exactly: framework-freehttpx2(no new dependency), persistentAsyncClientcreated ininitialize()and closed inshutdown(), config inheritingBaseToolRuntimeConfigfor timeouts, the sharedlow/medium/high -> 3/5/10mapping forsearch_context_size, and the key read from config (SEARCHAPI_API_KEY) or per request via theX-OGX-Provider-Dataheader (searchapi_search_api_key). - Transport is
GET https://www.searchapi.io/api/v1/search?engine=google&q=...with the key only in theAuthorization: Bearerheader, never in the query string, plusUser-Agent: ogx. - Google phased out the
numparameter in September 2025, so SearchApi documents one results page of 10 per request. The provider does not sendnumand trims the page locally to the requested count (sohighis at most 10). allowed_domainsbecomes a(site:a OR site:b)clause in the query, same asserply_search.user_location.countryis forwarded asgl, which is a documented parameter of this engine.- Config surface kept small:
api_keyasSecretStrandmax_results, everyFieldwith adescriptionso./scripts/provider_codegen.pygenerates the doc page.
In tree, same shape as #6636 and #6643
Following #6621, where @mattf answered "in tree", and the two providers that landed after it, I have prototyped it in tree as a peer to serply_search, with the same file set as the Exa PR (#6643): provider package, registry entry, starter / ci-tests wiring through distro_codegen.py, the generated reference page, the lets-go web search order, the hand-written docs mentions, and a unit test file.
Status
The PR is ready and tested live against the real API (plain query, allowed_domains, gl, invalid key) plus a mocked unit layer for CI. I will link it here as soon as it is open. Scope is web search only; SearchApi also has News, Scholar, Maps and other engines, and those would need an API extension, so they stay out of this one.
Happy to adjust anything to match the house pattern.
PR is open: https://github.com/ogx-ai/ogx/pull/6927
Good news — SearchApi is in. The routed web_search API shipped in #7014 (merged to main 2026-11-17) with remote::searchapi-search registered as one of the built-in search providers (ogx.providers.remote.web_search.searchapi_search), so the ask in this discussion has landed.
Closing this as implemented. If anything is missing from the SearchApi integration (config surface, error mapping, etc.), open a follow-up issue — or reply here and we'll reopen. Thanks for the thorough write-up and the up-front disclosure.