Skip to content

Commit

Permalink
Merge pull request #17 from PyBotDevs/add-more-endpoint-handlers
Browse files Browse the repository at this point in the history
Add some extra API endpoint handler functions
  • Loading branch information
notsniped authored Jul 2, 2023
2 parents bebdbc5 + 165572f commit 1a0b21f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,27 @@ def get_bingo_event(self) -> dict:
api_request = requests.get("https://api.hypixel.net/resources/skyblock/bingo").content
bingo_data = parse(api_request)
return bingo_data

def get_active_network_boosters(self):
"""Returns a `dict` of all of the active network boosters."""
api_request = requests.get(f"https://api.hypixel.net/boosters?key={self.api_key}").content
boosters_data = parse(api_request)
return boosters_data

def get_current_player_counts(self):
"""Returns a `dict` of the current player counts for all game modes."""
api_request = requests.get(f"https://api.hypixel.net/counts?key={self.api_key}").content
player_count_data = parse(api_request)
return player_count_data

def get_current_leaderboards(self):
"""Returns a `dict` of the current Hypixel leaderboards."""
api_request = requests.get(f"https://api.hypixel.net/leaderboards?key={self.api_key}").content
leaderboards_data = parse(api_request)
return leaderboards_data

def get_punishment_statistics(self):
"""Returns a `dict` of Hypixel's punishment statistics."""
api_request = requests.get(f"https://api.hypixel.net/punishmentstats?key={self.api_key}").content
punishment_stats_data = parse(api_request)
return punishment_stats_data

0 comments on commit 1a0b21f

Please sign in to comment.