Why your agent needs search
Every LLM has a knowledge cutoff. When your agent needs to answer "What's the current price of Bitcoin?" or "What are the latest React 19 features?", it's working with stale data. Web search fixes this — your agent can look up anything in real time.
Common use cases:
- Answering questions about current events
- Looking up documentation and API references
- Fact-checking claims with real sources
- Researching topics before generating content
- Finding code examples and solutions
- Add Web Search to Cursor IDE via MCP
Method 1: MCP (fastest — 30 seconds)
If you use Claude Code, Claude Desktop, Cursor, or any MCP-compatible tool, this is the fastest way. One config change, zero code.
Step 1: Get a free API key at contextwire.dev (1,000 queries/month, no credit card).
Step 2: Add to your MCP config:
{
"mcpServers": {
"contextwire": {
"url": "https://contextwire.dev/mcp"
}
}
}
That's it. Your agent now has 5 search tools:
ask— "What is X?" → direct answer with sourcessearch— web search across 105 enginesextract— pull clean text from any URLresearch— search academic papersbatch_search— multiple searches at once- Add Web Search to Cursor IDE via MCP
Your agent will automatically use these tools when it needs to look something up.
Method 2: Direct API (any language)
Works with any programming language that can make HTTP requests.
Ask a question (get a direct answer)
curl "https://contextwire.dev/api/ask" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "What is the current population of Tokyo?"}'
Response:
{
"answer": "Tokyo's population is approximately 13.96 million...",
"source": "Wikipedia, WorldPopulationReview",
"confidence": 0.95,
"sources": [
{"title": "Tokyo - Wikipedia", "url": "https://en.wikipedia.org/wiki/Tokyo"},
{"title": "Tokyo Population 2026", "url": "https://worldpopulationreview.com/..."}
]
}
Search (get ranked results)
curl "https://contextwire.dev/api/search" \
-H "X-API-Key: YOUR_KEY" \
-d '{"q": "rust async tutorial", "profile": "code", "max_results": 5}'
Python example
import requests
API_KEY = "your-key-here"
BASE = "https://contextwire.dev/api"
def ask(question):
r = requests.get(f"{BASE}/ask",
params={"q": question},
headers={"X-API-Key": API_KEY})
return r.json()
def search(query, profile="web"):
r = requests.get(f"{BASE}/search",
params={"q": query, "profile": profile, "format": "json"},
headers={"X-API-Key": API_KEY})
return r.json()
# Use it
answer = ask("What is the latest version of Python?")
print(answer["answer"])
results = search("FastAPI deployment guide", profile="code")
for r in results["results"][:3]:
print(f" {r['title']} — {r['url']}")
Method 3: Node.js SDK
npm install @contextwire/sdk
import { ContextWire } from '@contextwire/sdk';
const cw = new ContextWire('YOUR_API_KEY');
// Ask a question
const answer = await cw.ask('Who won the 2026 Super Bowl?');
console.log(answer.answer);
console.log(answer.sources);
// Search with a specific profile
const results = await cw.search('kubernetes best practices', {
profile: 'code',
maxResults: 10
});
// Extract text from a URL
const page = await cw.extract('https://example.com/docs', 'markdown');
console.log(page.content);
// Search academic papers
const papers = await cw.research('transformer architecture improvements');
console.log(papers.papers);
Choosing the right search profile
Profiles determine which of the 105 engines are queried. Using the right profile dramatically improves result quality:
| Task | Profile | Why |
|---|---|---|
| General questions | web | Google + Bing + DDG + Wikipedia |
| Code/programming | code | GitHub + StackOverflow + docs |
| Research papers | academic | arXiv + PubMed + Semantic Scholar |
| Current events | news | Google News + Bing News |
| Dev community | devnews | HN + Lobsters + Reddit |
| Package search | packages | npm + PyPI + crates.io |
| Security | security | CVE databases |
Tips for better search results
- Be specific. "React useState cleanup" beats "React hooks".
- Use the right profile. Don't search StackOverflow for news.
- Use
askfor facts,searchfor exploration.asksynthesizes an answer;searchgives you raw results to analyze. - Use
extractaftersearch. Find the right page, then extract its full content. - Use BYOK to save credits. Pass your own OpenRouter key to halve credit usage.
Get started free
1,000 searches/month. 105 engines. MCP + API + SDK. No credit card.
Get your API key →