npm

List npm package security advisories

List the security advisories affecting an npm package version, or every version.

GET/v1/npm/package/advisories
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

versionoptionalquery

Exact version or dist-tag to check, `all` for every version, or omit for `latest`. A dist-tag is resolved to the version it points to. Semver ranges are not resolved.

Response fields
20

Endpoint-specific response payload.

datalookupStatus
string

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

one of: found, not_found

dataname
string

Package name.

Versions that were checked, in the order the package lists them. A dist-tag is replaced by the version it points to.

dataversions[]
stringoptional

Advisories affecting those versions. An unknown name is `not_found`; a package with no advisories is `found` with `[]`.

dataadvisories[]id
integer

GitHub advisory id.

dataadvisories[]url
string

GitHub advisory URL.

dataadvisories[]title
string

Advisory title.

dataadvisories[]severity
string

Severity.

one of: low, moderate, high, critical

dataadvisories[]vulnerableVersions
string

Semver range of affected versions, as npm reports it.

CWE ids.

dataadvisories[]cwe[]
stringoptional

CVSS score and vector.

dataadvisories[]cvssscore
numbernullable

CVSS score.

dataadvisories[]cvssvectorString
stringnullable

CVSS vector.

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

Responses

npm advisories.