Last active
October 30, 2025 09:50
-
-
Save Goby56/f81b43508f6370ef9e471be6dc17b48d to your computer and use it in GitHub Desktop.
Script to get a rough overview of which Minecraft version people are playing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script will retrieve all versions of FabricAPI available on Modrinth. | |
| # By getting an estimate of how many downloads per day players download Fabric API | |
| # for a particular version of Minecraft, we can get a somewhat good estimate of | |
| # which Minecraft version is the most popular. We use Fabric API as it most likely | |
| # is the first mod of choice someone installs. | |
| import requests, re, datetime, tabulate | |
| fapi_versions = requests.get("https://api.modrinth.com/v2/project/fabric-api/version") | |
| date = datetime.datetime.now() | |
| most_downloaded = {} | |
| for v in reversed(fapi_versions.json()): | |
| date_str = re.search("[0-9]{4}-[0-9]{2}-[0-9]{2}", v["date_published"]).group().split("-") | |
| age = date - datetime.datetime(int(date_str[0]), int(date_str[1]), int(date_str[2])) | |
| days_out = age.days if age.days != 0 else 1 # Division by zero if on same day as publish | |
| daily_downloads = v["downloads"] / days_out | |
| version = v["game_versions"][0] | |
| if version not in most_downloaded: | |
| most_downloaded[version] = [0, age.days] | |
| most_downloaded[version][0] += daily_downloads | |
| l = list(sorted(most_downloaded.items(), key=lambda x: x[1], reverse=True))[:10] | |
| print("-- Number of downloads of the Fabric API --") | |
| print(tabulate.tabulate([[v[0], int(v[1][0]), v[1][1]] for v in l], headers=["MC version", "Daily downloads", "Days old"])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment