I am using the official Minecraft server API, but I am having trouble getting the server status information to display correctly. Specifically, I am struggling to parse the JSON response from the API and extract the relevant data.
Here is the code that I am using to make the API request: import requests import json
serverurl = "https://api.mcsrvstat.us/2/<serverip>" response = requests.get(serverurl) jsondata = json.loads(response.text)
When I try to access the data using json_data["players"]["online"], for example, I get a KeyError indicating that the "players" key does not exist.
I would appreciate any suggestions or guidance on how to properly parse and access the data returned by the API.
Thank you in advance for your help!