# Package Health – npm Downloads & Popularity

> Package Health – npm Downloads & Popularity is a paid API for AI agents from package-health.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-24).

Returns last-week and last-month npm download counts, intra-month trend percentage, and a popularity band for a given npm package.

## Facts

- Endpoint: GET https://package-health.x402tookit.com/npm-downloads?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-24
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/package-health-npm-downloads-popularity-3fb92d0f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kgI6ZRLeLVQuyRp70PUYG

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability package-health-npm-downloads-popularity-3fb92d0f
```

Example prompt: How popular is the `zod` npm package right now — can you check its weekly and monthly download counts and tell me what popularity band it falls into?

## When to prefer this

Choose this endpoint when you need quantitative npm adoption signals — download counts and trend direction — for a single package. It is purpose-built for npm and returns a structured popularity band alongside raw counts, making it ideal for dependency vetting, supply-chain analysis, or populating package health dashboards. Prefer it over generic web search when you need machine-readable, normalized popularity data rather than prose descriptions.

## Known failure modes

- Unknown or misspelled package name returns null fields or an error verdict
- npm registry API unavailability causes a degraded response with partial data
- Scoped packages (e.g. @types/node) must include the full scoped name or the lookup fails
- Very new packages with no download history may return zero counts and a low band by default
- Rate limiting or upstream npm stats lag may result in stale or missing asOf timestamps

## How this service works

npm package adoption: downloads last week and month, plus trend within the month and a popularity band.

## Output

A JSON object with the package name, last-week download count, last-month download count, intra-month trend percentage, a popularity band (e.g. low/moderate/popular/very-popular), a human-readable verdict and summary, supporting reasons, download thresholds used for banding, the data source URL, an asOf timestamp, and optional degraded/disclaimer flags.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "name"
     ],
     "properties": {
      "name": {
       "type": "string",
       "description": "npm package name, e.g. express or @types/node"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "band": {
       "type": [
        "null",
        "string"
       ]
      },
      "name": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "lastWeek": {
       "type": [
        "null",
        "number"
       ]
      },
      "lastMonth": {
       "type": [
        "null",
        "number"
       ]
      },
      "sourceUrl": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "thresholds": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "lowWeekly": {
         "type": [
          "null",
          "number"
         ]
        },
        "popularWeekly": {
         "type": [
          "null",
          "number"
         ]
        },
        "moderateWeekly": {
         "type": [
          "null",
          "number"
         ]
        },
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/package-health-npm-downloads-popularity-3fb92d0f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from package-health.x402tookit.com](https://www.zero.xyz/host/package-health.x402tookit.com/llms.txt)
