# payload402 NPM Package Download Stats

> payload402 NPM Package Download Stats is a paid API for AI agents from payload402.edgebytenet.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-02).

Returns last-week and last-month download counts plus the latest version and publish date for any npm package

## Facts

- Endpoint: GET https://payload402.edgebytenet.workers.dev/npm/stats?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/payload402-npm-package-download-stats-6f66d127
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_t77gd34qTOJrSLY58ISGW

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 payload402-npm-package-download-stats-6f66d127
```

Example prompt: Before I add it to the project, can you check how many weekly and monthly downloads 'lodash' gets on npm and when its latest version was published?

## When to prefer this

Choose this endpoint when an AI agent needs to quickly gauge npm package popularity or freshness before recommending or installing a dependency. It is ideal for automated dependency triage pipelines, coding agents comparing alternatives, or any workflow needing a lightweight, fast signal on package adoption — without needing the full npm registry API or authentication.

## Known failure modes

- Package not found on npm — returns an error or empty result
- Misspelled package name yields no data
- npm public API rate limiting or downtime causes failure
- Scoped package names (e.g. @org/pkg) may require exact formatting

## How this service works

npm package license triage for coding agents: call before npm install or adding a dependency mid-task. Returns declared license, SPDX normalization, and permissive-default compatible yes/no/unknown from the public npm registry. Triage only — not compliance-grade SBOM or legal advice. Workflow: call GET /license/check (or MCP check_npm_license) before npm install; if compatible=no, pick another package or escalate to human; if unknown, treat as risk. Example: left-pad@1.0.0 before install. Also: Convert amounts between ISO 4217 currencies using ECB daily reference rates (Frankfurter). Use for invoices, travel budgets, expense reports, and shopping comparisons when you need a verifiable rate instead of LLM arithmetic. Not live tradable FX — rates follow ECB business-day publication. Also: Resolve a place name or lat/lon to IANA timezone and coordinates (Open-Meteo). Use for agent scheduling, travel logistics, and local-time questions without LLM guessing. Not IP geolocation. Also: Translate short text between languages (Azure Translator). Use when an agent needs a verifiable string in another language for UI copy, messages, or research snippets — not legal, medical, or certified translation. Also: English Wikipedia fact lookup: search by query or exact title, returns intro extract as plain text. For agents that need a grounded summary before deeper web search. Not a substitute for primary sources. Also: Ranked search results (English Wikipedia): titles, article URLs, and snippets from MediaWiki search. Same SERP-shaped JSON as web search APIs; index is Wikipedia only — not the open web. Pair with GET /wiki/lookup for intro text.

## Output

A JSON object containing the npm package name, source label ('npm-registry'), last-week and last-month download counts as integers, the latest published version string, and the ISO 8601 publish date of that version, plus a note clarifying these are download counts and not quality or security scores.

## 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": [
      "package"
     ],
     "properties": {
      "package": {
       "type": "string",
       "description": "npm package name"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "note": "Download counts from npm public API; not a security or quality score",
  "source": "npm-registry",
  "package": "lodash",
  "downloads": {
   "lastWeek": 25000000,
   "lastMonth": 100000000
  },
  "publishedAt": "2020-02-20T15:00:00.000Z",
  "latestVersion": "4.17.21"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/payload402-npm-package-download-stats-6f66d127/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payload402.edgebytenet.workers.dev](https://www.zero.xyz/host/payload402.edgebytenet.workers.dev/llms.txt)
