PyPI Stats

Search

All packages
Top packages

Track packages

PyPI Stats API


PyPI Stats provides a simple JSON API for retrieving aggregate download stats and time series for packages. The following are the valid endpoints using host: https://pypistats.org/

NOTES

API Client

The pypistats package is a python client and CLI tool for easily accessing, aggregating, and formatting results from the API. To install, use pip:

pip install -U pypistats
Refer to the documentation for usage.

Endpoints

/api/packages/<package>/recent

Retrieve the aggregate download quantities for the last day/week/month.

Query arguments:

Example response:
{
  "data": {
    "last_day": 1,
    "last_month": 2,
    "last_week": 3
  },
  "package": "package_name",
  "type": "recent_downloads"
}

/api/packages/<package>/overall

Retrieve the aggregate daily download time series with or without mirror downloads.

Query arguments:

Example response:
{
  "data": [
    {
      "category": "with_mirrors",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "without_mirrors",
      "date": "2018-02-08",
      "downloads": 1
    }
  ],
  "package": "package_name",
  "type": "overall_downloads"
}

/api/packages/<package>/python_major

Retrieve the aggregate daily download time series by Python major version number.

Query arguments:

Example response:
{
  "data": [
    {
      "category": "2",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "3",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "null",
      "date": "2018-02-08",
      "downloads": 1
    }
  ],
  "package": "package_name",
  "type": "python_major_downloads"
}

/api/packages/<package>/python_minor

Retrieve the aggregate daily download time series by Python minor version number.

Query arguments:

Example response:
{
  "data": [
    {
      "category": "2.6",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "2.7",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "3.2",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "3.3",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "3.4",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "3.5",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "3.6",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "3.7",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "null",
      "date": "2018-02-08",
      "downloads": 1
    }
  ],
  "package": "package_name",
  "type": "python_minor_downloads"
}

/api/packages/<package>/system

Retrieve the aggregate daily download time series by operating system.

Query arguments:

Example response:
{
  "data": [
    {
      "category": "darwin",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "linux",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "null",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "other",
      "date": "2018-02-08",
      "downloads": 1
    },
    {
      "category": "windows",
      "date": "2018-02-08",
      "downloads": 1
    }
  ],
  "package": "package_name",
  "type": "system_downloads"
}