npm Registry API

The npm Registry HTTP API provides agents with programmatic access to package metadata, version information, download statistics, and package publishing for the JavaScript/Node.js ecosystem hosted at registry.npmjs.org.

Evaluated Mar 06, 2026 (0d ago) vcurrent
Homepage ↗ Repo ↗ Developer Tools npm nodejs javascript typescript packages registry publish search
⚙ Agent Friendliness
53
/ 100
Can an agent use this?
🔒 Security
84
/ 100
Is it safe for agents?
⚡ Reliability
81
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
72
Error Messages
70
Auth Simplicity
82
Rate Limits
60

🔒 Security

TLS Enforcement
100
Auth Strength
82
Scope Granularity
80
Dep. Hygiene
75
Secret Handling
80

Granular access tokens introduced in 2021 allow publish-scoped tokens restricted to specific packages, significantly reducing blast radius of token compromise. 2FA enforcement for publishing is available and recommended.

⚡ Reliability

Uptime/SLA
85
Version Stability
80
Breaking Changes
82
Error Recovery
78
AF Security Reliability

Best When

Best when agents need to automate JavaScript package publishing, version management, or registry metadata lookups as part of a JavaScript/Node.js-centric CI/CD workflow.

Avoid When

Avoid when you need private package hosting with access control — the public registry has no private package support, and scoped private packages require a paid npm account.

Use Cases

  • Publish a new package version to the npm registry after a CI build passes all tests and linting checks
  • Fetch package metadata and version history to audit which teams are consuming a deprecated internal package
  • Search the public registry for packages matching a keyword to evaluate available dependencies before adopting one
  • Query download statistics for a package over a time window to track adoption and prioritize maintenance effort
  • Deprecate or unpublish a specific package version when a security vulnerability is discovered

Not For

  • Private package management in an enterprise environment without additional access control (use Nexus, JFrog, or GitHub Packages instead)
  • Non-JavaScript package ecosystems (PyPI for Python, Maven Central for Java, etc.)
  • Binary or large artifact storage that exceeds npm's package size guidelines

Interface

REST API
Yes
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: bearer_token
OAuth: No Scopes: Yes

Read access to public package metadata is unauthenticated. Publishing and write operations require a Bearer token (npm access token) passed via the Authorization header. Tokens can be scoped as read-only, publish, or automation type. Granular access tokens allow restricting publish access to specific packages.

Pricing

Model: freemium
Free tier: Yes
Requires CC: No

Public package publishing is and has always been free. The npm registry is operated by GitHub (Microsoft). Private scoped packages require a paid plan.

Agent Metadata

Pagination
none
Idempotent
Partial
Retry Guidance
Not documented

Known Gotchas

  • The npm registry uses a CouchDB-style document API where full package metadata is returned in one large document — agents should not fetch /{package} for performance-sensitive lookups; use /{package}/{version} instead
  • Package publish requires sending a specially structured JSON document (not a simple multipart upload) that includes the tarball as a base64-encoded attachment — the npm CLI handles this, but raw API callers must construct it manually
  • The registry enforces a 24-hour unpublish window — after 24 hours, packages can only be deprecated, not deleted, which agents must account for in any removal workflow
  • Scoped package names (@scope/name) must be URL-encoded as %40scope%2Fname in registry API paths, which differs from how the npm CLI handles them
  • Download count statistics are served from a separate API (api.npmjs.org/downloads) with its own rate limits and response format, not from the main registry endpoint

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for npm Registry API.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered