Skip to content

feat: add SerpBase (Google) search provider via REST API - #1968

Open
gefsikatsinelou wants to merge 1 commit into
apecloud:mainfrom
gefsikatsinelou:feat/add-serpbase-provider
Open

feat: add SerpBase (Google) search provider via REST API#1968
gefsikatsinelou wants to merge 1 commit into
apecloud:mainfrom
gefsikatsinelou:feat/add-serpbase-provider

Conversation

@gefsikatsinelou

Copy link
Copy Markdown

Summary

Add SerpBase as a Google search provider — returns structured Google search results via REST API with zero scraping maintenance.

Background

ApeRAG currently supports DuckDuckGo, Jina, and LLM.txt search providers. Google search is a commonly requested backend for research-quality results, but scraping Google directly is brittle and requires constant maintenance. SerpBase provides a reliable, structured Google Search API that fits naturally into the existing provider architecture.

Changes

  • New: aperag/websearch/search/providers/serpbase_search_provider.py — REST API-based Google search provider (181 lines)
  • Updated: aperag/websearch/search/providers/__init__.py — added SerpBaseSearchProvider import and export
  • Updated: aperag/websearch/search/search_service.py — registered as "google" and "serpbase" in provider_registry

Design decisions

Decision Rationale
API key via SERPBASE_API_KEY env var Follows existing convention (Jina uses api_key in config / env pattern)
Graceful skip when key missing Returns [] with a warning log — matches the "don't crash on missing config" philosophy
Uses aiohttp Already a project dependency (used by Jina provider); no new packages
Mirrors existing provider structure Same validation flow, domain filtering, locale mapping as DuckDuckGo/Jina providers

Testing

  • When SERPBASE_API_KEY is set: performs Google search and returns structured results
  • When key is unset: logs warning, returns [], other providers continue unaffected
  • Follows existing provider interface exactly — drop-in compatible

Related

- New: serpbase_search_provider.py — Google search via api.serpbase.dev
- Uses aiohttp (already a project dependency via Jina provider)
- API key from SERPBASE_API_KEY env var; gracefully skips when unset
- Supports 'google' and 'serpbase' provider names in registry
- Mirrors existing provider structure: validation, domain filtering, locale mapping
@apecloud-bot apecloud-bot added the size/L Denotes a PR that changes 100-499 lines. label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants