Get npm package downloads
Get npm downloads for a package over a period or a day range, or the whole registry's total.
Headers
Get your API keyAPI key (`sfk_...`)
Package name. Omit it for the whole registry's download total.
max 214 chars
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.
Whether the item exists. Every outcome is HTTP 200; branch on this field.
one of: found, not_found
Package name, or null for the registry total.
The shape of this answer.
one of: total, daily
Downloads in the window for a total answer; null for daily.
≥ 0
First day of the counted range.
Last complete day of the counted range.
One row per day for a daily answer; null for a total.
Day, `YYYY-MM-DD`.
Downloads that day.
≥ 0
True when the returned range is narrower than the requested range, for example when it was longer than 18 months or began before 2015-01-10.
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/package/downloads?name=express&period=last-week" \
-H "x-api-key: YOUR_API_KEY"Responses
npm downloads.