v5

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-167122208.0 KB
stats

downloads_detail (node.js)

Retrieve the details of all the downloads for a particular package given a particular criteria. This is specific to a single package inside a repository.

Default date range is 7 days ago. See response headers for pagination information.

Repository owners only

Instead of constructing these URLs by hand, you should use the generated versions returned from any of these API's, which are guaranteed to be correct for all supported package types:

Example request:

/api/v1/repos/julio/test_repo/package/gem/my-gem/1.2.0/stats/downloads/detail.json
get/api/v1/repos/{user_id}/{repo}/package/node/{package}/{version}/stats/downloads/detail.json

Path parameters

user_idstring required

The user this repo belongs to.

repostring required

The name of this repository.

packagestring required

The name of the package. If the package is a scoped Node.JS package include the scope and an escaped '/' (e.g. @scope%2Fname).

versionstring required

The version number of the package.

Query parameters

end_datestring

An ISO8601 ending date (e.g., 20160231Z).

master_tokenstring

The master_token name or id to filter downloads by.

pageinteger

One-based page index.

per_pageinteger

Items per page (default 30). Values above the server's Max-Per-Page are clamped; inspect the Max-Per-Page response header for the effective cap.

read_tokenstring

The read_token name or id to filter downloads by (:master_token required).

sourcestring

The source to filter downloads by, must be "web" or "cli."

start_datestring

An ISO8601 starting date (e.g., 20160231Z).

user_agentstring

The user_agent to filter downloads by.

Response

PackageDownloads JSON object containing details of all downloads

downloaded_atstring

The date this package was downloaded (UTC)

ip_addressstring

The ip address of this package download

user_agentstring

The user agent of the client which downloaded the package

sourcestring

The source of the package download ("web" or "cli")

read_tokenstring

The name of the read token (for private repositories)