Skip to content

Commit b1edf8d

Browse files
committed
Add API endpoint handler for fetching active player counts
1 parent 970782c commit b1edf8d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,9 @@ def get_active_network_boosters(self):
183183
api_request = requests.get(f"https://api.hypixel.net/boosters?key={self.api_key}").content
184184
boosters_data = parse(api_request)
185185
return boosters_data
186+
187+
def get_current_player_counts(self):
188+
"""Returns a `dict` of the current player counts for all game modes."""
189+
api_request = requests.get(f"https://api.hypixel.net/counts?key={self.api_key}").content
190+
player_count_data = parse(api_request)
191+
return player_count_data

0 commit comments

Comments
 (0)