DEV Community

ScaffDev
ScaffDev

Posted on

How to Add Web Search to Your AI Agent — No API Key Needed

Give Your AI Agent Eyes on the Web

Building an AI agent that needs to search the web? Here's how to add search capability in under 5 minutes using Scaff Search — a free meta-search API.

The Simplest Integration

import requests

def search_web(query, limit=10):
    resp = requests.get(
        "https://search.scaff.dev/api/search",
        params={"q": query, "limit": limit}
    )
    return resp.json()["results"]

results = search_web("latest AI news 2026")
for r in results:
    print(f"- {r['title']}: {r['url']}")
Enter fullscreen mode Exit fullscreen mode

That's it. No signup. No API key. No billing.

For LangChain Agents

from langchain.tools import Tool
import requests

def scaff_search(query: str) -> str:
    resp = requests.get(
        "https://search.scaff.dev/api/search",
        params={"q": query, "limit": 5}
    )
    results = resp.json()["results"]
    return "\n".join(
        f"{r['title']}: {r['url']}" for r in results
    )

search_tool = Tool(
    name="web_search",
    description="Search the web for current information",
    func=scaff_search
)
Enter fullscreen mode Exit fullscreen mode

For MCP-Compatible Agents (Claude, ChatGPT)

Scaff Search has a native MCP server:

{
  "mcpServers": {
    "scaff-search": {
      "url": "https://search.scaff.dev/mcp"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

This gives your agent a web_search tool automatically.

For JavaScript/TypeScript Agents

async function searchWeb(query: string, limit = 10) {
  const resp = await fetch(
    `https://search.scaff.dev/api/search?q=${encodeURIComponent(query)}&limit=${limit}`
  );
  const data = await resp.json();
  return data.results;
}
Enter fullscreen mode Exit fullscreen mode

For curl/Shell Scripts

curl -s "https://search.scaff.dev/api/search?q=python+web+scraping" | jq '.results[] | .title'
Enter fullscreen mode Exit fullscreen mode

Why Use This?

Feature Scaff Search Google API SerpAPI
Price Free $5/1K queries $50/mo
API Key Not needed Required Required
Rate Limit None 100/day free 5K/mo
Engines 10+ 1 1
MCP Support Yes No No

Discovery Endpoints


Try it: curl https://search.scaff.dev/api/search?q=hello+world

Full Documentation

Top comments (0)