Development — entry 061 of 98
npm Registry
The public npm registry (`registry.npmjs.org`) is a CouchDB-backed document store queried directly over plain JSON GETs — no key needed to read a package's full version history, dist-tags, dependencies, and tarball URLs, or to hit the `/-/v1/search` endpoint used by the npm CLI itself. The docs' old `master` branch link now redirects to `main`, the repo's current default branch, where the reference lives unchanged.
The public npm registry answers plain JSON GET requests. No key is needed. You can read a package's full version history, dist-tags, dependencies, and tarball URLs, or query the same search endpoint the npm CLI uses.
GreatAPIs Score
Auth quickstart
- No API key required for read access. Requests are public and keyless.
Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.
Fetch a package's latest version metadata
GEThttps://registry.npmjs.org/left-pad/latest
{
"name": "left-pad",
"version": "1.3.0",
"description": "String left pad",
"deprecated": "use String.prototype.padStart()",
"license": "WTFPL",
"dist": {
"tarball": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz",
"shasum": "5b8a3a7765dfe001261dde915589e782f8c94d1e"
}
}The live response includes more fields (maintainers, keywords, npm internals); the excerpt above trims to the fields most quickstarts need.
Developer reference
Gotchas & limits
- A deprecated package still returns HTTP 200 with a
deprecatedfield carrying the maintainer's message — check for that field, since the request itself never fails - An unknown package returns HTTP 404, but the body depends on the path.
/<name>/latestreturns only the JSON string"Not Found"./<name>returns{"error":"Not found"} /-/v1/search?text=<query>ranks by relevance, not by exact name. A live search forleft-paddid not returnleft-padin the top 20 results. The first hits werepad-left,lpad, andlpad-align. For an exact lookup, call/<name>/latestdirectly