migrationtavilytutorial

Migrating from Tavily to Scavio: A Step-by-Step Guide

Step-by-step migration from Tavily to Scavio -- API mapping, code changes, and what you gain in SERP structure and platform coverage.

8 min read

Tavily built a solid search API for AI agents, but as your needs grow you may find its limitations -- Google-only coverage, opaque ranking, and pricing per search -- harder to work around. Scavio offers multi-platform search (Google, Amazon, YouTube, Walmart, Reddit) with transparent, structured JSON responses. This guide walks through the migration step by step.

API Mapping: Tavily to Scavio

Tavily uses a single /search endpoint with a JSON body. Scavio uses the same pattern but adds a platform field to support multiple search engines through one API:

Python
# Tavily
response = requests.post(
    "https://api.tavily.com/search",
    json={
        "api_key": "tvly-...",
        "query": "best project management tools",
        "search_depth": "advanced"
    }
)

# Scavio equivalent
response = requests.post(
    "https://api.scavio.dev/api/v1/search",
    headers={"x-api-key": "YOUR_SCAVIO_KEY"},
    json={
        "platform": "google",
        "query": "best project management tools",
        "mode": "full"
    }
)

Key differences: Scavio uses an x-api-key header instead of an API key in the body. The search_depth parameter maps to mode -- "basic" in Tavily becomes"light" in Scavio, and "advanced" becomes"full".

Response Format Differences

Tavily returns results in a results array withtitle, url, content, andscore fields. Scavio returns results underdata.organic with title, link, and snippet:

Python
# Tavily response parsing
for result in tavily_response["results"]:
    print(result["title"], result["url"])

# Scavio response parsing
for result in scavio_response["data"]["organic"]:
    print(result["title"], result["link"])

The main field name changes: url becomeslink, and content becomessnippet. If you have a mapping layer in your code, update these field names and the rest of your application stays unchanged.

What You Gain

Beyond field name changes, Scavio adds capabilities Tavily does not offer:

  • Multi-platform search -- search Amazon, YouTube, Walmart, and Reddit with the same API call pattern
  • Knowledge graph data -- full mode returns Google's knowledge graph, People Also Ask, and related searches
  • Product data -- get structured pricing, reviews, and availability from Amazon and Walmart
  • Video transcripts -- pull timestamped transcripts from YouTube videos
  • MCP support -- connect to Claude, Cursor, and other AI tools with zero code

Updating LangChain Integration

If you use Tavily through LangChain's TavilySearchResultstool, you can replace it with a custom tool that calls Scavio:

Python
from langchain_core.tools import tool
import requests

@tool
def search_web(query: str, platform: str = "google") -> str:
    """Search the web across multiple platforms."""
    response = requests.post(
        "https://api.scavio.dev/api/v1/search",
        headers={"x-api-key": "YOUR_SCAVIO_KEY"},
        json={"platform": platform, "query": query}
    )
    results = response.json()["data"]["organic"]
    return "\n".join(
        f"{r['title']}: {r['link']}" for r in results[:5]
    )

This gives your LangChain agent the same search capability plus access to additional platforms through the platform parameter.

MCP as an Alternative

If you are using Tavily primarily with AI assistants like Claude, you can skip the code integration entirely. Scavio's MCP server gives your assistant direct access to all search tools without writing any wrapper code. See the MCP integration guide for setup instructions.

Migration Checklist

  • Replace the Tavily API URL with https://api.scavio.dev/api/v1/search
  • Move the API key from the request body to the x-api-key header
  • Add platform: "google" to request bodies
  • Update response parsing: results to data.organic, url to link
  • Replace search_depth with mode ("light" or "full")
  • Test with your existing queries to verify result quality