Integrazione OpenAI Agents SDK
Scavio è disponibile come pacchetto di strumenti per l' OpenAI Agents SDK, sia in Python sia in TypeScript. Installa openai-agents-scavio, affida gli strumenti a un Agent e otterrai ricerca in tempo reale su Google, YouTube, Amazon, Walmart, Reddit, TikTok e Instagram — un pacchetto, una chiave API.
Prerequisiti
- L'OpenAI Agents SDK:
openai-agents(Python 3.10+) o@openai/agents(Node 22+). - Una chiave API Scavio da dashboard.scavio.dev (i nuovi account ricevono crediti gratuiti, senza carta di credito).
Installazione
# Python
pip install openai-agents-scavio
# TypeScript
npm install openai-agents-scavio @openai/agents zodImposta la tua chiave API
export SCAVIO_API_KEY=sk_live_your_keyGli strumenti leggono SCAVIO_API_KEY dall'ambiente, oppure puoi passare api_key / { apiKey } alla factory.
Guida rapida (Python)
from agents import Agent, Runner
from openai_agents_scavio import get_scavio_tools
agent = Agent(
name="Search Assistant",
instructions="Search the web, shopping sites, and social platforms with Scavio.",
tools=get_scavio_tools(), # reads SCAVIO_API_KEY
)
result = Runner.run_sync(agent, "Find the top budget laptops on Amazon")
print(result.final_output)Guida rapida (TypeScript)
import { Agent, run } from "@openai/agents";
import { buildScavioTools } from "openai-agents-scavio";
const agent = new Agent({
name: "Search Assistant",
instructions: "Search the web, shopping sites, and social platforms with Scavio.",
tools: buildScavioTools(), // reads SCAVIO_API_KEY
});
const result = await run(agent, "Find the top budget laptops on Amazon");
console.log(result.finalOutput);Abilita solo i provider di cui hai bisogno
# Python
tools = get_scavio_tools(
enable_google=True,
enable_reddit=True,
enable_amazon=False,
enable_walmart=False,
enable_youtube=False,
enable_tiktok=False,
enable_instagram=False,
)// TypeScript
const tools = buildScavioTools({
enableGoogle: true,
enableReddit: true,
enableAmazon: false,
enableWalmart: false,
enableYoutube: false,
enableTiktok: false,
enableInstagram: false,
});Passa all=True (Python) o { all: true } (TypeScript) per registrare ogni strumento indipendentemente dai singoli flag.
Strumenti disponibili
Entrambi i pacchetti espongono 32 strumenti, uno per ciascun endpoint di Scavio, denominati scavio_<provider>_<action> (ad esempio scavio_google_search, scavio_amazon_product, scavio_reddit_post). Ciascuno restituisce la risposta JSON strutturata di Scavio.
| Provider | Strumenti |
|---|---|
scavio_google_search | |
| Amazon | scavio_amazon_search, scavio_amazon_product |
| Walmart | scavio_walmart_search, scavio_walmart_product |
| YouTube | scavio_youtube_search, scavio_youtube_metadata |
scavio_reddit_search, scavio_reddit_post | |
| TikTok | 11 strumenti (profile, posts, video, comments, search, hashtag, followers, ...) |
| 12 strumenti (profile, posts, reels, stories, post, comments, search, followers, ...) |
Usa ogni endpoint tramite MCP
Per l'intera API Scavio senza alcuna installazione, punta l'Agents SDK al server MCP ospitato:
# Python
from agents import Agent
from agents.mcp.server import MCPServerStreamableHttp
server = MCPServerStreamableHttp(
name="scavio",
params={"url": "https://mcp.scavio.dev/mcp", "headers": {"x-api-key": "sk_live_..."}},
)
agent = Agent(name="Search Assistant", mcp_servers=[server])// TypeScript
import { Agent, MCPServerStreamableHttp } from "@openai/agents";
const server = new MCPServerStreamableHttp({
url: "https://mcp.scavio.dev/mcp",
name: "scavio",
requestInit: { headers: { "x-api-key": process.env.SCAVIO_API_KEY! } },
});
const agent = new Agent({ name: "Search Assistant", mcpServers: [server] });Costi in crediti
La maggior parte delle chiamate costa 1 credito. Reddit e Instagram costano 2 crediti, e Google costa 2 a meno che non sia impostato light_request. Consulta il riferimento sui limiti di velocità per i limiti dei piani e il riferimento sugli errori per indicazioni sui tentativi.