Google Custom Search JSON API Migration Kit (Python + Node)
Google discontinues the Custom Search JSON API on 1 January 2027, and it no longer accepts new customers. If your site search, research tool or AI agent calls customsearch/v1, it stops working that day.
This kit finds every call in your code and gives you a drop-in replacement that returns the same response shape, so the rest of your app doesn't change.
What's inside:
- cse_scan.py: a read-only scanner that finds REST calls (including siterestrict), googleapiclient and googleapis (Node) usage, cx and key settings, and image search calls. Text or JSON output, CI exit codes. Never prints your keys.
- - cse_adapter.py (Python 3.9+, standard library only) and cse_adapter.mjs (Node 18+, no dependencies): one search() function with two backends: Google Agent Search (formerly Vertex AI Search) via the API-key searchLite method, Google's suggested replacement for site search on up to 50 domains; and Brave Search API for full-web search (Google has no self-serve full-web replacement). Your existing parameters (num, start, safe, lr, gl, siteSearch, exactTerms, dateRestrict...) are mapped or rewritten where the new backend supports them, and rejected with a clear error where it doesn't, never silently dropped. Results come back as items[] with title, link, displayLink, snippet and htmlSnippet; HTML is sanitized to bold-only.
- - MIGRATION-GUIDE.md: step-by-step Agent Search setup (data store, API key), Brave setup, before/after code for googleapiclient, requests and fetch, staging comparison, cut-over checklist, cost notes.
- - CHECKLIST.md and tests for the scanner and both adapters.
Who it's for: developers and small teams with a production feature on the Custom Search JSON API who need to move this month.
Honest limits: image search isn't mapped; sort, fileType, cr and hl aren't supported by either backend; Brave gives no exact total count and pages by page index; Agent Search only searches the sites in your data store. Check Google's and Brave's current docs before going live.
Independent product. Not affiliated with Google or Brave.