API Task

AI Agent Grounding API

Ground AI agents with real-time search data from Google, Amazon, and Reddit. Prevent hallucinations with structured, fresh results via a single API.

Large language models hallucinate when they lack current information. Grounding AI agents with real-time search data solves this by providing verified, up-to-date facts at inference time. Scavio's API returns structured search results from Google, Amazon, YouTube, Walmart, and Reddit through a single integration. Use it as a tool in LangChain, CrewAI, or any agent framework to give your AI access to live web data.

API Endpoint

POST https://api.scavio.dev/api/v1/search
Platforms
GoogleAmazonRedditYouTubeWalmart

Python Example

Python
import requests

API_KEY = "YOUR_API_KEY"

def search_web(query: str, country: str = "us") -> dict:
    """Tool function for AI agent grounding."""
    response = requests.post(
        "https://api.scavio.dev/api/v1/search",
        headers={
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json",
        },
        json={"query": query, "country_code": country},
    )
    response.raise_for_status()
    data = response.json()

    # Format results for the LLM context window
    results = []
    for r in data.get("organic_results", [])[:5]:
        results.append({
            "title": r["title"],
            "snippet": r.get("snippet", ""),
            "url": r["link"],
        })

    # Include knowledge graph if available
    kg = data.get("knowledge_graph")
    if kg:
        results.insert(0, {
            "title": kg.get("title", ""),
            "snippet": kg.get("description", ""),
            "url": kg.get("website", ""),
            "type": "knowledge_graph",
        })

    return {"query": query, "results": results}

# Example: ground a question
context = search_web("latest openai o3 model capabilities")
print(f"Found {len(context['results'])} grounding results")

JavaScript Example

JavaScript
const API_KEY = "YOUR_API_KEY";

async function searchWeb(query, country = "us") {
  const response = await fetch("https://api.scavio.dev/api/v1/search", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query, country_code: country }),
  });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  const data = await response.json();

  // Format results for the LLM context window
  const results = (data.organic_results || []).slice(0, 5).map((r) => ({
    title: r.title,
    snippet: r.snippet || "",
    url: r.link,
  }));

  // Include knowledge graph if available
  if (data.knowledge_graph) {
    results.unshift({
      title: data.knowledge_graph.title || "",
      snippet: data.knowledge_graph.description || "",
      url: data.knowledge_graph.website || "",
      type: "knowledge_graph",
    });
  }

  return { query, results };
}

// Example: ground a question
const context = await searchWeb("latest openai o3 model capabilities");
console.log(`Found ${context.results.length} grounding results`);

Expected Response

JSON
{
  "search_metadata": {
    "status": "success",
    "query": "latest openai o3 model capabilities",
    "country_code": "us"
  },
  "knowledge_graph": {
    "title": "OpenAI o3",
    "type": "AI model",
    "description": "o3 is OpenAI's latest reasoning model released in 2025, featuring advanced multi-step reasoning capabilities."
  },
  "organic_results": [
    {
      "position": 1,
      "title": "OpenAI o3: Capabilities, Benchmarks, and What's New",
      "link": "https://example.com/openai-o3-review",
      "snippet": "OpenAI o3 achieves state-of-the-art performance on ARC-AGI, GPQA, and SWE-bench..."
    },
    {
      "position": 2,
      "title": "o3 vs o1: What Changed in OpenAI's Reasoning Models",
      "link": "https://example.com/o3-vs-o1",
      "snippet": "The o3 model introduces deliberative alignment and improved tool use..."
    }
  ]
}

Benefits

  • Prevent AI hallucinations with real-time, verified search data
  • Single API covers Google, Amazon, YouTube, Walmart, and Reddit
  • Structured JSON is ready to inject into LLM context windows
  • Works with LangChain, CrewAI, MCP, and any HTTP-capable agent
  • Knowledge graph data provides high-confidence factual grounding
  • Fresh results ensure agents have current information, not stale training data

Frequently Asked Questions

Send a POST request to https://api.scavio.dev/api/v1/search with your query and API key. The response is structured JSON containing the data you need. No scraping, no proxies, no browser automation.

This task uses data from Google, Amazon, Reddit, YouTube, Walmart. Scavio provides unified API access to Google, Amazon, YouTube, Walmart, and Reddit through a single integration.

Yes. Scavio's free tier includes 250 credits per month with no credit card required. That is enough to prototype and test this workflow before scaling up.

Scavio is a REST API that works with any HTTP client. This page includes Python and JavaScript examples, but you can use any language that can make HTTP requests. There is also a native LangChain package and an MCP server.

AI Agent Grounding API

Ground AI agents with real-time search data from Google, Amazon, and Reddit. Prevent hallucinations with structured, fresh results via a single API.