Tavily popularized agent-first search in 2023-2024, but by 2026 teams are migrating for broader platform coverage and lower per-call pricing. This tutorial is a drop-in migration guide: endpoint mapping, response shape adapter, and a Tavily-compatible wrapper for LangChain users.
Prerequisites
- Existing Tavily integration
- Python 3.10+ or Node 20+
- A Scavio API key
Walkthrough
Step 1: Map endpoints
Tavily /search maps to Scavio /search. Tavily /extract maps to Scavio /extract.
# Tavily
POST https://api.tavily.com/search
# Scavio
POST https://api.scavio.dev/api/v1/searchStep 2: Map request body
Tavily's query is the same field. api_key moves to x-api-key header.
# Tavily: {"api_key": "...", "query": "foo"}
# Scavio: headers={'x-api-key': '...'}, body={'query': 'foo'}Step 3: Write an adapter
Normalize Scavio response to Tavily's shape if you want zero code changes downstream.
def tavily_shape(scavio_json):
return {
'results': [
{'url': r['link'], 'title': r['title'], 'content': r.get('snippet', '')}
for r in scavio_json.get('organic_results', [])
]
}Step 4: Drop-in replacement
One function preserves your call sites.
import requests, os
def tavily_search(query):
r = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': os.environ['SCAVIO_API_KEY']},
json={'query': query})
return tavily_shape(r.json())Step 5: Swap the LangChain tool
Replace TavilySearchResults with a custom Scavio tool.
from langchain.tools import Tool
scavio_tool = Tool.from_function(tavily_search, name='web_search', description='Web search')Python Example
import os, requests
API_KEY = os.environ['SCAVIO_API_KEY']
def tavily_search(query):
r = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': API_KEY},
json={'query': query})
d = r.json()
return {'results': [{'url': x['link'], 'title': x['title'], 'content': x.get('snippet', '')} for x in d.get('organic_results', [])]}
print(tavily_search('anthropic sonnet 4.7 release'))JavaScript Example
const API_KEY = process.env.SCAVIO_API_KEY;
export async function tavilySearch(query) {
const r = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ query })
});
const d = await r.json();
return { results: (d.organic_results || []).map(x => ({ url: x.link, title: x.title, content: x.snippet })) };
}Expected Output
Zero code changes downstream. Typical migration: 30-60 minutes. Cost reduction reported by users: 40-70% at same call volume.