Workflow

Batch Migrate Google CSE Queries to Scavio

Batch migrate Google Custom Search Engine queries to Scavio. Export, map, test, and cut over with zero downtime.

Overview

Google Custom Search Engine is being deprecated and teams need to migrate hundreds or thousands of queries to a replacement API before the shutdown deadline. This workflow exports all your CSE queries and configurations, maps CSE parameters to Scavio equivalents, runs parallel tests to validate result quality, switches production traffic once parity is confirmed, and decommissions the old CSE project. Scavio charges $0.005 per credit versus CSE's $5 per 1,000 queries ($0.005 each) but with multi-platform support included at no extra cost.

Trigger

Manual trigger before CSE sunset deadline

Schedule

One-time migration batch

Workflow Steps

1

Export CSE queries and config

Pull all queries from your CSE usage logs and export the search engine configuration (site restrictions, refinements, schema).

2

Map CSE fields to Scavio

Convert CSE parameters (cx, exactTerms, siteSearch) to Scavio equivalents (platform, query filters). Generate a mapping table.

3

Parallel test queries

Run each query through both CSE and Scavio in parallel. Compare top 10 results for URL overlap and snippet relevance.

4

Switch production traffic

Update your application endpoints from CSE to Scavio. Deploy with feature flag so you can roll back instantly.

5

Decommission CSE project

After 48 hours of stable Scavio traffic, disable the CSE project in Google Cloud Console and revoke API keys.

Python Implementation

Python
import requests, os, json, time

H = {"x-api-key": os.environ["SCAVIO_API_KEY"]}

# Exported CSE queries from usage logs
CSE_QUERIES = [
    {"query": "best project management tools 2026", "site_restrict": None},
    {"query": "CRM software comparison", "site_restrict": "g2.com"},
    {"query": "cloud hosting pricing", "site_restrict": None},
]

def migrate_query(cse_entry):
    """Test a CSE query against Scavio and return parity report."""
    payload = {"platform": "google", "query": cse_entry["query"]}
    if cse_entry.get("site_restrict"):
        payload["query"] = f"site:{cse_entry['site_restrict']} {cse_entry['query']}"
    r = requests.post("https://api.scavio.dev/api/v1/search", headers=H,
        json=payload, timeout=10).json()
    scavio_urls = [o.get("link", "") for o in r.get("organic", [])[:10]]
    return {
        "query": cse_entry["query"],
        "scavio_results": len(r.get("organic", [])),
        "top_urls": scavio_urls[:5],
        "has_ai_overview": bool(r.get("ai_overview")),
        "migration_status": "ready" if len(scavio_urls) >= 3 else "review"
    }

results = []
for entry in CSE_QUERIES:
    result = migrate_query(entry)
    results.append(result)
    print(f"[{result['migration_status'].upper()}] {result['query']} -> {result['scavio_results']} results")
    time.sleep(0.5)

ready = sum(1 for r in results if r["migration_status"] == "ready")
print(f"\nMigration ready: {ready}/{len(results)} queries passed parity check")

JavaScript Implementation

JavaScript
const H = {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"};

const CSE_QUERIES = [
  {query: "best project management tools 2026", siteRestrict: null},
  {query: "CRM software comparison", siteRestrict: "g2.com"},
  {query: "cloud hosting pricing", siteRestrict: null},
];

async function migrateQuery(cseEntry) {
  const q = cseEntry.siteRestrict
    ? `site:${cseEntry.siteRestrict} ${cseEntry.query}`
    : cseEntry.query;
  const r = await fetch("https://api.scavio.dev/api/v1/search", {
    method: "POST", headers: H,
    body: JSON.stringify({platform: "google", query: q})
  }).then(r => r.json());
  const urls = (r.organic || []).slice(0, 10).map(o => o.link || "");
  return {
    query: cseEntry.query,
    scavioResults: (r.organic || []).length,
    topUrls: urls.slice(0, 5),
    hasAiOverview: !!r.ai_overview,
    status: urls.length >= 3 ? "ready" : "review"
  };
}

(async () => {
  const results = [];
  for (const entry of CSE_QUERIES) {
    const result = await migrateQuery(entry);
    results.push(result);
    console.log(`[${result.status.toUpperCase()}] ${result.query} -> ${result.scavioResults} results`);
  }
  const ready = results.filter(r => r.status === "ready").length;
  console.log(`\nMigration ready: ${ready}/${results.length} queries passed parity check`);
})();

Platforms Used

Google

Web search with knowledge graph, PAA, and AI overviews

Frequently Asked Questions

Google Custom Search Engine is being deprecated and teams need to migrate hundreds or thousands of queries to a replacement API before the shutdown deadline. This workflow exports all your CSE queries and configurations, maps CSE parameters to Scavio equivalents, runs parallel tests to validate result quality, switches production traffic once parity is confirmed, and decommissions the old CSE project. Scavio charges $0.005 per credit versus CSE's $5 per 1,000 queries ($0.005 each) but with multi-platform support included at no extra cost.

This workflow uses a manual trigger before cse sunset deadline. One-time migration batch.

This workflow uses the following Scavio platforms: google. Each platform is called via the same unified API endpoint.

Yes. Scavio's free tier includes 250 credits per month with no credit card required. That is enough to test and validate this workflow before scaling it.

Batch Migrate Google CSE Queries to Scavio

Batch migrate Google Custom Search Engine queries to Scavio. Export, map, test, and cut over with zero downtime.