Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_uuid(self, player_name: str) -> str:
return content["id"]

# API Retrieval Commands
def get_auctions(self, page: int = 0):
def get_auctions(self, page: int = 0) -> dict:
"""
Returns a `dict` of the 1000 latest auctions in Skyblock.

Expand All @@ -25,7 +25,7 @@ def get_auctions(self, page: int = 0):
auctions = json.loads(api_request)
return auctions

def get_player_auctions(self, player_name: str):
def get_player_auctions(self, player_name: str) -> dict:
"""
Returns a `dict` of all Skyblock auctions from a particular player.
"""
Expand All @@ -34,23 +34,23 @@ def get_player_auctions(self, player_name: str):
player_auctions = json.loads(api_request)
return player_auctions

def get_news(self):
def get_news(self) -> dict:
"""
Returns a `dict` of the latest Skyblock news from Hypixel.
"""
api_request = requests.get(f"https://api.hypixel.net/skyblock/news?key={self.api_key}").content
news = json.loads(api_request)
return news

def get_bazaar_data(self):
def get_bazaar_data(self) -> dict:
"""
Returns a `dict` of Skyblock bazaar data.
"""
api_request = requests.get(f"https://api.hypixel.net/skyblock/bazaar?key={self.api_key}").content
bazaar_data = json.loads(api_request)
return bazaar_data

def get_player_profile(self, player_name: str):
def get_player_profile(self, player_name: str) -> dict:
"""
Returns a `dict` of profile data on a player.
"""
Expand All @@ -59,31 +59,31 @@ def get_player_profile(self, player_name: str):
player_profile_data = json.loads(api_request)
return player_profile_data

def get_collections(self):
def get_collections(self) -> dict:
"""
Returns a `dict` of information related to Skyblock Collections.
"""
api_request = requests.get("https://api.hypixel.net/resources/skyblock/collections").content
collections_data = json.loads(api_request)
return collections_data

def get_skills(self):
def get_skills(self) -> dict:
"""
Returns a `dict` of information related to Skyblock Skills.
"""
api_request = requests.get("https://api.hypixel.net/resources/skyblock/skills").content
collections_data = json.loads(api_request)
return collections_data

def get_items(self):
def get_items(self) -> dict:
"""
Returns a `dict` of information related to Skyblock items.
"""
api_request = requests.get("https://api.hypixel.net/resources/skyblock/items").content
items_data = json.loads(api_request)
return items_data

def get_mayor_information(self):
def get_mayor_information(self) -> dict:
"""
Returns a `dict` of information regarding the current mayor in Skyblock.
"""
Expand All @@ -92,7 +92,7 @@ def get_mayor_information(self):
del mayor_info["current"]
return mayor_info

def get_current_election(self):
def get_current_election(self) -> dict:
"""
Returns a `dict` of information regarding the current election in Skyblock.
"""
Expand Down