Skip to content

Commit 281e626

Browse files
authored
Merge pull request #10 from PyBotDevs/player-data-endpoint
Add API endpoint handling for `get_player_info()`
2 parents f5d73ed + bcd092c commit 281e626

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)