Mastra Integration
Scavio ships as a tool package for Mastra, the TypeScript agent framework. Install mastra-scavio, hand the tools to any Mastra Agent, and it gets real-time search across Google, YouTube, Amazon, Walmart, Reddit, TikTok, and Instagram — one package, one API key, and a cost-effective Tavily and SerpAPI alternative.
Type-safe search for TypeScript agents
createScavioTools() returns Scavio's endpoints as Mastra tools you can pass straight to an Agent — broader platform coverage than Tavily or SerpAPI, at a fraction of the cost.Introduction
Mastra is a TypeScript framework for building agents, workflows, and RAG apps. The mastra-scavio package wraps the Scavio API as tools built with Mastra's createTool(), each returning the structured Scavio JSON response. Grab all of them at once with createScavioTools(), or import individual tools when you want a lean set.
Step-by-Step Integration Guide
Step 1: Install
Requires Node.js 20.9 or later and a Mastra project (@mastra/core):
npm install mastra-scavio @mastra/core zodStep 2: Set your API key
Get a key at dashboard.scavio.dev (new accounts get free credits, no credit card), then set it as an environment variable:
export SCAVIO_API_KEY=sk_live_your_keyThe tools read SCAVIO_API_KEY from the environment. You can also pass it explicitly: createScavioTools({ apiKey: "sk_live_..." }).
Step 3: Basic usage
createScavioTools() returns all Scavio tools as a keyed object you can pass straight to an agent:
import { Agent } from "@mastra/core/agent";
import { createScavioTools } from "mastra-scavio";
export const agent = new Agent({
id: "web-search-agent",
name: "Web Search Agent",
model: "openai/gpt-5.5",
instructions: "Search the web, shopping sites, and social platforms with Scavio.",
tools: createScavioTools(), // reads SCAVIO_API_KEY
});Available Tools
Each tool is created with Mastra's createTool() and returns the structured Scavio JSON response.
| Provider | Tools |
|---|---|
scavioGoogleSearch | |
| Amazon | scavioAmazonSearch, scavioAmazonProduct |
| Walmart | scavioWalmartSearch, scavioWalmartProduct |
| YouTube | scavioYoutubeSearch, scavioYoutubeMetadata |
scavioRedditSearch, scavioRedditPost | |
| TikTok | scavioTiktokSearch, scavioTiktokProfile |
scavioInstagramSearch, scavioInstagramProfile |
Most calls cost 1 credit. Reddit and Instagram cost 2 credits, and Google costs 2 when light_request is not set. See the rate limits reference for plan limits and the errors reference for retry guidance.
Advanced Example
Import just the tools you need instead of the full set:
import { Agent } from "@mastra/core/agent";
import { createScavioGoogleSearchTool, createScavioRedditSearchTool } from "mastra-scavio";
export const agent = new Agent({
id: "research-agent",
model: "openai/gpt-5.5",
instructions: "Research with Google and Reddit before answering, and cite sources.",
tools: {
googleSearch: createScavioGoogleSearchTool(),
redditSearch: createScavioRedditSearchTool(),
},
});Every endpoint via MCP
For the full Scavio API (33 endpoints) with no install, point Mastra's MCP client at the hosted Scavio server:
import { MCPClient } from "@mastra/mcp";
const mcp = new MCPClient({
id: "scavio",
servers: {
scavio: {
url: new URL("https://mcp.scavio.dev/mcp"),
requestInit: { headers: { "x-api-key": process.env.SCAVIO_API_KEY! } },
},
},
});
const tools = await mcp.listTools();Benefits of Scavio + Mastra
- TypeScript-native: tools built with
createTool()and typed with zod, ready for any MastraAgent. - Selective imports: pull the full set with
createScavioTools()or just the tools you need. - Multi-platform: web, video, shopping, and social behind one API key.
- Cost-effective: most calls cost a single credit — a Tavily and SerpAPI alternative.
Next Steps
- MCP Integration — the full 33-endpoint catalog, no install
- Scavio API quickstart — keys and first request
- Mastra documentation
- mastra-scavio on GitHub
- mastra-scavio on npm