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

v0.1.0

Published

Local SearXNG web_search tool for pi.

Readme

pi-searxng-search

Local SearXNG-backed web_search tool for pi.

This package only searches. It returns compact Google-style results with titles, URLs, and snippets.

Important: this package does not fetch or extract page contents. For a useful search workflow, install a separate fetch plugin too. pi-smart-fetch is recommended, but any plugin that provides web_fetch / batch_web_fetch can work.

Why this exists

Most web search tools for coding agents rely on an API key, hosted account, or vendor-specific search backend such as Brave, Google, or Ollama's account-backed web search.

pi-searxng-search is built for a different workflow:

  • local-first search through your own SearXNG instance
  • no API key
  • no account signup
  • no hosted search dependency
  • simple search-only behavior
  • clean pairing with whichever web_fetch plugin you prefer

The intended agent workflow is:

  1. web_search discovers relevant URLs.
  2. web_fetch or batch_web_fetch reads selected pages as a separate step.

Install

pi install npm:pi-searxng-search

Recommended companion fetch plugin:

pi install npm:pi-smart-fetch

Why fetch is separate: some users may already have another fetch plugin installed. Keeping fetch separate avoids duplicate web_fetch registrations and lets this package stay focused on local SearXNG search.

Local development install

pi install ~/github/pi-searxng-search

Or try it for one run:

pi -e ~/github/pi-searxng-search

Local SearXNG

A working local SearXNG compose setup is included in searxng/.

cd searxng
podman compose up -d
curl 'http://127.0.0.1:8080/search?q=searxng&format=json'

Docker Compose works too:

cd searxng
docker compose up -d

Official SearXNG docs:

JSON output must be enabled in SearXNG. The included config does this with:

search:
  formats:
    - html
    - json

Configuration

By default, the tool queries:

http://127.0.0.1:8080

If your SearXNG instance runs somewhere else, set SEARXNG_URL before starting pi:

export SEARXNG_URL='http://127.0.0.1:8888'
pi

Examples:

# Different local port
export SEARXNG_URL='http://127.0.0.1:8888'

# LAN or remote host
export SEARXNG_URL='http://192.168.1.50:8080'

# Reverse-proxied HTTPS instance
export SEARXNG_URL='https://search.example.com'

The tool also accepts a per-call base_url argument, but SEARXNG_URL is the recommended persistent configuration.

If you use the included compose setup and want to change its local port, copy .env.example to .env inside searxng/ and edit SEARXNG_PORT:

cd searxng
cp .env.example .env
$EDITOR .env
podman compose up -d

Example searxng/.env:

SEARXNG_PORT=8888
SEARXNG_BASE_URL=http://localhost:8888/

Then configure pi to match:

export SEARXNG_URL='http://127.0.0.1:8888'

Persist SEARXNG_URL

The export ... command above only affects the current terminal session. To make it stick, add it to your shell config.

For bash, add this to ~/.bashrc:

echo "export SEARXNG_URL='http://127.0.0.1:8888'" >> ~/.bashrc

Then restart your terminal, or run:

source ~/.bashrc

For zsh, add this to ~/.zshrc:

echo "export SEARXNG_URL='http://127.0.0.1:8888'" >> ~/.zshrc

Then restart your terminal, or run:

source ~/.zshrc

For fish, run:

set -Ux SEARXNG_URL 'http://127.0.0.1:8888'

Fish stores universal variables automatically, so you do not need to edit a config file.

Replace http://127.0.0.1:8888 with your actual SearXNG URL.

Tool

Registers:

  • web_search

Parameters:

  • query — search query
  • max_results — maximum results to return, default 5, clamped to 1..50
  • categories — optional comma-separated SearXNG categories
  • engines — optional comma-separated SearXNG engines
  • language — optional language code, for example en or auto
  • time_range — optional day, month, or year
  • safesearch — optional 0, 1, or 2
  • page — optional page number, default 1
  • base_url — optional SearXNG base URL
  • timeout_ms — optional request timeout, default 15000

Default SearXNG URL resolution:

  1. base_url tool argument
  2. SEARXNG_URL environment variable
  3. http://127.0.0.1:8080

Example result format:

Search results for: leptos server functions

1. Server Functions - book.leptos.dev
   URL: https://book.leptos.dev/server/25_server_functions.html
   Leptos is one of a number of modern frameworks that introduce...
   google · general

Development

npm install
npm run typecheck

License

MIT