# Kagi Search API

> Kagi's paid API, billed per call: premium web, news and video search without ads, clean page extraction, FastGPT answers with sources, the Universal Summarizer and Kagi's own Teclis and TinyGem indexes. For Kagi's free Small Web feed, use Kagi Small Web.

App · 6 actions. Web page: https://docs.lodol.com/docs/integrations/kagi-search

## Actions

### Ask FastGPT

Get a short answer to a question, written by Kagi's FastGPT from a live web search, with the pages it cites. One billed query; a cached answer is free.

**Inputs**

- Question (`query`, text, required): The question to answer, such as What is new in Python 3.13?
- Use cached answers (`use_cache`, true/false): Kagi answers a repeat question from its cache for free. Turn off to always get a fresh answer. Default: `true`.

**Outputs**

- `answer` (text): The answer, citing its sources as [1], [2] and so on
- `api_balance` (number): Your remaining Kagi API credit in US dollars after this call, when Kagi reports it; empty otherwise
- `references` (list): The pages the answer cites, by number
- `tokens` (number): How many tokens FastGPT processed

**Example output**

```json
{
  "answer": "Python 3.11 introduced several new features: a faster interpreter [1], exception groups [1] and clearer tracebacks [2].",
  "api_balance": 9.42,
  "references": [
    {
      "number": 1,
      "snippet": "Python 3.11 is between 10 and 60% faster than Python 3.10.",
      "title": "What's New In Python 3.11",
      "url": "https://docs.python.org/3/whatsnew/3.11.html"
    },
    {
      "number": 2,
      "snippet": "Tracebacks now point at the exact expression.",
      "title": "Introducing the New Features in Python 3.11",
      "url": "https://earthly.dev/blog/python-3.11-new-features/"
    }
  ],
  "tokens": 757
}
```

### Extract page content

Read up to 10 web pages and get each one's main content as clean Markdown, ready for an AI step. Billed per page read.

**Inputs**

- Pages (`urls`, list, required): The web addresses to read, up to 10, such as https://example.com/article.

**Outputs**

- `count` (number): How many pages were read
- `failed` (number): How many pages could not be read
- `markdown` (text): The first page's Markdown that could be read: handy when reading one page
- `pages` (list): Each page asked for, in the order given

**Example output**

```json
{
  "count": 1,
  "failed": 0,
  "markdown": "# Article Title\n\nThis is the extracted content...",
  "pages": [
    {
      "characters": 48,
      "error": "",
      "extracted": true,
      "markdown": "# Article Title\n\nThis is the extracted content...",
      "url": "https://example.com/article"
    }
  ]
}
```

### Search

Search the web with Kagi: web pages, news, videos, images or podcasts, narrowed by country, lens, site, words or date, and optionally with the full text of the top pages. One billed search.

**Inputs**

- Search (`query`, text, required): What to search for. Kagi's search operators work here too, such as site:example.com or a phrase in quotes.
- Results (`result_type`, text): Which kind of results to return. Defaults to web pages. One of: `search` (Web pages (default)), `news`, `videos`, `images`, `podcasts`. Default: `search`.
- How many results (`limit`, number): At most this many results of each kind. Leave blank for everything Kagi finds in one pass. From 1 to 1024.
- Page (`page`, number): Which page of results, 1 to 10. Defaults to the first. From 1 to 10.
- Country (`region`, text): Only results from this country. Leave blank for the key's own setting. One of: `AF` (Afghanistan), `AX` (Åland Islands), `AL` (Albania), `DZ` (Algeria), `AS` (American Samoa), `AD` (Andorra), `AO` (Angola), `AI` (Anguilla), `AQ` (Antarctica), `AG` (Antigua and Barbuda), and 239 more.
- Lens (`lens`, text): Search through one of Kagi's lenses, or type a shared lens's id or address from https://kagi.com/settings/lenses. Can't be combined with the site, word, file type or 'Updated in the past' fields.
- Only these sites (`sites`, list): Search only these sites, such as example.com.
- Leave out these sites (`exclude_sites`, list): Never return results from these sites.
- Must mention (`keywords`, list): Only results that contain these words.
- Must not mention (`exclude_keywords`, list): Leave out results that contain these words.
- File type (`file_type`, text): Only files of this type, by extension, such as pdf.
- Updated in the past (`recency`, text): Only pages published or updated within this time. Use this or the two date fields, not both. One of: `day` (Past day), `week` (Past week), `month` (Past month).
- Updated after (`updated_after`, date): Only pages published or updated after this day.
- Updated before (`updated_before`, date): Only pages published or updated before this day.
- Safe search (`safe_search`, true/false): Leave out results that may be explicit. On unless turned off. Default: `true`.
- Read the top results in full (`read_top_results`, number): Also read this many of the top web results, 1 to 10, and return each page's text as Markdown. Billed as extra page extractions. From 1 to 10.
- Rank these sites higher (`raise_sites`, list): Move results from these sites up the list.
- Rank these sites lower (`lower_sites`, list): Move results from these sites down the list.
- Pin these sites to the top (`pin_sites`, list): Put results from these sites first.

**Outputs**

- `count` (number): How many results there are
- `images` (list): Images Kagi mixed into a web search
- `news` (list): News Kagi mixed into a web search
- `podcasts` (list): Podcasts Kagi mixed into a web search
- `query` (text): The search that was run
- `related_searches` (list): Searches Kagi suggests trying next
- `result_type` (text): The kind of results asked for: search (web pages), news, videos, images or podcasts
- `results` (list): The results of the kind asked for, best first
- `small_web` (list): Finds from Kagi's small web index
- `videos` (list): Videos Kagi mixed into a web search

**Example output**

```json
{
  "count": 2,
  "images": [],
  "news": [
    {
      "content": "",
      "image_url": "",
      "published": "2026-10-27T12:59:35Z",
      "rank": 1,
      "snippet": "The Steve Jobs Archive is the authoritative home for Steve's story.",
      "title": "The Steve Jobs Archive opens its doors",
      "url": "https://stevejobsarchive.com/"
    }
  ],
  "podcasts": [],
  "query": "steve jobs",
  "related_searches": [
    "steve jobs biography",
    "steve jobs quotes"
  ],
  "result_type": "search",
  "results": [
    {
      "content": "",
      "image_url": "https://p.kagi.com/proxy/th?c=fl5H5doFdZVT3TYbM87OdIZHFmzy",
      "published": "2012-02-23T07:00:59Z",
      "rank": 1,
      "snippet": "Steven Paul Jobs (February 24, 1955 to October 5, 2011) was an American businessman, inventor, and investor.",
      "title": "Steve Jobs - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Steve_Jobs"
    },
    {
      "content": "",
      "image_url": "",
      "published": "2011-12-23T20:19:37Z",
      "rank": 2,
      "snippet": "Steve Jobs is the authorized self-titled biography of American business magnate and Apple co-founder Steve Jobs.",
      "title": "Steve Jobs (book) - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Steve_Jobs_(book)"
    }
  ],
  "small_web": [
    {
      "content": "",
      "image_url": "",
      "published": "",
      "rank": 1,
      "snippet": "A repository of all things Steve Jobs.",
      "title": "Remembering Steve Jobs",
      "url": "https://allaboutstevejobs.com/"
    }
  ],
  "videos": [
    {
      "content": "",
      "image_url": "https://p.kagi.com/proxy/th?c=UF8uR6Z6KLc",
      "published": "2008-03-07T00:00:00Z",
      "rank": 1,
      "snippet": "Drawing from some of the most pivotal points in his life.",
      "title": "Steve Jobs' 2005 Stanford Commencement Address",
      "url": "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
    }
  ]
}
```

### Search Kagi's own indexes

Find non-commercial web pages (Kagi's Teclis index) or independent news and discussions (TinyGem) on a topic: the results that make Kagi's searches different. Billed only when something is found.

**Inputs**

- Search (`query`, text, required): The topic to look up, such as solar cooking.
- Index (`index`, text): Which of Kagi's indexes to search. Defaults to web pages. One of: `web` (Non-commercial web pages (Teclis, default)), `news` (Independent news and discussions (TinyGem)). Default: `web`.

**Outputs**

- `api_balance` (number): Your remaining Kagi API credit in US dollars after this call, when Kagi reports it; empty otherwise
- `count` (number): How many results there are
- `index` (text): web (Teclis) or news (TinyGem)
- `query` (text): The search that was run
- `results` (list): What the index found, best first

**Example output**

```json
{
  "api_balance": 9.08,
  "count": 1,
  "index": "web",
  "query": "microsoft",
  "results": [
    {
      "published": "",
      "rank": 1,
      "snippet": "Microsoft Bob| Microsoft Bob And so Microsoft Bob disappeared in to obscurity.",
      "title": "Microsoft Bob",
      "url": "http://toastytech.com/guis/bob.html"
    }
  ]
}
```

### Summarize a web page or file

Summarize what is at a web address with Kagi's Universal Summarizer: an article, a PDF, a Word or PowerPoint file, an audio file or a YouTube video. Billed by length; a cached summary is free.

**Inputs**

- Web address (`url`, text, required): The address of the page, document, audio file or YouTube video, such as https://example.com/report.pdf.
- Engine (`engine`, text): Which summarizer to use. Cecil and Agnes are billed by length; Muriel is billed at a flat rate per summary, much more than the others. One of: `cecil` (Cecil: friendly and descriptive (default)), `agnes` (Agnes: formal and technical), `muriel` (Muriel: Kagi's best, billed at a much higher flat rate). Default: `cecil`.
- Summary type (`summary_type`, text): Paragraphs, or the key points as a bulleted list. One of: `summary` (Paragraphs (default)), `takeaway` (Key points as a bulleted list). Default: `summary`.
- Language (`target_language`, text): Write the summary in this language. Leave blank to let the document's own language decide. One of: `BG` (Bulgarian), `ZH` (Chinese (simplified)), `ZH-HANT` (Chinese (traditional)), `CS` (Czech), `DA` (Danish), `NL` (Dutch), `EN` (English), `ET` (Estonian), `FI` (Finnish), `FR` (French), and 20 more.
- Use cached summaries (`use_cache`, true/false): Kagi answers a repeat request from its cache for free. Turn off for sensitive documents, so Kagi keeps nothing after summarizing. Default: `true`.

**Outputs**

- `api_balance` (number): Your remaining Kagi API credit in US dollars after this call, when Kagi reports it; empty otherwise
- `engine` (text): The engine that wrote it
- `summary` (text): The summary
- `summary_type` (text): summary (paragraphs) or takeaway (key points)
- `tokens` (number): How many tokens Kagi processed, in and out
- `url` (text): The address that was summarized

**Example output**

```json
{
  "api_balance": 9.12,
  "engine": "cecil",
  "summary": "In this video, Jonathan Blow discusses the decline of software technology and argues that simplifying software systems is the right approach.",
  "summary_type": "summary",
  "tokens": 11757,
  "url": "https://www.youtube.com/watch?v=ZSRHeXYDLko"
}
```

### Summarize text

Summarize text from an earlier step, such as an email, a transcript or a page's content, with Kagi's Universal Summarizer. Billed by length.

**Inputs**

- Text (`text`, text, required): The text to summarize, up to about 1 MB.
- Engine (`engine`, text): Which summarizer to use. Cecil and Agnes are billed by length; Muriel is billed at a flat rate per summary, much more than the others. One of: `cecil` (Cecil: friendly and descriptive (default)), `agnes` (Agnes: formal and technical), `muriel` (Muriel: Kagi's best, billed at a much higher flat rate). Default: `cecil`.
- Summary type (`summary_type`, text): Paragraphs, or the key points as a bulleted list. One of: `summary` (Paragraphs (default)), `takeaway` (Key points as a bulleted list). Default: `summary`.
- Language (`target_language`, text): Write the summary in this language. Leave blank to let the document's own language decide. One of: `BG` (Bulgarian), `ZH` (Chinese (simplified)), `ZH-HANT` (Chinese (traditional)), `CS` (Czech), `DA` (Danish), `NL` (Dutch), `EN` (English), `ET` (Estonian), `FI` (Finnish), `FR` (French), and 20 more.
- Use cached summaries (`use_cache`, true/false): Kagi answers a repeat request from its cache for free. Turn off for sensitive documents, so Kagi keeps nothing after summarizing. Default: `true`.

**Outputs**

- `api_balance` (number): Your remaining Kagi API credit in US dollars after this call, when Kagi reports it; empty otherwise
- `characters` (number): How many characters were summarized
- `engine` (text): The engine that wrote it
- `summary` (text): The summary
- `summary_type` (text): summary (paragraphs) or takeaway (key points)
- `tokens` (number): How many tokens Kagi processed, in and out

**Example output**

```json
{
  "api_balance": 9.1,
  "characters": 2412,
  "engine": "cecil",
  "summary": "- Brothertiger's Mainsail is a hopeful song about escaping routine.\n- The chorus invites the listener to set sail.",
  "summary_type": "takeaway",
  "tokens": 543
}
```
