npm

Get one npm package version

Get one npm version document, by exact version or dist-tag, with its files, dependencies, scripts and registry metadata.

GET/v1/npm/package/version
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
2
namestringrequiredquery

npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`.

max 214 chars

versionstringrequiredquery

Exact version or dist-tag, e.g. `5.3.0`, `5.0.0-alpha.1`, `latest` or `latest-4`. Semver ranges (`^4`, `4.x`) are refused.

max 128 chars

Response fields
82

Endpoint-specific response payload.

datalookupStatus
string

Whether the item exists. Every outcome is HTTP 200; branch on this field.

one of: found, not_found

The version document when found; otherwise null.

dataversionname
string

Package name, as the registry stores it.

dataversionscope
stringnullable

Package scope including `@`, or null for an unscoped name.

dataversionversion
string

Version.

dataversiondescription
stringnullable

Description.

Keywords.

dataversionkeywords[]
stringoptional
dataversionlicense

Licence: an SPDX expression/string or the published object.

dataversionhomepage
stringnullable

Project homepage.

dataversionbugsUrl
stringnullable

Issue tracker URL.

Source repository.

dataversionrepositorytype
stringnullable

Repository type, e.g. `git`.

dataversionrepositoryurl
stringnullable

Repository URL as published.

dataversionrepositorydirectory
stringnullable

Monorepo directory the package was published from.

Author.

dataversionauthorname
stringnullable

Author name.

dataversionauthorurl
stringnullable

Author URL.

Contributors.

dataversioncontributors[]name
stringnullable

Contributor name.

dataversioncontributors[]url
stringnullable

Contributor URL.

dataversioncontributors[]githubUsername
stringnullable

GitHub handle the publisher listed.

Maintainers at the time this version was published. The details route uses the package's current maintainer list instead.

dataversionmaintainers[]username
string

Maintainer username.

Publisher of this version.

dataversionpublisherusername
stringnullable

Publishing username.

The CI identity, when the version was published by one.

dataversionpublishertrustedPublisherid
stringnullable

Trusted publisher kind, e.g. `github`.

dataversionpublishertrustedPublisheroidcConfigId
stringnullable

The publisher's OIDC configuration id.

Who approved a trusted publication.

dataversionpublisherapproverusername
stringnullable

Approving username.

Funding channels.

dataversionfunding[]type
stringnullable

Funding kind, e.g. `opencollective`.

dataversionfunding[]url
stringnullable

Funding URL.

dataversiondeprecated
stringnullable

Deprecation message; null when the version is not deprecated.

dataversionhasInstallScript
booleannullable

Whether `preinstall`, `install` or `postinstall` is defined, inferred from `scripts` when the field is absent. Null when neither the field nor those scripts are present: an implicit node-gyp rebuild from binding.gyp cannot be seen.

dataversionbin
objectnullable

Command-name to file map, or null when the package has no binaries.

The package's entrypoints.

dataversionentrypointsmain
stringnullable

`main` entrypoint.

dataversionentrypointsmodule
stringnullable

`module` entrypoint.

dataversionentrypointstypes
stringnullable

`types` or `typings` entrypoint.

dataversionentrypointstype
stringnullable

`type` field (`module` or `commonjs`).

dataversionentrypointsexports

The `exports` map, as published.

`files` patterns.

dataversionfiles[]
stringoptional
dataversionsideEffects
booleannullable

The `sideEffects` flag, when published as a boolean.

dataversionengines
object

Engine constraints.

Supported operating systems.

dataversionos[]
stringoptional

Supported CPU architectures.

dataversioncpu[]
stringoptional

Workspace patterns.

dataversionworkspaces[]
stringoptional
dataversionscripts
object

Package scripts.

dataversiondependencies
object

Runtime dependencies.

dataversiondevDependencies
object

Development dependencies.

dataversionpeerDependencies
object

Peer dependencies.

dataversionpeerDependenciesMeta
object

Peer dependency metadata.

dataversionoptionalDependencies
object

Optional dependencies.

dataversionbundleDependencies

Bundled dependencies, as an array or the legacy boolean.

The published artifact and its registry metadata.

dataversiondisttarballUrl
stringnullable

Tarball URL.

dataversiondistshasum
stringnullable

SHA-1 of the tarball.

dataversiondistintegrity
stringnullable

Subresource-integrity hash of the tarball.

dataversiondistfileCount
integernullable

Files in the tarball.

≥ 0

dataversiondistunpackedSize
integernullable

Unpacked bytes.

≥ 0

Registry signatures. The legacy PGP block is not exposed.

dataversiondistsignatures[]keyid
stringnullable

Signing key id.

dataversiondistsignatures[]sig
stringnullable

Signature.

Whether this version was published with provenance.

dataversionprovenanceavailable
boolean

Whether the version carries an attestation.

dataversionprovenancepredicateType
stringnullable

Predicate type of the provenance attestation.

dataversiongitHead
stringnullable

Git commit the version was built from.

The publisher's toolchain, from the version document.

dataversionpublishedWithnode
stringnullable

Node version used to publish.

dataversionpublishedWithnpm
stringnullable

npm CLI version used to publish.

dataversiontypes
stringnullable

How the package ships TypeScript types: bundled with it, or through a DefinitelyTyped `@types` package.

one of: bundled, definitelyTyped, null

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

Code example

curl "https://api.socialfetch.dev/v1/npm/package/version?name=express&version=5.3.0" \
  -H "x-api-key: YOUR_API_KEY"

Responses

npm version.