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

pricesaurus

v0.2.1

Published

Official TypeScript SDK and CLI for the Pricesaurus Watch API. Extract a product URL, watch the price, set an alert.

Readme

Pricesaurus JS

CI npm node license

Official Node.js SDK and CLI for the Pricesaurus Watch API. Paste a product URL, read the price, watch it, set an alert.

Requires a Plus or Max account and a Bearer token from API keys.

Install

pnpm add pricesaurus
npm install pricesaurus

Node 20 or later. ESM only.

Usage

import { Pricesaurus, PricesaurusError } from "pricesaurus";

const api = new Pricesaurus({ token: process.env.PRICESAURUS_TOKEN ?? "" });

const snapshot = await api.extract({ url: "https://www.amazon.com/dp/B00CH9QWOU" });
const product = await api.watch({ url: "https://www.amazon.com/dp/B00CH9QWOU" });
const created = await api.alert(product.data.id, { condition: "drops" });
await api.alerts(product.data.id);
await api.updateAlert(created.data.id ?? "", { is_active: false });
const account = await api.me();

baseUrl defaults to https://pricesaurus.com/api/v1. Inject fetch in tests.

Mutating calls accept { idempotencyKey } so a retry does not create a second product or alert.

API

| Method | HTTP | | ---------------------------------------------------- | ---------------------------- | | extract({ url, country?, currency? }) | POST /extract | | watch({ url, name?, country?, currency? }) | POST /products | | products({ per_page?, starting_after? }) | GET /products | | product(id) | GET /products/{id} | | check(id) | POST /products/{id}/checks | | alert(productId, { condition, threshold?, name? }) | POST /products/{id}/alerts | | alerts(productId) | GET /products/{id}/alerts | | updateAlert(id, { name?, is_active? }) | PATCH /alerts/{id} | | deleteAlert(id) | DELETE /alerts/{id} | | me() | GET /me |

condition is drops, below, or above. Responses are { data, meta? }. Types ship with the package.

OpenAPI: pricesaurus.com/openapi.json

Errors

Failed calls throw PricesaurusError:

| Field | Meaning | | ----------- | -------------------------------------------------------------------------------------- | | status | HTTP status, or 0 when the request did not get a response | | code | API error code, or network_error / invalid_url / invalid_json / invalid_config | | message | Human-readable reason | | retryable | true when the client or the API says it is safe to retry |

try {
  await api.extract({ url });
} catch (error) {
  if (error instanceof PricesaurusError && error.retryable) {
    // retry
  }
  throw error;
}

CLI

export PRICESAURUS_TOKEN=ps_live_...
pnpm exec pricesaurus extract https://www.amazon.com/dp/B00CH9QWOU
pnpm exec pricesaurus watch https://www.amazon.com/dp/B00CH9QWOU
pnpm exec pricesaurus me
pnpm exec pricesaurus products
pnpm exec pricesaurus alerts <product-id>
pnpm exec pricesaurus alert <product-id> drops
pnpm exec pricesaurus pause <alert-id>
pnpm exec pricesaurus resume <alert-id>
pnpm exec pricesaurus delete-alert <alert-id>
pnpm dlx pricesaurus --help

PRICESAURUS_BASE_URL overrides the API origin (tests, a local app).

Development

See CONTRIBUTING.md.

License

MIT