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

@tian.zuo/pi-web-search

v0.1.0

Published

Web search (OpenAI Responses with simple prompt, Exa, Firecrawl, Ollama) and web fetch for the pi coding agent.

Readme

@tian.zuo/pi-web-search

Clean, lightweight web search and fetch tools for the pi coding agent.

Supports OpenAI Responses (with simple, concise system instructions and automatic pi/Codex OAuth reuse), Exa, Firecrawl, and Ollama (local/cloud), plus built-in direct HTML-to-Markdown fetch fallback.

Features

  • web_search Tool: Queries live web sources and returns concise summaries with cited source links.
    • OpenAI Responses (/v1/responses or Codex): Uses OpenAI's server-side web search with a simple, clean prompt. Reuses your active pi login (openai-codex or openai), or uses OPENAI_API_KEY.
    • Exa: High quality search results via EXA_API_KEY.
    • Firecrawl: Clean search output via FIRECRAWL_API_KEY.
    • Ollama: Local (http://localhost:11434) or cloud web search.
  • web_fetch Tool: Reads web pages and documentation as clean Markdown.
    • Native scrapers for Firecrawl (/v1/scrape), Exa (/contents), and Ollama (/api/web_fetch).
    • Direct Fetch Fallback: High-performance HTML-to-Markdown extraction when no scraping key is provided.
  • Session Fallback Chains: Every call walks an ordered fallback chain — search: openai → exa → firecrawl → ollama; fetch: firecrawl → exa → ollama → direct. When a provider runs out of usage (402/403, out of credits, usage limits) it is skipped for the rest of the session, so the next search/fetch goes straight to the next healthy provider. Plain rate limits (429) only apply a short cooldown. Successful responses report which providers they fell back from.

Installation

pi install npm:@tian.zuo/pi-web-search

Or try in a live session without installing:

pi -e ./packages/pi-web-search

Configuration

Precedence: Environment Variables > ~/.config/@tian.zuo/pi-web-search/config.json > ~/.pi/agent/auth.json (Codex / OpenAI login).

Environment Variables

| Variable | Description | Default | | :--- | :--- | :--- | | OPENAI_API_KEY | OpenAI API key or Codex JWT | Reused from Pi login if available | | OPENAI_BASE_URL | Custom OpenAI Responses endpoint | https://api.openai.com/v1/responses | | OPENAI_SEARCH_MODEL | Model for OpenAI Responses search | gpt-5.6-luna | | EXA_API_KEY | Exa API key | - | | FIRECRAWL_API_KEY | Firecrawl API key | - | | FIRECRAWL_BASE_URL | Custom Firecrawl API URL | https://api.firecrawl.dev/v1 | | OLLAMA_HOST | Ollama host URL | http://localhost:11434 | | OLLAMA_API_KEY | Ollama API key (for cloud endpoints) | - |

License

MIT