kagi extract
Extract the readable content of a web page as markdown using Kagi’s Extract API.
Synopsis
Description
Thekagi extract command sends one HTTPS URL to Kagi’s v1 Extract API and prints the extracted page markdown to stdout. It is useful when a search result, article, or documentation page needs full-page text instead of a search snippet.
The command uses JSON mode internally because that is the stable envelope returned by the API, then prints the first page’s markdown field. If Kagi returns no page markdown, the CLI reports the Extract API error details and trace id when available.
Authentication
Required:KAGI_API_KEY
Extract is part of Kagi’s current /api/v1 paid API surface, uses Bearer auth, and consumes API credit per request.
Arguments
<URL> (Required)
The HTTPS URL of the page to extract.
https:// URLs with a valid host are accepted.
Output
The command prints markdown directly:Examples
Save an Article
Pipe into Another Tool
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success - markdown extracted |
| 1 | Error - see stderr |
- Missing API key
- Non-HTTPS or invalid URL
- Insufficient API credit
- Kagi returns no extractable content
- Network error