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

@bcuev/pi-web-research

v1.0.2

Published

Web search and page extraction tools for Pi — add web search and focused page extraction to your coding agent sessions

Readme

pi-web-research

Web search and page extraction tools for Pi.

Why I built this

I used Claude's web research when I needed context on a topic. Questions like "best onboarding practices for iOS apps" or "how do I set up Swift Testing with async support" — I'd get sources back, then pull the relevant pieces into a dev plan or notes.

When I started using Pi for daily coding, that capability was missing. I didn't want to copy-paste search results into chat. I wanted the agent to handle the research: run parallel searches, evaluate what it finds, scope to authoritative domains when needed, and surface only what matters.

This extension adds web_search and web_fetch to Pi, along with a prompt template that guides that workflow.

Other tools I tried had too much overhead — complex configs, nested skills, features I never used. I just needed web research to work.

Tools

| Tool | Purpose | |------|---------| | web_search | Search the web via Brave Search API and return ranked results | | web_fetch | Fetch a URL, strip HTML, and extract content relevant to a specific prompt |

Examples

Research a specific technical topic:

"How do I migrate from XCTest to Swift Testing?"

Pi runs parallel searches, fetches the most relevant guide, and returns a summary with key steps and source links.

Check current best practices:

"What are the recommended error handling patterns for Swift concurrency?"

Useful when documentation is scattered across blog posts, WWDC videos, and release notes.

Evaluate a library before adoption:

"Is SwiftData production-ready? What are people saying about it in production apps?"

Pi searches for recent experience reports, fetches a few, and surfaces common issues and workarounds.

Install

Install from npm (simplest):

pi install @bcuev/pi-web-research

Or install directly from GitHub:

pi install git:github.com/bcuev/pi-web-research

Or clone and install locally:

git clone https://github.com/bcuev/pi-web-research.git
cd pi-web-research
pi install .

Setup

Sign up for a Brave Search API key, then export it in your shell:

export BRAVE_API_KEY=<your-key>

Features

  • Search via Brave API — rate-limit errors include retry-after headers
  • Caching — 15-minute TTL on raw and extracted content so you don't re-fetch the same page in a session
  • Content-type guards — only extracts from text/*, JSON, XML, and XHTML; rejects binary or unknown types
  • HTTPS → HTTP redirect guard — blocks cross-origin downgrades before reading the response body
  • Truncation — truncates large results to fit context limits using Pi's built-in truncateHead
  • Timeouts — 30-second network timeouts via AbortSignal; respects Pi's cancellation

Prompt template

The research.md prompt template tells Pi to:

  1. Run 2 parallel broad searches
  2. Evaluate quality before falling back to domain-scoped searches
  3. Summarize findings with citations

Requirements

  • Pi ≥ 0.70.0
  • Node.js ≥ 20
  • BRAVE_API_KEY environment variable

License

MIT