flathub-infra / website

Monorepo with website and API
https://flathub.org
Apache License 2.0
222 stars 88 forks source link

Add advanced stats API #31

Open JakobDev opened 2 years ago

JakobDev commented 2 years ago

We currently have https://flathub.org/api/v2/stats/{appid}](https://flathub.org/api/v2/stats{appid} which provides a simple download count (sone install count) for apps. This is good for the Frontend and things like Badges, but it would be good to have a additional API which provides more information. A example of more information is the site https://klausenbusk.github.io/flathub-stats. You can switch between updates, installs and the sum of both. And you can see the stats split by Architecture. The data come from https://flathub.org/stats, which provides a JSON file with all Apps for each day. It would be nice, if there was some API to query this data for a App, so you don't have to parse hundreds of JSON files.

I also saw that https://flathub.org/stats provides a count for Countries and Flatpak version. Would be nice, if this data could added two.

The new API respond could be look like this:

This new API could be used by 3rd party software to visualize all Data that Flathub has of a App. This informations would be interested for developer.

adrianinsaval commented 1 year ago

It would be nice to get stats for flathub-beta repo too