Google Programmable Search Engine is disabling web-wide searches by January 2027. Replace it with a structured search API that returns JSON instead of HTML. Migration takes under 20 minutes for most integrations.
Prerequisites
- Existing PSE integration
- Python 3.8+ or Node.js 18+
- Scavio API key
Walkthrough
Step 1: Document current PSE usage
Note your PSE custom search engine ID, query patterns, and how you parse results.
Step 2: Map PSE params to API params
PSE uses cx (engine ID) and q (query). API uses query and country_code. No engine ID needed.
Step 3: Replace HTTP calls
Change from GET googleapis.com/customsearch to POST api.scavio.dev/api/v1/search.
Step 4: Update result parsing
PSE returns items[]. API returns organic_results[] with title, link, snippet, position.
Python Example
import requests, os
# Old: Google PSE
# resp = requests.get('https://www.googleapis.com/customsearch/v1',
# params={'key': pse_key, 'cx': engine_id, 'q': 'python tutorial'})
# New: Scavio
H = {'x-api-key': os.environ['SCAVIO_API_KEY'], 'Content-Type': 'application/json'}
resp = requests.post('https://api.scavio.dev/api/v1/search',
headers=H, json={'query': 'python tutorial', 'country_code': 'us'})
data = resp.json()
for r in data.get('organic_results', []):
print(f"{r['title']}: {r['link']}")JavaScript Example
const resp = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'python tutorial', country_code: 'us'})
});
const data = await resp.json();
data.organic_results?.forEach(r => console.log(`${r.title}: ${r.link}`));Expected Output
Python Tutorial - W3Schools: https://www.w3schools.com/python/
The Python Tutorial: https://docs.python.org/3/tutorial/
...