Pi Coding Agent Search: Ketch, SearXNG, APIs Compared
Pi Coding Agent search tool comparison: Ketch for URL extraction, SearXNG for privacy, MCP search APIs for multi-platform reliability. Setup code for each.
Pi Coding Agent supports three search tool categories: built-in Ketch (web extraction), self-hosted SearXNG (meta-search), and third-party search APIs via MCP. For coding agents that need documentation lookups and library comparisons, MCP-connected search APIs deliver the most consistent structured results. SearXNG works for privacy-focused setups but gets blocked under sustained load.
Tool comparison
Tool | Type | Cost | Reliability | Best for
Ketch | Web extract | Built-in | Good | Single URL extraction
SearXNG | Meta-search | Free | 60-80% | Privacy, low volume
Scavio MCP | Search API | $0.005/q | 99%+ | Multi-platform search
Tavily MCP | Search API | Free 1K/mo | 90%+ | Summarized resultsConfigure Scavio MCP in Pi
{
"mcpServers": {
"scavio": {
"url": "https://mcp.scavio.dev/mcp",
"headers": {
"x-api-key": "YOUR_KEY"
}
}
}
}Common Pi agent search patterns
import requests
def search_docs(library_name: str) -> list:
"""Search for library documentation and examples."""
resp = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": "YOUR_KEY"},
json={
"query": f"{library_name} documentation examples 2026",
"num_results": 5
}
)
data = resp.json()
return [
{"title": r["title"], "url": r["url"], "snippet": r.get("snippet", "")}
for r in data.get("organic_results", [])
]
def compare_libraries(lib1: str, lib2: str) -> dict:
"""Compare two libraries using search data."""
resp = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": "YOUR_KEY"},
json={
"query": f"{lib1} vs {lib2} comparison 2026",
"num_results": 10
}
)
data = resp.json()
return {
"query": f"{lib1} vs {lib2}",
"results": data.get("organic_results", [])[:5],
"people_also_ask": data.get("people_also_ask", [])
}
# Example: Pi agent researching database options
docs = search_docs("drizzle orm")
comparison = compare_libraries("drizzle", "prisma")
When Ketch beats search API
Ketch is better when you know the exact URL and need to extract its content. Search APIs are better when you need to find which URL has the answer. Most coding agent tasks need both: search to find the right page, then extract to get the full content.
// Pi agent workflow: search then extract
async function researchTopic(topic) {
// Step 1: Search for relevant pages
const searchResp = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST",
headers: {
"x-api-key": process.env.SCAVIO_KEY,
"Content-Type": "application/json"
},
body: JSON.stringify({
query: topic,
num_results: 5
})
});
const searchData = await searchResp.json();
const topUrls = searchData.organic_results
?.slice(0, 3)
.map(r => r.url) || [];
// Step 2: Use Ketch or extract endpoint for full content
// This is where Pi's built-in Ketch shines
return {
searchResults: searchData.organic_results?.slice(0, 5),
urlsToExtract: topUrls
};
}
Recommendation by use case
- Documentation lookup: Search API (finds latest docs across versions)
- Library comparison: Search API (aggregates community opinions)
- Code example extraction: Ketch (extracts from known URL)
- Error debugging: Search API (finds Stack Overflow, GitHub issues)
- Privacy-sensitive queries: SearXNG (no data sent to third parties)