Public APIs
npm Registry favicon

npm Registry

Development

Query information about your favorite Node.js libraries programmatically.

npm Registry's website screenshot

About npm Registry

The npm Registry API documentation describes the HTTP interface for npm's package registry, covering the data structures and endpoints used to query package information. It documents the Registry, Package, and Version objects, detailing fields such as package name, description, dist-tags, dependencies, author, license, and repository metadata drawn from package.json files.

The documentation lists meta and package endpoints, including a root endpoint returning database statistics, a package metadata endpoint (GET /{package}) that returns the full "packument" document, a version-specific endpoint (GET /{package}/{version}), and a search endpoint (GET /-/v1/search) supporting full-text queries with parameters for result size, offset, and weighting by quality, popularity, and maintenance. It also documents special search qualifiers such as filtering by author, maintainer, or scope.

This resource is intended for developers building tools or integrations that query the npm registry programmatically, such as package managers, search interfaces, or dependency analysis tools.

Key features

  • Retrieve full package metadata ("packument") via GET /{package}
  • Fetch a specific package version or the latest via GET /{package}/{version}
  • Full-text package search with GET /-/v1/search including keyword, author, maintainer, and scope qualifiers
  • Weighted search ranking by adjusting quality, popularity, and maintenance parameters
  • Registry-wide document count and metadata via GET /

Frequently asked questions

What data does the package metadata endpoint return?

It returns the package name, description, dist-tags, all version objects, author, repository info, and the latest README.

How do I search for packages via the API?

Use GET /-/v1/search with a text query and optional size, from, quality, popularity, and maintenance parameters to control results and ranking.

Can I filter search results by author or maintainer?

Yes, special qualifiers like author:bcoe and maintainer:bcoe can be included in the full-text query to filter results.

How many results can a search query return?

The search endpoint returns 20 results by default and supports up to a maximum of 250 via the size parameter.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product