# npm Package Metadata + Weekly Downloads

> npm Package Metadata + Weekly Downloads is a paid API for AI agents from x402-datashop-production.up.railway.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns merged npm package metadata (latest version, license, dependencies, engines) plus last-week download count in a single call

## Facts

- Endpoint: GET https://x402-datashop-production.up.railway.app/v1/npm/package
- Price: $0.005/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-metadata-weekly-downloads-be2ea8e4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ziZvg5vz6ni81MRP9qwqB

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-metadata-weekly-downloads-be2ea8e4
```

Example prompt: What's the latest version, license, dependencies, and last-week download count for the react npm package?

## When to prefer this

Use this endpoint when you need both npm package metadata and download popularity in a single request, avoiding two separate npm API calls. Ideal for dependency auditing, package vetting, or developer tooling that needs version, license, and usage statistics together. Prefer over raw npm registry calls when you want combined data with 1-hour caching and no personal maintainer data exposure.

## Known failure modes

- Package not found on npm registry — returns 404 or error response
- Malformed package name — returns validation error
- Scoped package name not URL-encoded correctly — may cause lookup failure
- Upstream npm registry or download API timeout — may return 503 or stale data
- Rate limiting or payment failure — returns 402 Payment Required

## How this service works

One merged call instead of two: latest-version metadata from the official npm registry plus last-week download count from api.npmjs.org (both live). Query: ?pkg=react (scoped names like @scope/name accepted). Returns version, license, deps_count + dependency names, engines, weekly_downloads. No personal maintainer data. 1h cache.

## Output

A JSON object with the package's latest version string, SPDX license identifier, number of direct dependencies (deps_count), list of dependency names, engines field (e.g. required Node version), and weekly_downloads count — all from live npm registry and download API sources with a 1-hour cache.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "pkg"
     ],
     "properties": {
      "pkg": {
       "type": "string",
       "description": "npm package name, e.g. react or @types/node"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-package-metadata-weekly-downloads-be2ea8e4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-datashop-production.up.railway.app](https://www.zero.xyz/host/x402-datashop-production.up.railway.app/llms.txt)
