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

site-to-api

v0.1.4

Published

Capture a website's traffic once and get OpenAPI specs, request flows and a typed client that a coding agent can build a wrapper from.

Readme

site-to-api

Record one browsing session of a website. Get the OpenAPI specs, request flows and typed client a coding agent needs to build a wrapper for its internal API.

For developers who need to integrate with a website that has no public API. Use it only on sites you are allowed to use; it never bypasses bot protection, captchas or access controls.

site-to-api records what a site's own pages do while you use it (or reads a HAR you exported), then works out the endpoints, their parameters and schemas, the order requests happen in, which value feeds which request, and what a session needs. No LLM runs inside it. It writes one handoff folder with:

  • OpenAPI 3.1 specs, plus AsyncAPI 3.0 for WebSocket and event-stream channels;
  • request flows with the origin of every input;
  • readable maps for an agent (AGENT.md, one file per host);
  • excerpts of the site's own source code;
  • a typed TypeScript client with Zod validation, and optionally an MCP server.

Raw captures stay in a gitignored folder. Everything in the handoff folder is redacted by default.

Install

Requires Node 22.12 or later.

npm install -D site-to-api              # the CLI
npm install site-to-api-runtime zod    # what the generated client imports

capture opens Google Chrome, or Playwright's bundled Chromium where Chrome is not installed; download that once with npx playwright install chromium. With pnpm, which does not expose Playwright's command, add playwright at the version site-to-api depends on before running pnpm exec playwright install chromium.

Use

npx site-to-api init                          # writes site-to-api.config.ts
npx site-to-api capture https://example.com   # use the site, close the browser to finish
npx site-to-api build                         # writes api-handoff/: specs, flows, AGENT.md, client
npx site-to-api probe                         # optional: what plain HTTP needs, rate limited

Already have a HAR? npx site-to-api import session.har --delete-source, then build.

Then point your coding agent at api-handoff/AGENT.md, or serve the folder to it over MCP with npx site-to-api mcp ./api-handoff. gen.clientDir in the config puts the client in your app's source tree.

For an agent that runs the CLI itself, the package ships its skill (commands, rules, workflow) at node_modules/site-to-api/skills/site-to-api/SKILL.md; npx site-to-api init --agent copies it into .claude/skills/ and .agents/skills/ and points the project's AGENTS.md or CLAUDE.md at it.

Documentation

The repository holds the full documentation:

MIT licence.