> **For coding agents and LLMs:** This is one Social Fetch marketing page (markdown export). For API orientation start with [`/llms.txt`](https://www.socialfetch.dev/llms.txt); for auth and crawl rules use [`/agents.txt`](https://www.socialfetch.dev/agents.txt); for every operation use [`/llms-endpoints.txt`](https://www.socialfetch.dev/llms-endpoints.txt).

## This page

- **On-site (HTML):** <https://www.socialfetch.dev/platforms/npm/package-downloads-versions>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/platforms/npm/package-downloads-versions.mdx>

---

# 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?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`.

## Request

- **Endpoint:** `GET /v1/npm/package/downloads/versions`
- **Credits:** 1 credit
Failed requests are free
- **Input:** by package name
- **Full reference:** [docs](https://www.socialfetch.dev/docs/api/v1/npm/package/downloads/versions/get)
- **Platform page:** [/platforms/npm](https://www.socialfetch.dev/platforms/npm)

## 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.
