ai newsDi., 1. Dez.

Websuche fuer KI-Agenten ohne API-Key

Ein Leitfaden zeigt, wie sich einer KI-Agent-Anwendung in wenigen Minuten Suchfaehigkeit per Meta-Suche hinzufuegen laesst. Genutzt wird die kostenlose API von Scaff Search.

dev.toSonntag 15:47 · 29.11.DE2 Min. Lesezeit
Bild: dev.to

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.

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.

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.

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 OpenAPI: https://search.scaff.dev/openapi.json MCP: https://search.scaff.dev/mcp ARD: https://search.scaff.dev/.well-known/ard.json AI Plugin: https://search.scaff.dev/.well-known/ai-plugin.json Try it: curl https://search.scaff.dev/api/search?q=hello+world

Originaltitel: How to Add Web Search to Your AI Agent — No API Key NeededQuelle: dev.to (dev.to). Original öffnen