npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

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-search

Or install from git:

$ pi install git:github.com/richardanaya/pi-kagi-search

Configuration

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: 5

2. Kagi Search Media (kagi_search_media)

Search for images, videos, news articles, or podcasts.

Supported media types:

  • images - Photos and graphics
  • videos - YouTube, Vimeo, and other video platforms
  • news - News articles
  • podcasts - 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: 10

Example: Search for Python tutorial videos

query: "Python tutorial for beginners"
media_type: "videos"
limit: 15

All 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: 30

Common Use Cases

Research: Search for information with domain filtering + extract full content

kagi_search: query + sites_included + extract_count

Media discovery: Find recent videos or podcasts on a topic

kagi_search_media: query + media_type + time_relative

Content 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"]