Tutorial

How to Replace Google Programmable Search Engine

Migrate from Google Programmable Search Engine before the Jan 2027 shutdown. Drop-in replacement with structured results.

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

Python
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

JavaScript
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

JSON
Python Tutorial - W3Schools: https://www.w3schools.com/python/
The Python Tutorial: https://docs.python.org/3/tutorial/
...

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Existing PSE integration. Python 3.8+ or Node.js 18+. Scavio API key. A Scavio API key gives you 250 free credits per month.

Yes. The free tier includes 250 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Migrate from Google Programmable Search Engine before the Jan 2027 shutdown. Drop-in replacement with structured results.