Add API to get all package stats

This commit is contained in:
rubenwardy
2022-11-15 01:51:21 +00:00
parent 292b4f5483
commit 01bc519b86
3 changed files with 43 additions and 11 deletions

View File

@@ -112,14 +112,20 @@ Tokens can be attained by visiting [Settings > API Tokens](/user/tokens/).
* Returns daily stats for package, or null if there is no data.
* Daily date is done based on the UTC timezone.
* EXPERIMENTAL. This API may change without warning.
* A table with the following keys:
* `from`: start date, inclusive. Ex: 2022-10-22.
* An object with the following keys:
* `start`: start date, inclusive. Ex: 2022-10-22.
* `end`: end date, inclusive. Ex: 2022-11-05.
* `platform_minetest`: list of integers per day.
* `platform_other`: list of integers per day.
* `reason_new`: list of integers per day.
* `reason_dependency`: list of integers per day.
* `reason_update`: list of integers per day.
* GET `/api/package_stats/`
* Returns last 30 days of daily stats for _all_ packages.
* An object with the following keys:
* `start`: start date, inclusive. Ex: 2022-10-22.
* `end`: end date, inclusive. Ex: 2022-11-05.
* `package_downloads`: map from package key to list of download integers.
You can download a package by building one of the two URLs: