npm Package API
One package with its latest version, every dist-tag and last week's downloads, ready to store without walking a registry document.
GET /v1/npm/package1 credit Failed requests are free
About this endpoint
GET /v1/npm/package?name=express returns data.package, the latest version document: name, version, description, license, repository, maintainers, publisher, dependencies, scripts, dist and the rest of the fields npm publishes. data.distTags maps every tag to its version, data.latestVersion names the version behind latest, and data.downloads carries weekly, start and end for the last counted week.
The three parts come from separate reads. When dist-tags or last week's downloads do not answer, the package still returns with data.complete: false and data.missing naming the part that was skipped. A package that does not exist returns lookupStatus: not_found with data.package: null; it is never an HTTP error.
npm Package API FAQ
What is in data.package for a found package?
The latest version document: name, version, description, keywords, license, homepage, repository, author, maintainers, publisher, dependencies, scripts, entrypoints, tarball metadata, provenance availability and publication timestamps.
What do complete and missing mean?
complete is false when an optional part (dist-tags or last week's downloads) was temporarily unavailable. missing lists the part, for example downloads. The main package document is still returned, and the response is still billed as one lookup.
How do I look up a scoped package?
Pass the name with one slash, for example name=@types/node or name=@babel/core. Names are case-sensitive and the scope keeps its @ sign. Bad characters are refused with HTTP 400 before anything is looked up.
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
- Package detailsGET /v1/npm/package/details
- 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