# npm Package Download Statistics API

> npm Package Download Statistics API is a paid API for AI agents from myearnings-seven.vercel.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns download counts, daily averages, and popularity tier for a given npm package over a specified period

## Facts

- Endpoint: GET https://myearnings-seven.vercel.app/npm-downloads
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npm-package-download-statistics-api-5e73355d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QQXSRc54A2QnOPVD_QCM5

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-api-5e73355d
```

Example prompt: Can you look up the npm download stats for the 'axios' package over the last week and tell me how popular it is?

## When to prefer this

Choose this endpoint when you need structured, pre-computed npm download analytics (total downloads, daily average, and popularity tier classification) without having to query the raw npm registry API yourself. Ideal for agents enriching package metadata, performing dependency audits, or surfacing popularity signals in developer tooling workflows. The popularity tier enum makes it especially useful for quick categorical judgments without post-processing.

## Known failure modes

- Package not found on npm registry — returns an error if the package name is misspelled or does not exist
- Invalid period parameter — unrecognized period strings may return an error or default to a fallback period
- Payment failure — x402 payment not completed results in HTTP 402 and no data returned
- Rate limiting or upstream npm API unavailability causing delayed or failed responses

## How this service works

Real-time GitHub trending repos, repo analytics, npm download stats, Hacker News stories, and DeFi yield data for AI agents. Pay per request via x402 (USDC on Base).

## Output

Returns a JSON object containing the package name, total download count for the requested period, daily average download count, and a popularity tier label (one of: mega, tier1, tier2, tier3, tier4, or niche) indicating the package's relative usage ranking on npm.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "package"
 ],
 "properties": {
  "period": {
   "enum": [
    "day",
    "week",
    "month"
   ],
   "type": "string",
   "description": "Download period"
  },
  "package": {
   "type": "string",
   "description": "npm package name"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "package": {
   "type": "string"
  },
  "downloads": {
   "type": "integer"
  },
  "daily_average": {
   "type": "integer"
  },
  "popularity_tier": {
   "enum": [
    "mega",
    "tier1",
    "tier2",
    "tier3",
    "tier4",
    "niche"
   ],
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-package-download-statistics-api-5e73355d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from myearnings-seven.vercel.app](https://www.zero.xyz/host/myearnings-seven.vercel.app/llms.txt)
