Search API
Our Search API helps you find relevant sources on the web and retrieve their content. You can also optionally submit feedback on relevance — which we genuinely appreciate, as it helps us improve results over time.
Search is available via both HTTP and an MCP server.
Quick Start
Section titled “Quick Start”Use the snippets below as drop-in examples to test the full search end-to-end.
{ "mcpServers": { "keenable": { "command": "npx", "args": ["-y", "@keenable/mcp-server"] } }}import requestsimport json
API_KEY = "your-api-key"BASE_URL = "https://api.keenable.ai"headers = {"X-API-Key": API_KEY, "Content-Type": "application/json"}
# 1. Perform a web searchquery = "latest developments in AI agents"search_params = { "query": query, "count": 5}
print(f"Searching for: {query}")search_resp = requests.get(f"{BASE_URL}/v1/search", headers=headers, params=search_params)search_data = search_resp.json()results = search_data['results']print(f"Found {len(results)} results:\n")
# 2. Fetch full content from the first resultif results: first_url = results[0]['url'] print(f"Fetching content from: {first_url}")
fetch_params = {"url": first_url} fetch_resp = requests.get(f"{BASE_URL}/v1/fetch", headers=headers, params=fetch_params) fetch_data = fetch_resp.json()
print(f"Title: {fetch_data.get('title', 'N/A')}") print(f"Content length: {len(fetch_data['content'])} characters") print(f"Content preview: {fetch_data['content'][:200]}...\n")
# 3. Submit feedback on search resultsfeedback_scores = { results[0]['url']: 5, results[1]['url']: 5, results[2]['url']: 1,}
feedback_data = { "query": query, "feedback": feedback_scores, "feedback_text": "First two results were very helpful, third was off-topic"}
print("Submitting feedback...")feedback_resp = requests.post(f"{BASE_URL}/v1/feedback", headers=headers, json=feedback_data)feedback_result = feedback_resp.json()
print(f"Feedback response: {feedback_result['message']}")const API_KEY = "your-api-key";const BASE_URL = "https://api.keenable.ai";
const headers = { "X-API-Key": API_KEY, "Content-Type": "application/json",};
async function main() { // 1. Perform a web search const query = "latest developments in AI agents"; const searchParams = new URLSearchParams({ query: query, count: "5", });
console.log(`Searching for: ${query}`); const searchResp = await fetch(`${BASE_URL}/v1/search?${searchParams}`, { headers, }); const searchData = await searchResp.json(); const results = searchData.results; console.log(`Found ${results.length} results:\n`);
// 2. Fetch full content from the first result if (results.length > 0) { const firstUrl = results[0].url; console.log(`Fetching content from: ${firstUrl}`);
const fetchParams = new URLSearchParams({ url: firstUrl }); const fetchResp = await fetch(`${BASE_URL}/v1/fetch?${fetchParams}`, { headers, }); const fetchData = await fetchResp.json();
console.log(`Title: ${fetchData.title ?? "N/A"}`); console.log(`Content length: ${fetchData.content.length} characters`); console.log(`Content preview: ${fetchData.content.slice(0, 200)}...\n`); }
// 3. Submit feedback on search results const feedbackScores: Record<string, number> = { [results[0].url]: 5, [results[1].url]: 5, [results[2].url]: 1, };
const feedbackData = { query: query, feedback: feedbackScores, feedback_text: "First two results were very helpful, third was off-topic", };
console.log("Submitting feedback..."); const feedbackResp = await fetch(`${BASE_URL}/v1/feedback`, { method: "POST", headers, body: JSON.stringify(feedbackData), }); const feedbackResult = await feedbackResp.json();
console.log(`Feedback response: ${feedbackResult.message}`);}
main().catch(console.error);MCP Config
Section titled “MCP Config”The Keenable MCP server is available in two modes:
- Stdio Mode: Runs a local MCP server via
npx @keenable/mcp-server. The server communicates with your MCP client through standard input/output. - Remote Mode: Connects directly to our hosted MCP server at
https://api.keenable.ai/mcp. No local installation required.
Both modes offer the same functionality. Choose stdin for local control or remote for zero-setup convenience.
You can use the unauthenticated configurations to quickly test functionality before signing in, though request rates will be limited. For full functionality, sign in to Keenable AI and provide your API key.
Stdio Mode
Section titled “Stdio Mode”{ "mcpServers": { "keenable": { "command": "npx", "args": ["-y", "@keenable/mcp-server"] } }}{ "mcpServers": { "keenable": { "command": "npx", "args": ["-y", "@keenable/mcp-server"], "env": { "KEENABLE_API_KEY": "your-api-key-here" } } }}Remote Mode
Section titled “Remote Mode”{ "mcpServers": { "keenable": { "url": "https://api.keenable.ai/mcp" } }}{ "mcpServers": { "keenable": { "url": "https://api.keenable.ai/mcp", "headers": { "X-API-Key": "your-api-key-here" } } }}Endpoints
Section titled “Endpoints”Loading...
Loading...
Loading...