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

@mrgoonie/rapidapi-cli

v0.2.0

Published

CLI proxy for RapidAPI.com — agent & human friendly

Downloads

435

Readme

@mrgoonie/rapidapi-cli

npm version CI License: MIT

CLI proxy for RapidAPI.com — designed for both humans and AI agents.


What it does

  • Proxies HTTP requests through RapidAPI with automatic auth headers injected.
  • Provides --json output on every command for machine-readable piping.
  • Exposes --manifest for self-discovery by AI agents.
  • Supports RapidAPI Enterprise Hub GraphQL search.

Install

Recommended (any machine with Node ≥ 20)

npm install -g @mrgoonie/rapidapi-cli

With Bun

bun install -g @mrgoonie/rapidapi-cli

One-shot (no install)

npx @mrgoonie/rapidapi-cli --manifest

Quickstart

# 1. Save your key
rapidapi login --key $RAPIDAPI_KEY

# 2. Make your first call
rapidapi call twitter154.p.rapidapi.com /user/details \
  --query username=elonmusk \
  --query user_id=44196397

# 3. Get JSON output for scripting / agents
rapidapi call twitter154.p.rapidapi.com /user/details \
  --query username=elonmusk \
  --json | jq .result.legacy.name

Commands

rapidapi call <host> <path>

Proxy an HTTP request through RapidAPI.

Options:
  --method <method>    HTTP method (default: GET)
  --header <k=v>       Extra headers (repeatable)
  --query <k=v>        Query params (repeatable)
  --data <body>        Request body: JSON string, @file, or - for stdin
  --key <key>          RapidAPI key (overrides env/config)
  --timeout <ms>       Request timeout in ms (default: 30000)
  --raw                Print raw response body

Unknown flags become query params automatically:

rapidapi call twitter154.p.rapidapi.com /user/details \
  --username elonmusk --user_id 44196397

POST with JSON body:

rapidapi call api.example.p.rapidapi.com /items \
  --method POST \
  --data '{"name":"widget"}' \
  --header Content-Type=application/json

Body from file:

rapidapi call api.example.p.rapidapi.com /items \
  --method POST --data @payload.json

Body from stdin:

cat payload.json | rapidapi call api.example.p.rapidapi.com /items \
  --method POST --data -

rapidapi search <query>

Search for APIs on RapidAPI Enterprise Hub (requires searchEndpoint).

Options:
  --category <name>    Filter by category
  --tag <tag>          Filter by tag
  --limit <n>          Results per page (default: 10)
  --cursor <cursor>    Pagination cursor from previous page
  --key <key>          RapidAPI key override
rapidapi search "twitter" --limit 5 --json
rapidapi search "weather" --category "Data" --json

See docs/search-setup.md for Enterprise Hub configuration.

rapidapi login

Save your RapidAPI key to local config.

rapidapi login              # interactive prompt (hidden input)
rapidapi login --key $KEY   # non-interactive

rapidapi config

Manage CLI configuration.

rapidapi config list                          # show all values
rapidapi config get apiKey                    # get one value
rapidapi config set apiKey <value>            # persist a value
rapidapi config set searchEndpoint <url>      # set Enterprise search URL
rapidapi config unset apiKey                  # remove a value
rapidapi config path                          # show config file location

rapidapi --manifest

Print a machine-readable JSON description of all commands and flags. Intended for AI agent self-discovery.

rapidapi --manifest | jq .commands[].name

Configuration & env var precedence

Values are resolved in this order (highest → lowest priority):

| Priority | Source | |----------|--------| | 1 | CLI flag (--key, --timeout, …) | | 2 | Environment variable | | 3 | Config file (rapidapi config set …) | | 4 | Built-in default |

Supported environment variables

| Variable | Config key | Description | |----------|------------|-------------| | RAPIDAPI_KEY | apiKey | Your RapidAPI subscription key | | RAPIDAPI_SEARCH_ENDPOINT | searchEndpoint | Enterprise Hub GraphQL URL | | RAPIDAPI_DEFAULT_HOST | defaultHost | Default API host (optional shorthand) | | RAPIDAPI_IDENTITY_KEY | identityKey | Team identity key for Enterprise accounts |

Copy .env.example and fill in your values:

cp .env.example .env

For AI agents

See docs/agent-guide.md for:

  • How to use --manifest for self-discovery
  • Stable --json error schema
  • Exit codes
  • Deprecation policy

Quick pattern:

# 1. Discover commands
rapidapi --manifest

# 2. Call with structured output
rapidapi call <host> <path> [flags] --json

# 3. Parse errors
rapidapi call bad.host /path --json 2>&1 | jq .error

Limitations

  • Requires a RapidAPI account and a subscribed API.
  • search requires RapidAPI Enterprise Hub (not available on free tier).
  • --provenance on npm publish requires GitHub Actions OIDC (configured in CI).

Contributing

See CONTRIBUTING.md.

License

MIT — see LICENSE.