npm Package Details API
The whole registry document in one answer: the README, every version row, repository and licence facts, and the extra dependents and download counts.
GET /v1/npm/package/details1 credit Failed requests are free
About this endpoint
GET /v1/npm/package/details?name=express returns data.package with the fields the small package route omits: createdAt, modifiedAt, starCount, readme, versionCount, versions[], unpublished, dependentsCount, downloads.weekly and the extra flags. Each version row carries version, publishedAt, deprecated, hasProvenance, integrity, unpackedSize and fileCount.
data.complete is true when every part of the answer was filled. When a part is unavailable, the document still returns with data.complete: false and data.missing naming it; dependentsCount, downloads.weekly and isSecurityPlaceholder are then null. A tombstone with every version unpublished is found with versionCount: 0 and the unpublished record.
The decoded document is capped at 32 MB. A package above that cap is refused rather than returned in part; the smaller /v1/npm/package route is the better fit for a quick latest-version lookup.
npm Package Details API FAQ
Which extra fields does this route add over GET /v1/npm/package?
Timestamps (createdAt, modifiedAt), starCount, readme, readmeFilename, versionCount, every versions[] row, unpublished, dependentsCount, weekly downloads, isSecurityPlaceholder and lastPublish.
What happens when part of the details is unavailable?
The document still comes back. data.complete is false, data.missing names the part that could not be filled, and dependentsCount, downloads.weekly and isSecurityPlaceholder are null in that case.
What does a tombstone look like?
A package where every version was unpublished returns lookupStatus found with no version rows, versionCount 0 and an unpublished object holding the time and the versions that were removed. The package is not reported as not_found because the registry still knows it.
How large a document can I fetch?
The decoded registry document is capped at 32 MB, enough for the largest packages in the registry (next is about 30 MB decoded). A larger package is refused instead of returning a truncated answer.
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.
Other npm endpoints
- PackageGET /v1/npm/package
- VersionsGET /v1/npm/package/versions
- VersionGET /v1/npm/package/version
- DownloadsGET /v1/npm/package/downloads
- Downloads by versionGET /v1/npm/package/downloads/versions
- Downloads by nameGET /v1/npm/packages/downloads
- AdvisoriesGET /v1/npm/package/advisories
- ProvenanceGET /v1/npm/package/provenance