npm Download Counts API
Free npm download counts API with no key: weekly, monthly and ranged download statistics for any package, plus per-day breakdowns. Tested curl example.
Endpoint tested and returned HTTP 200 on 2026-08-20
What is the npm Download Counts API?
The npm download counts API is a free, key-free API returning download statistics for any npm package — point-in-time totals for standard periods, or per-day breakdowns over an arbitrary date range.
The npm registry API tells you what a package is; this separate API tells you how much it is used. Download counts are the standard proxy for adoption when choosing between competing libraries.
One caveat is worth stating on any page that displays these numbers: npm download counts include CI pipelines, mirrors and automated tooling, so they substantially overstate the number of distinct humans using a package. They are good for relative comparison, poor as an absolute measure.
Quick facts
- Base URL
https://api.npmjs.org/downloads- Authentication
- No API key required.
- Rate limit
- No published hard limit; the endpoint is heavily cached.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the npm Download Counts API
Every request below was executed against the live API on 2026-08-20, and the response shown is the real body it returned — not an illustration.
1. Fetch weekly download counts
GET https://api.npmjs.org/downloads/point/last-week/react
curl 'https://api.npmjs.org/downloads/point/last-week/react'const res = await fetch("https://api.npmjs.org/downloads/point/last-week/react");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://api.npmjs.org/downloads/point/last-week/react", timeout=20)
res.raise_for_status()
print(res.json()){
"downloads": 143700450,
"start": "2026-08-12",
"end": "2026-08-18",
"package": "react"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
point/<period>/<package> | path | Optional | Total downloads for a period. point/last-week/react |
range/<period>/<package> | path | Optional | Per-day breakdown across a period. range/last-month/react |
<period> | path | Optional | last-day, last-week, last-month, last-year or a date range. last-week |
<scope> | path | Optional | Scoped packages need URL encoding. %40angular%2Fcore |
Response fields
downloadsinteger|array- Total for point queries, or an array of per-day objects for range queries.
start / endstring- The date range covered.
packagestring- Package name.
(range) downloads[].daystring- Date of that day's count.
(range) downloads[].downloadsinteger- Downloads on that day.
What you can build with the npm Download Counts API
- Show download counts as a popularity signal in documentation
- Compare adoption between competing libraries
- Chart a package's growth over time
- Build package comparison or discovery tooling
Common errors and how to fix them
404 for a scoped package
The @ and / need encoding.
Fix: Use %40scope%2Fname in the path.
Counts seem implausibly high
CI pipelines and mirrors are included.
Fix: Treat downloads as a relative comparison, not a count of human users.
Range limited to 18 months
Historical data is capped.
Fix: Split longer analyses into multiple range requests.
npm Download Counts API — frequently asked questions
Is the npm downloads API free?
Yes, completely free with no API key.
Do download counts reflect real users?
Not directly. They include CI pipelines, mirrors and automated installs, so absolute numbers overstate human usage considerably. They are reliable for comparing packages relative to each other.
How do I query a scoped package?
URL-encode it — @angular/core becomes %40angular%2Fcore in the path.
What is the difference between point and range?
point returns a single total for a period; range returns a per-day breakdown, which is what you need for charting growth over time.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Percentage Calculator
Calculate what X% of a number is, what percent one number is of another, and percentage increase or decrease between two values — instantly and free.
npm Download Counts is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-20; always check the official documentation before relying on this API in production, as terms and limits can change.