Migrating from SerpAPI to a cheaper provider takes 30 minutes of code changes for most projects. The key differences: endpoint URL, auth header format, and response field names. This tutorial shows the exact mapping.
Prerequisites
- Existing SerpAPI integration
- Python 3.8+ or Node.js 18+
- Scavio API key (free 250 credits/mo)
Walkthrough
Step 1: Audit current SerpAPI usage
Grep your codebase for serpapi.com references and document query patterns, platforms used, and monthly volume.
Step 2: Map SerpAPI params to Scavio params
SerpAPI uses 'q' for query, 'location' for geo. Scavio uses 'query' and 'country_code'. Map each parameter.
Step 3: Update request code
Change endpoint to https://api.scavio.dev/api/v1/search, auth to x-api-key header, and params to Scavio format.
Step 4: Adjust response parsing
SerpAPI nests results under 'organic_results'. Scavio uses the same key. Adjust any field name differences.
Step 5: Test and verify
Run parallel requests to both APIs for 10 queries. Compare results to ensure coverage matches your needs.
Python Example
import requests, os
# Old: SerpAPI
# resp = requests.get('https://serpapi.com/search', params={'q': 'crm software', 'api_key': key})
# 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': 'crm software', 'country_code': 'us'})
data = resp.json()
for r in data.get('organic_results', []):
print(f"{r['position']}. {r['title']}")JavaScript Example
const H = {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'};
const resp = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST', headers: H,
body: JSON.stringify({query: 'crm software', country_code: 'us'})
});
const data = await resp.json();
data.organic_results?.forEach((r, i) => console.log(`${i+1}. ${r.title}`));Expected Output
1. Best CRM Software 2026 - Forbes Advisor
2. Top 10 CRM Tools Compared - G2
3. HubSpot CRM - Free CRM Software
...