pi-kagi-search
v0.1.0
Published
A pi extension to search Kagi
Readme
pi-kagi-search
A pi extension to search the web using Kagi Search.
Installation
Install via npm:
$ pi install npm:pi-kagi-searchOr install from git:
$ pi install git:github.com/richardanaya/pi-kagi-searchConfiguration
Create a JSON file at ~/.pi/kagi-search.json with your API key:
{
"kagiSearchApiKey": "your-api-key-here"
}Replace your-api-key-here with your actual Kagi API key.
Usage
This extension provides three powerful tools for searching and extracting web content:
1. Kagi Search (kagi_search)
Perform web searches with optional content extraction and advanced filtering.
Basic search:
Search for: "machine learning best practices"With filters:
- Limit results:
limit: 20 - Specific domains only:
sites_included: ["github.com", "stackoverflow.com"] - Exclude domains:
sites_excluded: ["reddit.com"] - File type:
file_type: "pdf"(for PDFs, docs, etc.) - Time range:
time_relative: "week"(day/week/month) - Region:
search_region: "US"(ISO country codes) - Safe search:
safe_search: true
Content extraction:
extract_count: 3- Automatically extract full markdown from top 3 results
Example: Find recent Python tutorials from educational sites
query: "Python tutorial"
sites_included: ["edu.org", "github.com"]
time_relative: "month"
limit: 52. Kagi Search Media (kagi_search_media)
Search for images, videos, news articles, or podcasts.
Supported media types:
images- Photos and graphicsvideos- YouTube, Vimeo, and other video platformsnews- News articlespodcasts- Podcast episodes
Example: Find recent AI news articles from major outlets
query: "artificial intelligence"
media_type: "news"
time_relative: "week"
sites_included: ["bbc.com", "nytimes.com"]
limit: 10Example: Search for Python tutorial videos
query: "Python tutorial for beginners"
media_type: "videos"
limit: 15All filtering options available in kagi_search are also available for media searches (domains, keywords, regions, time ranges, etc.).
3. Kagi Extract (kagi_extract)
Extract clean markdown content from up to 10 web pages simultaneously.
Converts HTML to readable markdown, removes ads and navigation, and returns just the main content.
Example: Extract content from multiple pages
urls: [
"https://example.com/article1",
"https://example.com/article2",
"https://example.com/article3"
]
timeout: 30Common Use Cases
Research: Search for information with domain filtering + extract full content
kagi_search: query + sites_included + extract_countMedia discovery: Find recent videos or podcasts on a topic
kagi_search_media: query + media_type + time_relativeContent aggregation: Extract full text from multiple sources
kagi_extract: urls (from previous search results)Technical documentation: Search only code repositories and documentation sites
kagi_search: query + sites_included: ["github.com", "docs.python.org"]