The search endpoint returns formatted results from external search providers like Google, Bing, and DuckDuckGo.
Query Parameters
Number of results to return (1-10)
Search provider to use (google, bing, duckduckgo)
Generate an AI summary of the search results
ISO language code (e.g., ‘en’, ‘fr’)
Country code (e.g., ‘us’, ‘gb’)
Search topic category (general, news, images, videos, finance)
Whether to enhance DuckDuckGo results with Selenium (only applies to
DuckDuckGo provider)
Start date for published content (YYYY-MM-DD)
End date for published content (YYYY-MM-DD)
Domains to include in search results
Domains to exclude from search results
Response
The search query that was processed
List of search resultsShow SearchResult properties
The title of the search result
A clean summary or snippet from the search result
The URL of the search result
Publication date of the result if available
Optional LLM-generated summary of results (only if summarize=true)
Number of results returned
TypeScript Example
import { client } from "@agent-toolkit/client-ts";
import type { SearchResponse } from "@agent-toolkit/client-ts";
// Configure the client
client.setConfig({
baseUrl: "https://api.agenttoolkit.ai",
headers: {
"Content-Type": "application/json",
"X-API-Key": "your-api-key",
},
});
// Perform a search
const response = await client.get<SearchResponse>({
url: "/api/v1/search",
query: {
query: "typescript openapi client",
max_results: 5,
provider: "google",
summarize: true,
},
});
// Display results
console.log("Search Results:");
response.data.results.forEach((result, i) => {
console.log(`\n${i + 1}. ${result.title}`);
console.log(` URL: ${result.url}`);
console.log(` ${result.snippet}`);
});
// Access the AI-generated summary
if (response.data.summary) {
console.log(`\nSummary: ${response.data.summary}`);
}