Vercel AI SDK Integration
Scavio ships as a set of ready-made tools for the Vercel AI SDK. Import the tools from @scavio/ai-sdk and pass them to generateText or streamText to give any AI SDK agent real-time search across Google, YouTube, Reddit, Amazon, Walmart, TikTok, and Instagram — plus scavio_extract, which reads any URL. A cost-effective Tavily and SerpAPI alternative, with one package, one API key, and no custom HTTP code.
13 curated tools, drop-in
scavioTools() into generateText or streamText and your model gets 13 tools — 12 across seven platforms, plus the core extract endpoint — each with a typed Zod schema.Introduction
@scavio/ai-sdk exposes Scavio endpoints as standard AI SDK tool() objects with typed Zod input schemas. Pass scavioTools() for the full set, or import individual factories to expose a lean tool list to the model. You need Node.js 18 or later and a Scavio API key from dashboard.scavio.dev.
The scavio JS SDK is bundled and called under the hood — it handles auth, rate limiting, and request formatting, and returns each result to the model as the raw Scavio JSON response.
This package is a curated subset, by design
@scavio/ai-sdk ships 13 tools chosen for agent use rather than one per endpoint. The full Scavio API is far larger — 50 platforms, including the Extract endpoint — adding X, LinkedIn, TikTok Shop, eBay, Target, Home Depot, Zillow, Redfin, Booking.com, Airbnb, Tripadvisor, Yelp, Indeed, Glassdoor, the app stores, SEC EDGAR, Companies House, G2, Capterra, Google Ads Transparency, the Meta Ad Library, Threads, Kuaishou and the Google verticals (Maps, Shopping, Flights, Hotels, Trends, AI Mode). To reach all of it, point your agent at the Scavio MCP server at mcp.scavio.dev, or call the scavio JS SDK directly — nothing to vendor either way.Step-by-Step Integration Guide
Step 1: Install
npm install @scavio/ai-sdk ai zodai and zod are peer dependencies; the scavio JS SDK is bundled and called under the hood. Requires Node.js 18 or later.
Step 2: Set your API key
Get a key at dashboard.scavio.dev (free credits, no card), then set it as an environment variable:
export SCAVIO_API_KEY=sk_live_your_keyEach tool factory reads SCAVIO_API_KEY from the environment. You can also pass it explicitly: scavioSearch({ apiKey: "sk_live_..." }).
Step 3: Basic usage
import { generateText, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
import { scavioTools } from "@scavio/ai-sdk";
const { text } = await generateText({
model: openai("gpt-5.5"),
tools: scavioTools(),
stopWhen: stepCountIs(3),
prompt: "Find the official GitHub repo of the Agno framework and summarize it",
});
console.log(text);Available Tools
scavioTools() returns all 13 tools keyed by name, ready to spread into the tools option. Or import factories individually.
| Factory | Tool name | What it does | Credits |
|---|---|---|---|
scavioExtract | scavio_extract | Read any URL as Markdown, plain text, or raw HTML | 1 / 1 / 2 by mode |
scavioSearch | scavio_search | Google web search | 1 |
scavioYoutubeSearch | scavio_youtube_search | YouTube videos, channels, and playlists | 2 |
scavioYoutubeVideo | scavio_youtube_video | Video details: views, description, chapters, captions | 1 |
scavioYoutubeTranscript | scavio_youtube_transcript | Transcript as plain text or timed SRT subtitles | 8 |
scavioYoutubeComments | scavio_youtube_comments | Comments on a video, with pagination | 1 |
scavioYoutubeChannel | scavio_youtube_channel | Channel details: subscribers, video and view counts, links | 1 |
scavioRedditSearch | scavio_reddit_search | Reddit post search with cursor pagination | 1 |
scavioAmazonSearch | scavio_amazon_search | Amazon product search across marketplaces | 1 |
scavioAmazonOffers | scavio_amazon_offers | Every seller offer for one ASIN, including the buy box | 1 |
scavioWalmartSearch | scavio_walmart_search | Walmart product search | 1 |
scavioTiktokSearch | scavio_tiktok_search | TikTok video search by keyword | 1 |
scavioInstagramSearch | scavio_instagram_search | Instagram user search by keyword | 10 |
Every tool is also exported as its own factory, so you can expose a lean tool list to the model:
import { generateText, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
import { scavioSearch, scavioAmazonSearch } from "@scavio/ai-sdk";
const { text } = await generateText({
model: openai("gpt-5.5"),
tools: {
scavio_search: scavioSearch({ maxResults: 5 }),
scavio_amazon_search: scavioAmazonSearch(),
},
stopWhen: stepCountIs(3),
prompt: "Compare prices for a mechanical keyboard on Amazon",
});Each factory accepts { apiKey?, maxResults?, ...ScavioConfig }. maxResults trims long results arrays before they reach the model (defaults to 10), keeping token usage down. It does not apply to scavio_extract, which returns page content rather than a result list.
Search, then read
scavio_extract is what makes the curated set self-sufficient: the agent searches with one tool, then reads any URL the result set points at — including pages on platforms this package does not wrap.
import { generateText, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
import { scavioSearch, scavioExtract } from "@scavio/ai-sdk";
const { text } = await generateText({
model: openai("gpt-5.5"),
tools: {
scavio_search: scavioSearch({ maxResults: 5 }),
scavio_extract: scavioExtract(),
},
stopWhen: stepCountIs(4),
prompt: "Find the Bun 2.0 release notes, open the page, and list the breaking changes.",
});format is markdown (default), text, or html. mode sets the fetch tier and the price: normal (default) is a plain fetch, advanced renders the page in a browser for JS-built sites, and ultra routes through residential proxies for the hardest bot walls. Only a successful read is billed.
Advanced Example
Stream a multi-step research run: the model chains web and Reddit searches on its own, then narrates its findings token by token.
import { streamText, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
import { scavioTools } from "@scavio/ai-sdk";
const result = streamText({
model: openai("gpt-5.5"),
tools: scavioTools(),
stopWhen: stepCountIs(5),
system: "You are a research assistant. Use Scavio for fresh web data and cite sources.",
prompt: "Research Tavily alternatives: check the web, then see what developers on Reddit say.",
});
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}The agent picks scavio_search and scavio_reddit_search as it goes, up to the stepCountIs(5) budget — you never wire up that routing yourself.
How it works
Each tool is a standard AI SDK tool() with a typed Zod input schema, so the model gets accurate argument hints and the SDK validates calls before they run. Calls go through the scavio JS SDK, which handles auth, rate limiting, and request formatting. Tool results are returned to the model as the raw Scavio JSON response.
Credit costs
Costs are not uniform, and each tool states its own in the description the model sees. Most calls cost 1 credit, including Google search, Reddit search, both Amazon tools, Walmart and TikTok. YouTube search costs 2 and scavio_youtube_transcript costs 8. Instagram user search costs 10. scavio_extract is priced by the mode you ask for — 1 on normal and advanced, 2 on ultra — not per call. See the rate limits reference for plan limits and the errors reference for retry guidance.
Amazon changed (breaking, 0.4.0)
domain is replaced by country, a two-letter marketplace code (us, gb — the UK is gb, not uk — de, jp, ...). sort_by, pages, category_id, merchant_id, language, currency, device, zip_code and autoselect_variant are gone. The marketplace ignored all of them, so they were removed rather than kept as silent no-ops — rank and filter results yourself.Benefits of Scavio + Vercel AI SDK
- Drop-in tools: spread
scavioTools()intogenerateTextorstreamTextand go. - Typed Zod schemas: accurate argument hints for the model and validated calls before they run.
- Curated, not exhaustive: 13 tools over seven platforms plus Extract, short enough for a model to route over reliably — with the MCP server and the JS SDK there when you need all 31 platforms.
- Search, then read:
scavio_extractturns any URL a search returns into clean Markdown, with no headless browser to run. - Cost-effective: most calls cost a single credit — a Tavily and SerpAPI alternative with broader platform coverage.
Next Steps
- Scavio API quickstart — keys, credits, and your first request
- Google Search API reference — the endpoint behind
scavio_search - Extract API reference — the endpoint behind
scavio_extract - MCP Integration — every Scavio endpoint as a tool
- JavaScript SDK reference — the client these tools call, with every platform namespace
- @scavio/ai-sdk on npm
- Vercel AI SDK documentation
- scavio JS SDK on npm