NPM download count by package version?

Viewed 737

I know there's a public API for getting NPM download counts, as well as tools built on top of it like npm-stat and npmtrends. However, I'd like to get more granular and see downloads for a particular package by version. I don't see this documented in the API docs anywhere. Is it possible?

1 Answers

Per version download counts are now available from the npm registry.

Download count for specific versions of a package are only available for the previous 7 days. They have a unique API end point

GET https://api.npmjs.org/versions/{package}/last-week

Note: for scoped packages, the / needs to be percent encoded. (@slack/client -> @slack%2Fclient).

They're also displayed in the Versions tab of the package's home page.

Related