GET
/
api
/
v1
/
search
{
  "query": "<string>",
  "results": [
    {
      "title": "<string>",
      "snippet": "<string>",
      "url": "<string>",
      "published_date": "<string>",
      "domain": "<string>"
    }
  ],
  "summary": "<string>",
  "result_count": 123
}

The search endpoint returns formatted results from external search providers like Google, Bing, and DuckDuckGo.

Query Parameters

query
string
required

The search query string

max_results
number
default:"5"

Number of results to return (1-10)

provider
string
default:"google"

Search provider to use (google, bing, duckduckgo)

summarize
boolean
default:"false"

Generate an AI summary of the search results

language
string

ISO language code (e.g., ‘en’, ‘fr’)

country
string

Country code (e.g., ‘us’, ‘gb’)

topic
string

Search topic category (general, news, images, videos, finance)

use_selenium
boolean
default:"false"

Whether to enhance DuckDuckGo results with Selenium (only applies to DuckDuckGo provider)

published_start_date
string

Start date for published content (YYYY-MM-DD)

published_end_date
string

End date for published content (YYYY-MM-DD)

include_domains
string[]

Domains to include in search results

exclude_domains
string[]

Domains to exclude from search results

Response

query
string

The search query that was processed

results
SearchResult[]

List of search results

summary
string

Optional LLM-generated summary of results (only if summarize=true)

result_count
number

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}`);
}