> **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-version>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/platforms/npm/package-version.mdx>

---

# npm Version API

One published version by exact number or dist-tag, with the tarball, dependencies, scripts and publisher npm recorded for it.

`GET /v1/npm/package/version?name=express&version=5.3.0` returns `data.version`, a copy of the version document npm stores: `name`, `version`, `description`, `license`, `repository`, `author`, `maintainers`, `publisher`, `dependencies`, `devDependencies`, `peerDependencies`, `scripts`, `bin`, `entrypoints`, `engines`, `files`, `dist` and `publishedWith`.

`version` accepts an exact version such as `5.3.0`, a prerelease such as `5.0.0-alpha.1`, or a dist-tag such as `latest` or `latest-4`. Semver ranges (`^4`, `4.x`, `*`) are refused with HTTP 400 because the route promises one version, not a resolution. A version or package that does not exist returns `lookupStatus: not_found` with `data.version: null`.

## Request

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

## FAQ

### Can I pass a range such as ^4 or 4.x?

No. The version parameter is an exact version or a dist-tag. Ranges are refused with HTTP 400 instead of resolving to a version, so the answer cannot silently change under you. Use GET /v1/npm/package/versions to see the exact versions.

### How do I fetch the latest version?

Use version=latest, or omit version to get the default latest. Any other dist-tag npm stores, such as latest-4, works too. data.version.version tells you the exact version behind the tag.

### What does the dist block contain?

tarballUrl, shasum, integrity, fileCount, unpackedSize and the registry signatures, with the legacy PGP block left out. The version document also says whether the version carries a provenance attestation.

### What is returned when the version was never published?

HTTP 200 with data.lookupStatus not_found and data.version null. A missing package behaves the same way. Check lookupStatus rather than the HTTP status.

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