About this endpoint
What it does
Checks npm or PyPI packages for safety information and returns a row per requested package with metadata such as existence, verdict, risk-related signals, and version details. Send a list of 1 to 25 packages, each with an optional version and ecosystem prefix.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| packages | String Array | Yes | Packages to check, 1 to 25 per call. Each item is a package name with an optional version and ecosystem prefix, e.g. express, [email protected], npm:[email protected], pypi:requests==2.19.0. Without a version, the latest version is checked. |
| ecosystem | ENUM | No | Default ecosystem for items in packages without an npm: or pypi: prefix. Allowed values: npm, pypi. Default: npm. |
Response
Returns a JSON object with a count integer and an items array with one safety report per package. Each report has a verdict (ok, caution, avoid or not_found), a riskScore from 0 to 100 and the reasons behind it, plus the package metadata and known vulnerabilities used to decide.
| Parameter | Type | Description |
|---|---|---|
| count | Integer | Number of rows in items, one per package in packages. |
| items | Object Array | One safety report per package, in the order you sent them. |
| items[].ecosystem | String | npm or pypi. |
| items[].name | String | Package name. |
| items[].requestedVersion | String | The version you asked for, or null if you sent none. |
| items[].version | String | Version that was checked (the latest if you sent none). |
| items[].exists | Boolean | false if the package does not exist in the registry, often a mistyped or AI-hallucinated name. |
| items[].verdict | String | Overall result: ok, caution, avoid or not_found. |
| items[].riskScore | Integer | Risk from 0 (no issues found) to 100 (highest risk). |
| items[].reasons | String Array | Plain-language reasons behind the verdict, e.g. known vulnerabilities, typosquat, deprecated, install scripts, very new version. |
| items[].message | String | Extra note, e.g. that the requested version does not exist. null otherwise. |
| items[].vulnCount | Integer | Number of known vulnerabilities affecting this version (OSV.dev). |
| items[].vulnerabilities | Object Array | Known vulnerabilities affecting this version. |
| items[].vulnerabilities[].id | String | Advisory id, e.g. GHSA-jf85-cpcp-j695. |
| items[].vulnerabilities[].severity | String | LOW, MODERATE, HIGH or CRITICAL. |
| items[].vulnerabilities[].summary | String | Short description of the vulnerability. |
| items[].vulnerabilities[].fixedIn | String Array | Versions that fix it. |
| items[].typosquatOf | String | Popular package this name looks like a typosquat of, e.g. express for expresss. null otherwise. |
| items[].deprecated | Boolean | true if the package or version is deprecated. |
| items[].deprecatedMessage | String | Deprecation message from the registry. null if not deprecated. |
| items[].yanked | Boolean | PyPI only. true if the release was yanked. |
| items[].yankedReason | String | PyPI only. Reason given for the yank. |
| items[].hasInstallScripts | Boolean | npm only. true if the package runs scripts on install (preinstall, install, postinstall). |
| items[].installScripts | Object | npm only. The install scripts, e.g. {"postinstall": "node install.js"}. |
| items[].latestVersion | String | Latest published version. |
| items[].versionPublishedAt | String | When the checked version was published (ISO 8601 UTC). |
| items[].versionAgeHours | Number | Age of the checked version in hours. Very new versions get a caution. |
| items[].packageCreatedAt | String | When the package was first published. |
| items[].packageAgeDays | Integer | Age of the package in days. |
| items[].versionsCount | Integer | Number of published versions. |
| items[].maintainersCount | Integer | Number of maintainers. |
| items[].weeklyDownloads | Integer | npm downloads in the last 7 days. null for PyPI. |
| items[].license | String | Declared licence, e.g. MIT. |
| items[].homepage | String | Package homepage. |
| items[].repositoryUrl | String | Source repository URL. Missing repositories add to the risk. |
| items[].sources | String Array | Data sources used, e.g. npm registry API, npm downloads API, OSV.dev. |
| items[].attribution | String | Attribution text: OSV.dev (CC BY 4.0), npm registry API, PyPI JSON API. |
| items[].checkedAt | String | When the check ran (ISO 8601 UTC). |



