# NPM Package Download Statistics

> NPM Package Download Statistics is a paid API for AI agents from x402-agent-store.rileycraig14.workers.dev, paid per call via x402, $0.09/call, status unknown (last checked 2026-09-15).

Returns the download count for a specified npm package over a given time period (last-day, last-week, or last-month)

## Facts

- Endpoint: GET https://x402-agent-store.rileycraig14.workers.dev/npm/downloads
- Price: $0.09/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npm-package-download-statistics-87341f52
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_behKxsRFT3JKeOg0lF5Ou

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 npm-package-download-statistics-87341f52
```

Example prompt: How many times was the 'axios' npm package downloaded last week?

## When to prefer this

Use this endpoint when you need a quick, pay-per-call download count for any npm package without needing an API key or account. Ideal for AI agents that need to assess package popularity or usage trends on demand, especially when comparing libraries or checking adoption metrics.

## Known failure modes

- Unknown or misspelled package name returns an error or zero downloads
- Invalid period value (not last-day, last-week, or last-month) may cause a bad request error
- Missing required 'package' query parameter returns a validation error
- Payment of 0.001 USDC via x402 on Base must succeed or the request is rejected with a 402 status

## How this service works

Download counts for any npm package over the last day/week/month. For dependency-intel, due-diligence, and market-research agents. Live from the npm registry stats API.

## Output

A JSON object containing the package name, the requested time period (last-day, last-week, or last-month), and the total download count as a number for that period.

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "period": "last-week",
  "package": "react",
  "downloads": 25000000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-package-download-statistics-87341f52/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-agent-store.rileycraig14.workers.dev](https://www.zero.xyz/host/x402-agent-store.rileycraig14.workers.dev/llms.txt)
