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

apicat

v0.3.4

Published

Quick and flexible API tool for CLI and Bun

Readme

apicat is a tiny API caller.

Keep your API definitions in one .apicat file, then list them, inspect them, and fire them off from the CLI or from JavaScript. It is built for quick experiments, repeatable calls, and "what was that curl again?" moments.

⚡ Quick Start

npx apicat <ls | service.name> KEY=VALUE

or install..

npm install -g apicat
# or
bun add -g apicat

$ apic ls
$ apic httpbin.get

Examples:

npx apicat ls
npx apicat httpbin.get
npx apicat openrouter.chat API_KEY=$OPENROUTER_API_KEY MODEL=openai/gpt-4o-mini PROMPT="hello"

🤖 apicat for your LLM

No installation required.

If you want a model to learn your API definitions, tell it:

Learn api definitions from https://unpkg.com/apicat

Variables can be defined in the call or will be used if named the same in env.

API IDs use <service>.<name> form, like httpbin.get, openai.chat, or echo.ws.

🎉 API goodness

  • One command: apic
  • One config file: .apicat
  • HTTP and WebSocket support
  • Variables with $VAR and required variables with $!VAR
  • Works as both a CLI and a library

🧠 How It Thinks

On first interactive run, it can copy the bundled .apicat to ~/.apicat so you have your own editable version instead of poking at the packaged one.

🧰 CLI Cheatsheet

# show the menu
apic

# list the toy box
apic ls
apic list openai
apic ls httpbin

# grep, but friendlier
apic help httpbin

# bring your own config
apic -config ./custom.yaml ls
apic -config ./custom.yaml httpbin.get

# call something
apic httpbin.get foo=bar
apic -time httpbin.get
apic -debug httpbin.get

# steal one definition into local ./.apicat
apic fetch echo.ws
apic fetch openai.chat

# refresh ~/.apicat from the published config
apic update

🪄 A Few Good Tricks

# OpenAI-compatible chat
apic openai.chat \
  OPENAI_COMPATIBLE_BASE_URL=https://api.openai.com/v1 \
  OPENAI_COMPATIBLE_API_KEY=$OPENAI_API_KEY \
  MODEL=gpt-4o-mini \
  PROMPT="Write a haiku about logs"

# OpenRouter
apic openrouter.chat \
  API_KEY=$OPENROUTER_API_KEY \
  MODEL=openai/gpt-4o-mini \
  PROVIDER=openai \
  PROMPT="Say hello"

# plain old GET
apic httpbin.get

Parameters automatically fall back to matching environment variables when possible.

💻 Use It From Code

Install it locally if you want to import it:

npm install apicat
# or
bun add apicat

Then:

import { fetchApi, getApis, getRequest } from 'apicat';

const apis = getApis();
console.log(apis.map((api) => api.id));

const req = getRequest('httpbin', 'get');
console.log(req.url);

const res = await fetchApi('httpbin', 'get');
console.log(await res.json());

const chat = await fetchApi('openai', 'chat', {
  vars: {
    OPENAI_COMPATIBLE_BASE_URL: 'https://api.openai.com/v1',
    OPENAI_COMPATIBLE_API_KEY: process.env.OPENAI_API_KEY,
    MODEL: 'gpt-4o-mini',
    PROMPT: 'Hello world'
  }
});

console.log(await chat.json());

fetchApi returns a normal Fetch Response, so you can use status, ok, headers, text(), json(), and the rest of the usual response methods.

📜 The .apicat Spellbook

Top-level keys are service.name.

httpbin.get:
  url: https://httpbin.org/get
  method: GET
  headers: {}

openai.chat:
  url: https://api.openai.com/v1/chat/completions
  method: POST
  headers:
    Authorization: "Bearer $!API_KEY"
    Content-Type: application/json
  body: |
    {"model":"$!MODEL","messages":[{"role":"user","content":"$!PROMPT"}]}

echo.ws:
  url: wss://echo-websocket.fly.dev/.ws
  body: $!PROMPT