npm

Get npm downloads for every version

Get last week's npm downloads for every version of a package.

GET/v1/npm/package/downloads/versions
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
1
namestringrequiredquery

npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`.

max 214 chars

Response fields
9

Endpoint-specific response payload.

datalookupStatus
string

Whether the item exists. Every outcome is HTTP 200; branch on this field.

one of: found, not_found

datapackage
string

Package name.

datadownloads
object

Weekly downloads keyed by version. Only keys that are a real version or dist-tag are kept; an unknown package is `not_found`.

dataversionCount
integer

How many valid version keys the map has.

≥ 0

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

Code example

curl "https://api.socialfetch.dev/v1/npm/package/downloads/versions?name=express" \
  -H "x-api-key: YOUR_API_KEY"

Responses

npm downloads by version.