Skip to content

Commit bcd092c

Browse files
committed
Add API endpoint handling for get_player_info()
1 parent f5d73ed commit bcd092c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ def get_uuid(self, player_name: str) -> str:
1414
return content["id"]
1515

1616
# API Retrieval Commands
17+
def get_player_info(self, player_name: str) -> dict:
18+
"""Fetches data of a specific player, including game stats."""
19+
player_uuid = self.get_uuid(player_name)
20+
api_request = requests.get(f"https://api.hypixel.net/player?key={self.api_key}&uuid={player_uuid}").content
21+
player_data = json.loads(api_request)
22+
return player_data
23+
1724
def get_auctions(self, page: int = 0) -> dict:
1825
"""
1926
Returns a `dict` of the 1000 latest auctions in Skyblock.

0 commit comments

Comments
 (0)