npm Registry
以编程方式查询你喜欢的 Node.js 库的信息
- 认证方式
- No auth
- HTTPS
- Yes
- CORS
- Unknown
- 分类
- 开发
简介
npm Registry API 是 npm install 的后端——包元数据、版本、tarball、下载量和搜索——全部免密钥且免费。是包分析、依赖图和 npm 工具链的权威数据源。
快速开始
最新版本元数据(实测可用——react):
curl "https://registry.npmjs.org/react/latest"
{
"name": "react",
"version": "19.0.0",
"description": "React is a JavaScript library for building user interfaces.",
"dist": { "tarball": "https://registry.npmjs.org/react/-/react-19.0.0.tgz" }
}
完整包元数据(所有版本):
curl "https://registry.npmjs.org/react"
下载量:
curl "https://api.npmjs.org/downloads/point/last-week/react"
curl "https://api.npmjs.org/downloads/range/2026-01-01:2026-08-22/react"
搜索:
curl "https://registry.npmjs.org/-/v1/search?text=state%20management&size=5"
认证方式
读取无需认证——免密钥。
速率限制与注意事项
- 读取免费;重度爬取请使用
Accept: application/vnd.npm.install-v1+json头(简化元数据)。 registry.npmjs.org提供包数据;api.npmjs.org提供下载统计。- 完整元数据文档可能很大(所有版本)——请求
/latest或使用简化元数据提速。 - 原始文档中有 CouchDB 风格的
_id/_rev字段——忽略即可。
常见问题
npm Registry API 免费吗? 是的——读取免费且免密钥。
如何获取下载量?
https://api.npmjs.org/downloads/point/last-month/<包名>。
如何让响应变小?
使用 /latest 或简化元数据的 Accept 头。
开发 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| 24 Pull Requests Project to promote open source collaboration during December | No auth | Yes | Yes | ↗ |
| Agify.io Estimates the age from a first name | No auth | Yes | Yes | ↗ |
| Amazonscraperapi Amazon product, search & batch scraping API with residential proxies (1000 free) | API Key | Yes | No | ↗ |
| AmberOne Turn any website into a build-ready Android, iOS, PWA or Electron app project | API Key | Yes | No | ↗ |
| API Grátis Multiples services and public APIs | No auth | Yes | Unknown | ↗ |