kagi_search_fetch
Fetch web search results for a query using the Kagi Search API. Supports filtering by domain, date, file type, and workflow type (news, videos, podcasts, images) with numbered results for easy reference.
Instructions
Fetch web results for a query using the Kagi Search API. Use for general search and when the user explicitly tells you to 'fetch' results/information. Results are numbered so that a user may refer to a result by a specific number.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Only include results published/updated on or after this date (ISO format, e.g., '2024-01-15'). | |
| limit | No | Maximum number of results per category. In the mixed 'search' workflow this caps each category independently, so the total can exceed this number; in single-category workflows it caps total results. | |
| query | Yes | A concise, keyword-focused search query. Include essential context for standalone use. | |
| before | No | Only include results published/updated on or before this date (ISO format, e.g., '2024-12-31'). | |
| lens_id | No | Apply a Kagi lens to narrow the search to a curated set of sources. Built-in lens IDs: '2' (Academic — education/.edu domains), '1' (Forums — discussion forums across the web), '15' (Programming — official programming language sites and forums), '29' (News 360 — multi-perspective coverage of global news), '120' (Recipes — high-quality recipe sites, English), '107' (Small Web — noncommercial domains and topics). You may also pass a custom lens ID or full URL from https://kagi.com/settings/lenses (only shareable lenses work). Mutually exclusive with 'include_domains', 'exclude_domains', 'time_relative', and 'file_type'; use those args or 'lens_id', not both. | |
| workflow | No | Type of results to return. Use 'news' for current events and recent reporting, 'videos' for video content (e.g. tutorials, talks), 'podcasts' for audio shows, 'images' for image results, or the default 'search' for general web results. Note that 'search' may return a mix of categories (web, news, videos, images) in one response, like a typical SERP; the other workflows return only their single category. | search |
| file_type | No | Restrict to results with this file type (e.g., 'pdf', 'docx', 'xlsx'). Specify the extension without a leading dot. | |
| extract_count | No | Number of top results to fetch full page content for, inline as markdown. | |
| time_relative | No | Restrict to results published/updated within the last day, week, or month, evaluated server-side. Mutually exclusive with 'after'/'before'. | |
| exclude_domains | No | Exclude results from these domains (e.g., ['pinterest.com', 'quora.com']). Overrides any 'site:' operators in the query. | |
| include_domains | No | Restrict results to these domains (e.g., ['docs.python.org', 'github.com']). Overrides any 'site:' operators in the query. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |