An r/sideprojects user mentioned spending $10/week on Tavily for their vibe-coded app -- a prototype built quickly with AI assistance. At $0.008/credit, that is about 1,250 searches/week. Scavio at $0.005/credit would cost $6.25 for the same volume. This tutorial shows how to add (or swap) a search data layer in a vibe-coded app without restructuring the whole thing.
Prerequisites
- Scavio API key
- An existing app (any framework)
- Basic understanding of HTTP requests
Walkthrough
Step 1: Create a search adapter module
A single module that abstracts the search provider. If you are currently using Tavily, this drops in as a replacement.
# search_adapter.py
import requests, os
SCAVIO_KEY = os.environ.get('SCAVIO_API_KEY', '')
TAVILY_KEY = os.environ.get('TAVILY_API_KEY', '')
def search(query, provider='scavio'):
if provider == 'scavio':
data = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': SCAVIO_KEY},
json={'platform': 'google', 'query': query}).json()
return [{'title': r.get('title', ''), 'url': r.get('link', ''),
'snippet': r.get('snippet', '')} for r in data.get('organic_results', [])]
elif provider == 'tavily':
data = requests.post('https://api.tavily.com/search',
json={'api_key': TAVILY_KEY, 'query': query}).json()
return [{'title': r.get('title', ''), 'url': r.get('url', ''),
'snippet': r.get('content', '')} for r in data.get('results', [])]
return []Step 2: Add multi-platform search capability
Vibe-coded apps usually only search Google. Add Reddit and YouTube for richer data.
# Extend the adapter with platform support
def multi_search(query, platforms=None):
if platforms is None:
platforms = ['google']
results = {}
for platform in platforms:
data = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': SCAVIO_KEY},
json={'platform': platform, 'query': query}).json()
results[platform] = data.get('results', []) or data.get('organic_results', [])
return results
# Now your app can search Google + Reddit + YouTube with one key
# Instead of integrating 3 separate APIsStep 3: Replace Tavily calls with the adapter
Find-and-replace Tavily calls in your vibe-coded app.
# Before (Tavily at $0.008/credit):
# data = tavily_client.search(query)
# After (Scavio at $0.005/credit):
from search_adapter import search
data = search(query) # defaults to scavio
# Or, if you want to keep Tavily as fallback:
data = search(query, provider='scavio')
if not data:
data = search(query, provider='tavily')Step 4: Add cost tracking
Track how much your app spends on search.
import json, datetime
def tracked_search(query, platform='google'):
results = search(query)
with open('search_costs.jsonl', 'a') as f:
f.write(json.dumps({
'ts': datetime.datetime.now().isoformat(),
'query': query,
'platform': platform,
'cost': 0.005,
'result_count': len(results)
}) + '\n')
return results
# Weekly cost report
def weekly_cost():
total = 0
with open('search_costs.jsonl') as f:
for line in f:
total += json.loads(line)['cost']
print(f'Total search cost: ${total:.2f}')Python Example
# Cost comparison for 1,250 searches/week:
# Tavily: 1,250 x $0.008 = $10.00/week
# Scavio: 1,250 x $0.005 = $6.25/week
# Savings: $3.75/week = $195/year
#
# Plus: Scavio adds Reddit, YouTube, Amazon, Walmart
# with the same API key (Tavily is Google-only)JavaScript Example
// search-adapter.js
export async function search(query, platform = 'google') {
const res = 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({platform, query})
});
const data = await res.json();
return data.organic_results || data.results || [];
}
// Replace: const data = await tavily.search(query)
// With: const data = await search(query)Expected Output
Drop-in search adapter module. Replaces Tavily ($0.008/credit) with Scavio ($0.005/credit). Adds multi-platform search (Reddit, YouTube, Amazon, Walmart). Cost tracking with JSONL log.