npm hub

npm Downloads by Version API

One week of downloads for every published version of a package, keyed by version so a release chart is one pass.

GET /v1/npm/package/downloads/versions

1 credit Failed requests are free

About this endpoint

GET /v1/npm/package/downloads/versions?name=express returns data.downloads, an object keyed by version with the download count for last week. data.versionCount is the number of valid version keys. Versions with no downloads are absent rather than zero, so build the full series from GET /v1/npm/package/versions if you need a row for every release.

npm only offers this per-version view for the last week; there is no period parameter. An unknown package is not_found; a package with no counted version downloads is found with an empty map. Keys that are not a version or dist-tag are dropped. If you need package facts, use GET /v1/npm/package.

npm Downloads by Version API FAQ

What does the downloads map look like?

data.downloads maps version strings to weekly counts, for example 5.3.0 to a number. data.versionCount is the number of valid keys. The map is not sorted and only includes versions with a count.

Can I get a different period?

No. npm exposes per-version downloads for last week only. Use GET /v1/npm/package/downloads with period or from/to for package totals and daily rows.

Why is an existing package with no downloads reported as found?

The empty map is a real answer for a package with no counted version downloads. When the map is empty the route also checks the package total, so an unknown package is not_found instead.

Does each version count include prereleases?

Every version key npm returns is included, including prereleases. Use GET /v1/npm/package/versions with data.versions[].version to map keys to publication dates and deprecation.

What does the request cost?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth.