npm

Get npm package

Get an npm package's latest version, every dist-tag, publisher, dependencies and last week's downloads.

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

API key (`sfk_...`)

Parameters
1
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

Response fields
91

Endpoint-specific response payload.

datalookupStatus
string

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

one of: found, not_found

datadistTags
object

Every dist-tag.

datalatestVersion
stringnullable

The version the `latest` dist-tag points at.

The latest version when found; otherwise null.

datapackagename
string

Package name, as the registry stores it.

datapackagescope
stringnullable

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

datapackageversion
string

Version.

datapackagedescription
stringnullable

Description.

Keywords.

datapackagekeywords[]
stringoptional
datapackagelicense

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

datapackagehomepage
stringnullable

Project homepage.

datapackagebugsUrl
stringnullable

Issue tracker URL.

Source repository.

datapackagerepositorytype
stringnullable

Repository type, e.g. `git`.

datapackagerepositoryurl
stringnullable

Repository URL as published.

datapackagerepositorydirectory
stringnullable

Monorepo directory the package was published from.

Author.

datapackageauthorname
stringnullable

Author name.

datapackageauthorurl
stringnullable

Author URL.

Contributors.

datapackagecontributors[]name
stringnullable

Contributor name.

datapackagecontributors[]url
stringnullable

Contributor URL.

datapackagecontributors[]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.

datapackagemaintainers[]username
string

Maintainer username.

Publisher of this version.

datapackagepublisherusername
stringnullable

Publishing username.

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

datapackagepublishertrustedPublisherid
stringnullable

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

datapackagepublishertrustedPublisheroidcConfigId
stringnullable

The publisher's OIDC configuration id.

Who approved a trusted publication.

datapackagepublisherapproverusername
stringnullable

Approving username.

Funding channels.

datapackagefunding[]type
stringnullable

Funding kind, e.g. `opencollective`.

datapackagefunding[]url
stringnullable

Funding URL.

datapackagedeprecated
stringnullable

Deprecation message; null when the version is not deprecated.

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

datapackagebin
objectnullable

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

The package's entrypoints.

datapackageentrypointsmain
stringnullable

`main` entrypoint.

datapackageentrypointsmodule
stringnullable

`module` entrypoint.

datapackageentrypointstypes
stringnullable

`types` or `typings` entrypoint.

datapackageentrypointstype
stringnullable

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

datapackageentrypointsexports

The `exports` map, as published.

`files` patterns.

datapackagefiles[]
stringoptional
datapackagesideEffects
booleannullable

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

datapackageengines
object

Engine constraints.

Supported operating systems.

datapackageos[]
stringoptional

Supported CPU architectures.

datapackagecpu[]
stringoptional

Workspace patterns.

datapackageworkspaces[]
stringoptional
datapackagescripts
object

Package scripts.

datapackagedependencies
object

Runtime dependencies.

datapackagedevDependencies
object

Development dependencies.

datapackagepeerDependencies
object

Peer dependencies.

datapackagepeerDependenciesMeta
object

Peer dependency metadata.

datapackageoptionalDependencies
object

Optional dependencies.

datapackagebundleDependencies

Bundled dependencies, as an array or the legacy boolean.

The published artifact and its registry metadata.

datapackagedisttarballUrl
stringnullable

Tarball URL.

datapackagedistshasum
stringnullable

SHA-1 of the tarball.

datapackagedistintegrity
stringnullable

Subresource-integrity hash of the tarball.

datapackagedistfileCount
integernullable

Files in the tarball.

≥ 0

datapackagedistunpackedSize
integernullable

Unpacked bytes.

≥ 0

Registry signatures. The legacy PGP block is not exposed.

datapackagedistsignatures[]keyid
stringnullable

Signing key id.

datapackagedistsignatures[]sig
stringnullable

Signature.

Whether this version was published with provenance.

datapackageprovenanceavailable
boolean

Whether the version carries an attestation.

datapackageprovenancepredicateType
stringnullable

Predicate type of the provenance attestation.

datapackagegitHead
stringnullable

Git commit the version was built from.

The publisher's toolchain, from the version document.

datapackagepublishedWithnode
stringnullable

Node version used to publish.

datapackagepublishedWithnpm
stringnullable

npm CLI version used to publish.

datapackagetypes
stringnullable

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

one of: bundled, definitelyTyped, null

Last week's downloads, when available.

datadownloadsweekly
integer

Downloads in the last week.

≥ 0

datadownloadsstart
stringnullable

`YYYY-MM-DD`, or null when npm has none.

datadownloadsend
stringnullable

`YYYY-MM-DD`, or null when npm has none.

datacomplete
boolean

False when part of the answer could not be filled (dist-tags or last week's downloads); `missing` says which.

Parts of the answer that could not be filled.

datamissing[]
stringoptional

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?name=express" \
  -H "x-api-key: YOUR_API_KEY"

Responses

npm package.