npmtraffic

Data

API endpoints, exports, caching, and error explanations.

Download counts come directly from api.npmjs.org. Search, repository links, dist-tags, and release markers come from registry.npmjs.org. The requested window ends on 2026-11-17 (yesterday UTC). A day can remain unavailable while npm publishes or revises its counts.

Traffic snapshots refresh after five minutes. When npm is unavailable, a snapshot for the same range can be served for up to 24 hours with a stale label.

Package totals and averages use available days. Comparisons use dates available for every package. Moving averages require consecutive available days. Missing and unverified counts are null in JSON and blank in CSV. Both formats retain the upstream count and observation status.

API endpoints

Public API responses include x-request-id. Download data and export responses use Cache-Control: no-store.

Package downloads

days=7|14|30|90|180|365

/api/v1/package/{name}/daily.json

Daily downloads with normalized range, derived metrics, and export metadata.

/api/v1/package/{name}/daily.csv

CSV with a comment header, UTC dates, MA3/MA7, and outlier columns.

/api/v1/package/{name}/daily.excel.csv

Spreadsheet-friendly CSV using semicolon delimiters.

Compare packages

packages=pkg1,pkg2 or pkgs=pkg1,pkg2; optional days

/api/v1/compare.json

Totals, share, daily downloads, daily deltas, cache metadata, and export metadata. Add includeSelection=1 to include selection details in JSON.

/api/v1/compare.csv

Wide CSV with one downloads and delta pair per package.

/api/v1/compare.excel.csv

Spreadsheet-friendly compare CSV using semicolon delimiters.

Lookup utilities

q, limit, or encoded package name

/api/v1/search?q=react&limit=10

npm search proxy used by the package search box.

/api/v1/validate/{name}/exists

Registry existence check for package add/search workflows.

Examples

curl "https://npmtraffic.com/api/v1/package/react/daily.json?days=30"
curl "https://npmtraffic.com/api/v1/compare.json?packages=react,vue&days=30"

Exports

Standard CSV includes a comment header with export metadata: from/to dates, timezone=UTC, generated_at, source, request_id, cache status, and stale indicators.

JSON exports include the normalized range with a meta block and an export block for traceability. Derived metrics such as trailing MA3/MA7 and MAD-based outlier scores do not alter the raw counts.

Excel CSV uses semicolon delimiters and a sep=; prelude for spreadsheet imports. Chart SVG/PNG exports are generated client-side from the visible chart.

Error meanings

  • 401 / 403: npm returned an authorization-style upstream response; cached data is used when available.
  • 429: Registry rate limit; try again shortly or wait for cached data.
  • 5xx: Upstream outage; stale cache is served when available.

Notes

Events are user-provided notes stored locally per package in the browser. They are never synced or stored on the server.

Downloads reflect all traffic captured by api.npmjs.org; they are not unique user counts and may include CI, bots, or repeated installs.