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-searxng-aggregator

v0.0.5

Published

Search via a local SearXNG instance and aggregate results into per-topic JSON files

Readme

pi-searxng-aggregator

A pi extension that queries a SearXNG search instance and aggregates results into per-topic JSON files. Results from repeated searches with the same query are appended to the same file, and can be read back using mode='list'.

Prerequisites

A SearXNG instance must be running and reachable. The extension uses the following priority chain to determine the base URL:

  1. SEARXNG_BASE_URL environment variable (highest priority)
  2. searxng.baseUrl in ~/.pi/agent/settings.json
  3. http://localhost:8080 (default fallback)

Environment variable

export SEARXNG_BASE_URL=https://your-searxng.example.com

Settings file

Add the searxng.baseUrl key to your global settings file (~/.pi/agent/settings.json):

{
  "searxng": {
    "baseUrl": "https://your-searxng.example.com"
  }
}

Note: Non-local SearXNG instances (public instances, remote servers, etc.) are fully supported.

Local SearXNG Setup (Docker)

The simplest way to run SearXNG locally is with the official Docker image:

# Create data and config directories
mkdir -p ~/.config/searxng/{data,config}

# Run the container
docker run -d \
  --name searxng \
  -p 8080:8080 \
  -v ~/.config/searxng/data:/var/cache/searxng \
  -v ~/.config/searxng/config:/etc/searxng \
  searxng/searxng:latest

Verify it's running:

curl http://localhost:8080/search?q=test

The container persists data in ~/.config/searxng/, so your settings and cache survive restarts.

Quick Start

Install via npm (recommended)

pi install npm:pi-searxng-aggregator

Usage

Ask pi to search with SearXNG. Results are saved to a per-topic JSON file in the system temp directory.

Parameters

  • query (required): The search query text
  • engines (optional): Search engines, e.g. ["google", "duckduckgo"]
  • categories (optional): Result categories, e.g. ["general", "images", "news"]
  • language (optional): Language code, e.g. "en"
  • filename (optional): Override the auto-generated filename slug for explicit grouping. Related searches share the same file.
  • mode (optional): "search" (default) queries SearXNG; "list" reads a previously aggregated file without searching

Examples

  • Search a query: "Search for latest AI news using searxng"
  • Group related searches: "Search for Rust async and Tokio benchmarks, filename: 'async-rust'"
  • Read previous results: "List aggregated results for async-rust"

Aggregated File Format

Results are saved as JSON in the system temp directory (e.g. /tmp/pi-searxng/). Each file has this structure:

{
  "filename": "async-rust",
  "queries": [
    {
      "id": "a3f1b2c4-...",
      "originalQuery": "Rust async benchmarks",
      "timestamp": 1715420000000,
      "params": { "engines": ["google"], "language": "en" },
      "results": [
        { "title": "...", "url": "...", "content": "...", "engine": "google", "category": "general", "score": 0.95 }
      ]
    }
  ],
  "totalQueries": 1,
  "totalResults": 1
}
  • filename — slug for the file
  • queries — array of all searches under this topic (appended on repeated searches)
  • totalQueries / totalResults — summary counts
  • Each result contains title, url, content, engine, category, score