Solo developers building AI agents often end up with 5+ search API integrations: one for Google, one for Reddit, one for YouTube, one for product data, one for news. Each has its own authentication, rate limits, billing, and response format. This tutorial shows how to consolidate them into a single Scavio integration, cutting integration surface from 5 vendors to 1.
Prerequisites
- An existing project with multiple search API integrations
- Python 3.8+ or Node.js 18+
- A Scavio API key from scavio.dev
Walkthrough
Step 1: Audit your current integrations
List all search-related API integrations in your project.
# Common integrations to consolidate:
# 1. SerpAPI / Serper / Google Custom Search -> Scavio google
# 2. Reddit API / PRAW -> Scavio reddit
# 3. YouTube Data API -> Scavio youtube
# 4. Amazon PA API / Keepa / Rainforest -> Scavio amazon
# 5. News API / Google News scraper -> Scavio google (with news query)Step 2: Create a unified search function
One function that handles all platforms with a consistent interface.
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}
URL = 'https://api.scavio.dev/api/v1/search'
def search(query: str, platform: str = 'google') -> list:
resp = requests.post(URL, headers=H,
json={'platform': platform, 'query': query}, timeout=10)
return resp.json().get('organic', [])
# All platforms, same function, same response format:
google = search('best crm 2026', 'google')
reddit = search('crm recommendations', 'reddit')
youtube = search('crm tutorial', 'youtube')
amazon = search('crm book', 'amazon')
walmart = search('office supplies', 'walmart')Step 3: Replace old integrations one by one
Swap each existing API call with the unified search function.
# BEFORE (SerpAPI):
# from serpapi import GoogleSearch
# results = GoogleSearch({'q': query, 'api_key': SERPAPI_KEY}).get_dict()
# AFTER:
results = search(query, 'google')
# BEFORE (PRAW for Reddit):
# import praw
# reddit = praw.Reddit(client_id=..., client_secret=...)
# posts = reddit.subreddit('all').search(query)
# AFTER:
posts = search(query, 'reddit')
# BEFORE (YouTube Data API):
# from googleapiclient.discovery import build
# yt = build('youtube', 'v3', developerKey=YT_KEY)
# results = yt.search().list(q=query, part='snippet').execute()
# AFTER:
videos = search(query, 'youtube')Step 4: Remove old dependencies and API keys
Clean up your project after migration.
# Remove from requirements.txt / package.json:
# google-search-results (SerpAPI)
# praw (Reddit)
# google-api-python-client (YouTube)
# keepa / rainforest-api (Amazon)
# newsapi-python (News)
# Remove environment variables:
# SERPAPI_KEY, REDDIT_CLIENT_ID, REDDIT_CLIENT_SECRET,
# YOUTUBE_API_KEY, KEEPA_API_KEY, NEWS_API_KEY
# Keep only: SCAVIO_API_KEY
pip install requests # the only dependency you needPython Example
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}
def search(query, platform='google'):
return requests.post('https://api.scavio.dev/api/v1/search',
headers=H, json={'platform': platform, 'query': query},
timeout=10).json().get('organic', [])
# One function replaces 5 integrationsJavaScript Example
const H = {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'};
async function search(query, platform = 'google') {
const r = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST', headers: H, body: JSON.stringify({platform, query})
});
return (await r.json()).organic || [];
}
// One function replaces 5 integrationsExpected Output
A single unified search function replacing 5 separate API integrations. One API key, one response format, one billing page.