npm package weekly download counts as a normalized time series. Track any package's adoption trajectory, measure growth across periods, and spot emerging libraries before they dominate - via a single POST endpoint.
npm's own API at api.npmjs.org/downloads returns raw download counts. It's usable, but it requires you to pick specific date ranges, handle the pagination, normalize the numbers yourself if you want cross-package comparison, and rebuild that every time you want a different view.
Trends MCP wraps that into a consistent endpoint. Pass a package name, get back a normalized weekly series and growth figures.
POST https://api.trendsmcp.ai/api
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Weekly download trend for any npm package, normalized 0-100.
{
"source": "npm",
"keyword": "zod"
}
Response:
[
{
"date": "2026-03-21",
"value": 78,
"volume": null,
"keyword": "zod",
"source": "npm"
}
]
Daily mode for the last 30 days:
{
"source": "npm",
"keyword": "zod",
"data_mode": "daily"
}
One of the more direct uses: is this package still growing, or has adoption plateaued?
{
"source": "npm",
"keyword": "drizzle-orm",
"percent_growth": ["3M", "6M", "1Y"]
}
Custom date comparison - useful for measuring pre/post major version releases:
{
"source": "npm",
"keyword": "drizzle-orm",
"percent_growth": [
{ "name": "v1 release lift", "recent": "2026-01-01", "baseline": "2025-06-01" }
]
}
Preset periods: 7D 14D 30D 1M 2M 3M 6M 9M 12M 1Y 18M 24M 2Y 36M 3Y 48M 60M 5Y MTD QTD YTD
Python
import requests
res = requests.post(
"https://api.trendsmcp.ai/api",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"source": "npm", "keyword": "zod", "percent_growth": ["6M", "1Y"]}
)
data = res.json()
JavaScript
const res = await fetch("https://api.trendsmcp.ai/api", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({ source: "npm", keyword: "zod", percent_growth: ["6M", "1Y"] })
});
const data = await res.json();
FAQ