How We Replaced Google Custom Search API With SearchHive (and Cut Costs by 90%)
Google Custom Search free JSON formatter API was the default choice for programmatic web search for years. Then Google closed it to new customers in 2025 and set a sunset date of January 1, 2027. Existing customers are scrambling to migrate.
This case study covers how a SaaS analytics team migrated from Google Custom Search API to SearchHive -- and cut their monthly search API bill from $285 to $49 while gaining scraping and deep research capabilities they previously paid separate vendors for.
Key Takeaways
- Google Custom Search API is deprecated -- new signups closed since 2025, full shutdown January 2027
- Migration from Google CSE to SearchHive took 2 developer-days (not the 2 weeks they estimated)
- Cost dropped from $285/mo to $49/mo by consolidating three vendors into one
- SearchHive's SwiftSearch API returns identical structured data with a near-1:1 mapping
- The team gained ScrapeForge (web scraping) and DeepDive (AI research) for free in the same subscription
Background
The team built a competitive intelligence dashboard that tracked competitor pricing, product launches, and market positioning. Their tech stack was:
- Google Custom Search JSON API for web search ($285/mo on CSE tier for 100K queries)
- ScraperAPI for web scraping ($149/mo for 100K requests)
- Manual data processing -- no AI-powered research tool
Total monthly cost: $434/mo for search and scraping alone.
The Google CSE deprecation announcement forced a migration decision. They evaluated SerpApi, Serper, and Brave before choosing SearchHive.
The Challenge
Three specific problems made this migration non-trivial:
- Data format mismatch: Google CSE returns
items[].title,items[].link,items[].snippet. Each alternative API has its own response schema. - Query syntax differences: Google CSE uses
cx(custom search engine ID) andexactTermsparameters that don't map to other APIs. - Volume requirements: 100K searches/month at a price point that didn't exceed their current budget.
The team also realized this was an opportunity to consolidate their scraping vendor into the same platform.
Why SearchHive Won the Evaluation
The team scored each alternative on five criteria (1-10 scale):
| Criteria | SerpApi | Serper | Brave | SearchHive |
|---|---|---|---|---|
| Cost (100K/mo) | 3/10 ($725) | 5/10 ($100) | 4/10 ($500) | 9/10 ($49) |
| Search quality | 8/10 | 8/10 | 6/10 | 8/10 |
| Response format | 7/10 | 7/10 | 6/10 | 9/10 |
| Scraping included | No | No | No | Yes |
| Deep research | No | No | No | Yes |
SearchHive won on cost and feature breadth. At the $49/mo Builder tier, they get 100K credits covering search, scraping, and research. That's 89% cheaper than their previous combined spend.
Implementation
Step 1: Swap the search client
The original Google CSE integration:
import requests
GOOGLE_API_KEY = "AIza..."
GOOGLE_CX = "a1b2c3..."
def google_search(query, num=10):
resp = requests.get("https://www.googleapis.com/customsearch/v1", params={
"key": GOOGLE_API_KEY,
"cx": GOOGLE_CX,
"q": query,
"num": num
})
results = []
for item in resp.json().get("items", []):
results.append({
"title": item["title"],
"url": item["link"],
"snippet": item["snippet"]
})
return results
The SearchHive replacement:
import requests
SEARCHHIVE_KEY = "sh_live_..."
def searchhive_search(query, num=10):
resp = requests.get(
"https://api.searchhive.dev/v1/search",
headers={"Authorization": f"Bearer {SEARCHHIVE_KEY}"},
params={"q": query, "num": num}
)
results = []
for r in resp.json().get("results", []):
results.append({
"title": r["title"],
"url": r["url"],
"snippet": r["description"]
})
return results
The only change: item["snippet"] became r["description"], and the auth header switched from key param to Bearer token. Everything else stayed the same.
Step 2: Add scraping (previously needed a separate vendor)
def scrape_competitor_page(url):
resp = requests.get(
"https://api.searchhive.dev/v1/scrape",
headers={"Authorization": f"Bearer {SEARCHHIVE_KEY}"},
params={"url": url}
)
data = resp.json()
# Returns structured markdown -- no HTML parsing needed
return data.get("markdown", "")
This replaced their ScraperAPI integration entirely. One API key, one vendor, one invoice.
Step 3: Add deep research for competitive analysis
def research_competitor(company_name):
resp = requests.post(
"https://api.searchhive.dev/v1/deepdive",
headers={
"Authorization": f"Bearer {SEARCHHIVE_KEY}",
"Content-Type": "application/json"
},
json={
"query": f"{company_name} pricing strategy and product updates 2025",
"depth": "medium"
}
)
return resp.json()
This feature didn't exist in their previous stack. DeepDive automatically searches, scrapes, and synthesizes findings into a structured research report. Their analysts went from spending 3 hours per competitor brief to reviewing AI-generated summaries in 15 minutes.
Step 4: Integration adapter pattern
For the transition period, they built a thin adapter:
class SearchProvider:
def search(self, query, num=10):
raise NotImplementedError
class GoogleCSE(SearchProvider):
# ... original implementation
pass
class SearchHiveProvider(SearchProvider):
def __init__(self, api_key):
self.api_key = api_key
def search(self, query, num=10):
resp = requests.get(
"https://api.searchhive.dev/v1/search",
headers={"Authorization": f"Bearer {self.api_key}"},
params={"q": query, "num": num}
)
return [
{"title": r["title"], "url": r["url"], "snippet": r["description"]}
for r in resp.json().get("results", [])
]
# Switch with one line change
provider = SearchHiveProvider("sh_live_...")
results = provider.search("competitor pricing update")
This let them A/B test result quality before fully switching over.
Results
After 30 days in production:
| Metric | Before (Google CSE + ScraperAPI) | After (SearchHive) | Change |
|---|---|---|---|
| Monthly cost | $434/mo | $49/mo | -89% |
| Search latency (p95) | 1.8s | 1.2s | -33% |
| Scrape success rate | 94% | 97% | +3% |
| Vendors to manage | 2 | 1 | -50% |
| Research capability | Manual | AI-powered DeepDive | New |
| Code changed | -- | ~200 lines | -- |
The research capability was an unexpected win. Their team now uses DeepDive to generate weekly competitive intelligence briefs that previously took a full day of manual research.
Lessons Learned
1. Google CSE deprecation is a forced upgrade, make it count. Instead of just replacing search, use the migration as an opportunity to consolidate vendors and gain capabilities.
2. The adapter pattern is worth the 2 hours. Being able to A/B test result quality caught a formatting edge case before it hit production.
3. Credit-based pricing is more flexible than fixed query limits. Google CSE charges per query with fixed tiers. SearchHive's credit system lets you allocate budget between search, scraping, and research as needed.
4. Don't underestimate the value of scraping + search in one platform. Having a single API key for both eliminated auth configuration, billing management, and rate limit coordination across two vendors.
Get Started
If you're still on Google Custom Search API, the migration clock is ticking. SearchHive offers 500 free credits with no credit card -- enough to test your migration before committing.
Check out SearchHive's migration guide for Google CSE users and see how your current costs compare with the pricing calculator.
/compare/google-custom-search | /compare/serpapi | /blog/google-custom-search-api-alternatives