Skip to content

feat(integrations): add SerpAPI integration + generic handler#259

Open
lev-goryachev wants to merge 1 commit intomainfrom
integration/serpapi
Open

feat(integrations): add SerpAPI integration + generic handler#259
lev-goryachev wants to merge 1 commit intomainfrom
integration/serpapi

Conversation

@lev-goryachev
Copy link
Contributor

@lev-goryachev lev-goryachev commented Mar 16, 2026

Summary

  • Adds generic handler to `ckit_integrations_db.py`: any `fi_{name}.py` following the `Integration*` / `PROVIDER_NAME` / `called_by_model` pattern loads automatically without an explicit `elif` block
  • Adds `fi_serpapi.py` — full implementation of SerpAPI, 96 method_ids covering all documented engines

Coverage: 96 method_ids

91 search engines: Amazon, Apple App Store, Baidu, Bing (search/news/images/maps/shopping/videos/copilot/reverse image), DuckDuckGo (search/news/images/maps/search assist), eBay, Facebook Profile, Google (search/scholar/news/images/maps/shopping/jobs/trends/videos/finance/flights/hotels/patents/play/lens/events/local/autocomplete/AI mode/AI overview/...), Home Depot, Naver, OpenTable, TripAdvisor, Walmart, Yahoo (search/images/shopping/videos), Yandex (search/images/videos), Yelp, YouTube

5 utility methods:

  • `serpapi.account.get.v1` — account info & credits
  • `serpapi.locations.search.v1` — available targeting locations
  • `serpapi.search_archive.get.v1` — retrieve cached search by ID
  • `serpapi.pixel_position.search.v1` — search with pixel positions
  • `serpapi.pixel_position.archive.v1` — archived search with pixel positions

Changes

  • `ckit_integrations_db.py`: add `import importlib/inspect`, replace `raise ValueError("Unknown integration")` with generic handler, relax `main_loop_integrations_init` signature
  • `integrations/fi_serpapi.py`: new file, 346 lines

Test plan

  • Verify `serpapi` loads when listed in bot integration allowlist
  • `op=list_methods` returns all 96 method_ids
  • `op=call` with `method_id=serpapi.search.google.v1` and `args.q=test` returns results (requires API key in `external_auth.serpapi`)

Add generic handler to ckit_integrations_db.py so any fi_{name}.py
following the Integration*/PROVIDER_NAME/called_by_model pattern loads
automatically without an explicit elif block.

Add fi_serpapi.py implementing SerpAPI:
- google.v1   — Google Search results
- scholar.v1  — Google Scholar academic search
- news.v1     — Google News
- images.v1   — Google Images
- shopping.v1 — Google Shopping
- maps.v1     — Google Maps local results
- jobs.v1     — Google Jobs
- trends.v1   — Google Trends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant