Get npm downloads for several packages
Get npm downloads for up to 128 package names in one call, one result per requested name.
Headers
Get your API keyAPI key (`sfk_...`)
Comma-separated package names, 1 to 128, with at most 20 scoped names because each one is looked up separately.
Window: `last-day`, `last-week`, `last-month` or `last-year`. Default: `last-week` unless `from`/`to` are given.
one of: last-day, last-week, last-month, last-year
First day of the range, `YYYY-MM-DD`. Download data starts on 2015-01-10; a `from` after today is refused. A range spans up to 18 months; a longer range keeps its newest 18 months and sets `clamped`.
Last day of the range, `YYYY-MM-DD`. Must be on or after `from`; a `to` before 2015-01-10 is refused. A range spans up to 18 months; a longer range keeps its newest 18 months and sets `clamped`.
`total` for one number, `daily` for one row per day. Default: `total`.
one of: total, daily
Endpoint-specific response payload.
One row per requested name, in request order.
Requested package name.
`found` with data, `not_found` when npm says the package does not exist, `unavailable` when that name's data was temporarily unavailable.
one of: found, not_found, unavailable
First day of the counted range.
Last complete day of the counted range.
Downloads for a total answer; null otherwise.
≥ 0
One row per day for a daily answer; null otherwise.
Day, `YYYY-MM-DD`.
Downloads that day.
≥ 0
Counts over the requested names.
Names requested.
≥ 0
Names with data.
≥ 0
Names npm does not have.
≥ 0
Names whose data was temporarily unavailable.
≥ 0
Pagination state for this page.
Whether another page is available.
Opaque cursor for the next request; null on the last page.
The 1-based page number of this response, when numbered.
≥ 0
Rows per page, when fixed.
≥ 0
Total rows, or null when npm does not publish one.
≥ 0
Metadata describing the request and billing outcome.
Unique request identifier for tracing this API call.
min 1 chars
Credits charged for this request.
≥ 0
Public API version that served the response.
one of: v1
Code example
curl "https://api.socialfetch.dev/v1/npm/packages/downloads?names=express,react,lodash" \
-H "x-api-key: YOUR_API_KEY"Responses
npm downloads by name.