Free Web Search API — Search the Web via REST
Search the web programmatically via a simple REST API. Get titles, URLs, and snippets from web results. Batch multi-query search, text extraction for AI agents. No search provider API keys needed. No signup required.
Why Use a Web Search API?
AI agents, chatbots, and automation scripts need to search the web. But getting programmatic search results is harder than it should be. Google Custom Search charges $5 per 1,000 queries. SerpAPI starts at $50/month. Bing Search API requires Azure credentials and a credit card.
The Agent Search API gives you web search results through a simple REST endpoint — no search provider API keys, no OAuth flows, no Azure subscriptions. Just send a query, get back titles, URLs, and snippets.
It powers search for AI agents that need real-time web information: RAG pipelines, research assistants, fact-checking systems, and competitive intelligence tools.
Simple REST API
GET or POST a query, get structured JSON results with titles, URLs, snippets, and hostnames.
Batch Search
Search up to 5 queries in a single request with /api/search/multi. Parallel execution, one response.
Text Extraction
The /api/search/extract endpoint returns combined text — perfect for feeding into LLMs.
No Provider Keys
No Google API key. No Azure subscription. No SerpAPI account. The API handles search provider access internally.
Up to 20 Results
Get up to 20 results per query with titles, URLs, snippets, and source hostnames.
Automatic Fallback
Dual search engine with automatic failover. If the primary engine is down, results come from the backup.
Quick Start
Search the web in a single request:
# Simple GET request
curl "https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search?q=best+javascript+frameworks+2026"
# With max results
curl "https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search?q=rust+vs+go+performance&max=15"
# POST request
curl -X POST https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search \
-H "Content-Type: application/json" \
-d '{"query": "machine learning API tutorial", "maxResults": 10}'import requests
# Simple search
response = requests.get(
"https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search",
params={"q": "best javascript frameworks 2026", "max": 10}
)
data = response.json()
print(f"Engine: {data['engine']} | Results: {data['count']}")
for result in data["results"]:
print(f" {result['title']}")
print(f" {result['url']}")
print(f" {result['snippet'][:100]}...")
print()const params = new URLSearchParams({
q: "best javascript frameworks 2026",
max: "10"
});
const response = await fetch(
`https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search?${params}`
);
const data = await response.json();
console.log(`Engine: ${data.engine} | Results: ${data.count}`);
for (const result of data.results) {
console.log(` ${result.title}`);
console.log(` ${result.url}`);
console.log(` ${result.snippet?.slice(0, 100)}...`);
console.log();
}Example response:
{
"query": "best javascript frameworks 2026",
"engine": "duckduckgo-html",
"results": [
{
"title": "Top 10 JavaScript Frameworks in 2026 - Dev.to",
"url": "https://dev.to/top-javascript-frameworks-2026",
"snippet": "A comprehensive comparison of React, Vue, Svelte, Solid, and more...",
"hostname": "dev.to"
},
{
"title": "JavaScript Framework Benchmarks 2026",
"url": "https://krausest.github.io/js-framework-benchmark/",
"snippet": "Performance comparison across 50+ frameworks with real DOM...",
"hostname": "krausest.github.io"
}
],
"count": 10,
"noResults": false
}API Reference
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET | /api/search?q=...&max=10 | Optional | Web search via query parameter |
POST | /api/search | Optional | Web search via JSON body |
POST | /api/search/multi | Optional | Batch search — up to 5 queries at once |
POST | /api/search/extract | Optional | Search + combined text for LLM input |
Batch Multi-Query Search
Search up to 5 queries in a single request. All queries execute in parallel, so the total time is roughly the same as a single query.
curl -X POST https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search/multi \
-H "Content-Type: application/json" \
-d '{
"queries": [
"React vs Vue performance 2026",
"TypeScript best practices",
"Node.js alternative Bun"
]
}'import requests
response = requests.post(
"https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search/multi",
json={
"queries": [
"React vs Vue performance 2026",
"TypeScript best practices",
"Node.js alternative Bun"
]
}
)
data = response.json()
for result_set in data["queries"]:
print(f"\n--- {result_set['query']} ({result_set['count']} results) ---")
for r in result_set["results"][:3]:
print(f" {r['title']}: {r['url']}")const response = await fetch(
"https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search/multi",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
queries: [
"React vs Vue performance 2026",
"TypeScript best practices",
"Node.js alternative Bun"
]
})
}
);
const data = await response.json();
for (const resultSet of data.queries) {
console.log(`\n--- ${resultSet.query} (${resultSet.count} results) ---`);
for (const r of resultSet.results.slice(0, 3)) {
console.log(` ${r.title}: ${r.url}`);
}
}Text Extraction for AI Agents
The /api/search/extract endpoint returns search results as a combined text block — ready to feed directly into an LLM as context. This is perfect for RAG (Retrieval-Augmented Generation) pipelines.
curl -X POST https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search/extract \
-H "Content-Type: application/json" \
-d '{"query": "latest AI regulations Europe 2026", "maxResults": 5}'The response includes both structured results and a text field with all results formatted as a readable block:
{
"query": "latest AI regulations Europe 2026",
"engine": "duckduckgo-html",
"results": [...],
"count": 5,
"text": "[1] EU AI Act Implementation Timeline\nhttps://...\nThe European Union's AI Act enters full enforcement...\n\n[2] AI Governance in 2026\nhttps://...\nNew guidelines for high-risk AI systems...\n\n..."
}RAG Pipeline Example
Combine the Search API with the LLM Router API to build a simple RAG system:
import requests
SEARCH_API = "https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search/extract"
LLM_API = "https://agent-gateway-kappa.vercel.app/v1/agent-llm/api/chat"
def search_and_answer(question, provider_key):
"""Search the web, then answer using an LLM with search context."""
# Step 1: Search the web
search = requests.post(SEARCH_API, json={
"query": question,
"maxResults": 5
}).json()
context = search.get("text", "No results found.")
# Step 2: Ask LLM with search context
answer = requests.post(LLM_API, json={
"model": "gpt-4o-mini",
"messages": [
{"role": "system", "content": f"Answer based on these search results:\n\n{context}"},
{"role": "user", "content": question}
],
"provider_key": provider_key,
"max_tokens": 500
}).json()
return {
"question": question,
"answer": answer["choices"][0]["message"]["content"],
"sources": [r["url"] for r in search.get("results", [])],
"tokens": answer.get("usage", {}).get("total_tokens", 0)
}
# Usage
result = search_and_answer(
"What are the best AI coding assistants in 2026?",
provider_key="sk-your-openai-key"
)
print(f"Q: {result['question']}")
print(f"A: {result['answer']}")
print(f"\nSources:")
for url in result["sources"]:
print(f" - {url}")/api/search/multi) with the LLM Router to research multiple topics in parallel, then synthesize the results with a single LLM call.
Use Cases
RAG / Research Agents
Feed real-time web results into LLMs as context. Build research assistants that cite their sources. Search + extract + answer in one pipeline.
Competitive Intelligence
Monitor competitor mentions, pricing changes, and product launches. Batch search 5 competitor names at once and parse the results.
Content Discovery
Find relevant articles, tutorials, and documentation for any topic. Power content curation tools and newsletter generators.
Fact Checking
Verify claims by searching for supporting or contradicting evidence. Cross-reference multiple sources before presenting information.
Comparison: Search APIs
| Feature | Agent Search API | SerpAPI | Google Custom Search | Bing Search API |
|---|---|---|---|---|
| Pricing | Free (30 free, then credits) | $50/mo (5,000 queries) | $5/1,000 queries | $7/1,000 queries |
| Signup Required | No | Yes + billing | Yes + Google Cloud | Yes + Azure |
| Search Provider Keys | None needed | Account key | API key + CX ID | Azure key |
| Batch Search | 5 queries/request | 1 per request | 1 per request | 1 per request |
| Text Extraction | Built-in (/extract) | No | No | No |
| Results per Query | Up to 20 | Up to 100 | 10 | 50 |
| Search Source | DuckDuckGo (privacy-first) | Google SERP | Google (scoped) | Bing |
| Structured Data | Title, URL, snippet, hostname | Full SERP (ads, knowledge graph) | Title, URL, snippet | Title, URL, snippet |
| Fallback Engine | Yes (automatic) | No | No | No |
Advanced: AI Agent Integration
The Search API is designed for AI agents. Here's how to use it as a tool in a LangChain-style agent:
import requests
import json
SEARCH_URL = "https://agent-gateway-kappa.vercel.app/v1/agent-search/api/search"
def web_search(query: str, max_results: int = 5) -> str:
"""Search the web and return formatted results.
Use this tool when you need current information from the web,
to verify facts, or to find URLs for further research.
"""
resp = requests.get(SEARCH_URL, params={"q": query, "max": max_results})
data = resp.json()
if data.get("noResults"):
return f"No results found for: {query}"
results = []
for r in data["results"]:
results.append(f"- {r['title']} ({r['hostname']})\n {r['url']}\n {r['snippet']}")
return f"Search results for '{query}':\n\n" + "\n\n".join(results)
# Use in any agent framework:
# tool = Tool(name="web_search", func=web_search, description="Search the web")
#
# Or call directly:
print(web_search("latest Python 3.14 features"))Frequently Asked Questions
max parameter (GET) or maxResults field (POST) to control how many results you want. Default is 10.X-RateLimit-Remaining and X-RateLimit-Reset headers.Start Searching the Web via API
No signup, no provider keys, no credit card. Just send a query.
Get Your Free API KeyMore Free APIs
The Search API is part of a suite of 39+ free APIs for developers and AI agents:
- Free LLM API — route to OpenAI, Anthropic, Gemini, Groq
- Free Web Scraping API — extract content from any URL
- Free Code Execution API — run Python, JavaScript, Bash
- Free Screenshot API — capture website screenshots
- Free AI Agent APIs — build autonomous agents
- Free Uptime Monitoring API — monitor URLs & get alerts
- Free IP Geolocation API — locate any IP address