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

api-false-success

v0.4.0

Published

Measured behaviour of public APIs on requests that cannot succeed: which return HTTP 200 anyway, how to detect it per API, and whether it is a defect or a documented contract.

Readme

api-false-success

Of 73 public APIs measured, 29 return HTTP 200 for a request that cannot succeed. Only 5 of those are indefensible; 14 are legitimate documented contracts. This package records what each one actually returned, and how to tell success from failure per API.

Corrected in v0.4.0 after adversarial review. Earlier versions implied all 29 were faults. That was wrong. A 200 carrying an empty or partial body is not automatically a defect — GraphQL's HTTP specification explicitly permits execution errors and partial data inside a success response. The measurement was right; the framing was not.

The five that are indefensible

api.sunrise-sunset.org, asked for sunrise at latitude 999, longitude 999 — coordinates that cannot exist on a sphere:

{"results":{"sunrise":"12:00:00 AM","sunset":"12:00:00 AM",
            "solar_noon":"5:30:20 PM","day_length":"00:00:00"}}

HTTP 200. It does not fail — it answers. Well-formed, confident, invented. Only day_length: 00:00:00 hints, and only to someone already suspicious.

| API | Asked | Returned | |---|---|---| | sunrise-sunset | sunrise at latitude 999 | invented times | | randomuser | results=-5 — a negative number of people | actual generated humans | | thecolorapi | hex=ZZZZZZ — not hexadecimal | a structured colour, input echoed as valid | | zenquotes | a nonexistent endpoint | the error text inside the quote field — an app showing "today's quote" displays it as inspiration | | deckofcards | draw 999 cards from 52 | success:false and a populated cards array — flag and payload contradict |

Three classifications

| | Meaning | |---|---| | PROTOCOL_DEFECT (5) | No reliable discriminator, or invented data. You cannot tell it failed | | APPLICATION_CONTRACT (14) | A conventional, codeable pattern with a clear discriminator — [], an error object, success:false. Defensible | | AMBIGUOUS (10) | A discriminator exists but is nested, unusual, or easily missed — e.g. worldbank buries its error inside an array, so body.error checks miss it |

The measurement is a durable fact. The classification is judgement and may be argued with.

Use

const afs = require('api-false-success');

afs.detect('sunrise-sunset');
// { severity:'fabricates', detect:"results.day_length == '00:00:00' …" }

afs.byClassification('PROTOCOL_DEFECT');  // the five
afs.falseSuccess();                       // all 29 needing application-specific checks
afs.get('worldbank').false_success.classification_basis;

Also carries, per API: which rate-limit headers actually appear (13 of 14 in the first batch exposed none), pagination signals, error shape, and wrong-method status — which varied across six behaviours (405, 404, 403, 301, 200, connection failure). Six APIs return HTML, XML or bare text from a JSON endpoint, so the parser throws rather than branching.

Honest limits

  • Convenience sample. 73 APIs chosen by hand, partly because they looked likely to be interesting. Rates describe the APIs measured — not APIs in general.
  • One date, not a contract. APIs change. Re-measure before relying.
  • Absence of a flag means not observed, not safe.
  • No reproducibility manifest ships yet. Raw observations exist but are not published per-entry.

Method

For each API: one request that is valid, and one that is structurally valid but semantically impossible — latitude 999, the year 3000, 999 cards from a deck of 52. Appending a nonsense path only tests the router; every API passes that. Roughly three requests per API, unauthenticated, no load.

A measured counter-example is worth more than an opinion. Corrections welcome.

CC-BY-4.0.