Tutorial

How to Replace Tavily with Scavio (Migration Guide)

Step-by-step migration from Tavily to Scavio: endpoint mapping, response shape adapter, and drop-in wrapper for LangChain users.

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.

Text
# Tavily
POST https://api.tavily.com/search
# Scavio
POST https://api.scavio.dev/api/v1/search

Step 2: Map request body

Tavily's query is the same field. api_key moves to x-api-key header.

Text
# 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.

Python
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.

Python
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.

Python
from langchain.tools import Tool
scavio_tool = Tool.from_function(tavily_search, name='web_search', description='Web search')

Python Example

Python
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

JavaScript
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

JSON
Zero code changes downstream. Typical migration: 30-60 minutes. Cost reduction reported by users: 40-70% at same call volume.

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 Tavily integration. Python 3.10+ or Node 20+. A Scavio API key. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 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

Step-by-step migration from Tavily to Scavio: endpoint mapping, response shape adapter, and drop-in wrapper for LangChain users.