@@ -10,17 +10,18 @@ def __init__(self, api_key: str):
10
10
11
11
def get_uuid (self , player_name : str ) -> str :
12
12
api_request = requests .get (f"https://api.mojang.com/users/profiles/minecraft/{ player_name } " )
13
- return api_request .text
13
+ content = json .loads (api_request .content )
14
+ return content ["id" ]
14
15
15
16
# API Retrieval Commands
16
- def get_auctions (self , * , page : int = 0 ):
17
+ def get_auctions (self , page : int = 0 ):
17
18
"""
18
19
Returns a `dict` of the 1000 latest auctions in Skyblock.
19
20
20
21
Optional args:
21
22
* `page`: View a specific page of auctions.
22
23
"""
23
- api_request = requests .get (f"https://api.hypixel.net/skyblock/auctions?key={ self .api_key } &page={ page } " )
24
+ api_request = requests .get (f"https://api.hypixel.net/skyblock/auctions?key={ self .api_key } &page={ page } " ). content
24
25
auctions = json .loads (api_request )
25
26
return auctions
26
27
@@ -29,23 +30,23 @@ def get_player_auctions(self, player_name: str):
29
30
Returns a `dict` of all Skyblock auctions from a particular player.
30
31
"""
31
32
player_uuid = self .get_uuid (player_name )
32
- api_request = requests .get (f"https://api.hypixel.net/skyblock/auction?key={ self .api_key } &player={ player_uuid } " )
33
+ api_request = requests .get (f"https://api.hypixel.net/skyblock/auction?key={ self .api_key } &player={ player_uuid } " ). content
33
34
player_auctions = json .loads (api_request )
34
35
return player_auctions
35
36
36
37
def get_news (self ):
37
38
"""
38
39
Returns a `dict` of the latest Skyblock news from Hypixel.
39
40
"""
40
- api_request = requests .get (f"https://api.hypixel.net/skyblock/news?key={ self .api_key } " )
41
+ api_request = requests .get (f"https://api.hypixel.net/skyblock/news?key={ self .api_key } " ). content
41
42
news = json .loads (api_request )
42
43
return news
43
44
44
45
def get_bazaar_data (self ):
45
46
"""
46
47
Returns a `dict` of Skyblock bazaar data.
47
48
"""
48
- api_request = requests .get (f"https://api.hypixel.net/skyblock/bazaar?key={ self .api_key } " )
49
+ api_request = requests .get (f"https://api.hypixel.net/skyblock/bazaar?key={ self .api_key } " ). content
49
50
bazaar_data = json .loads (api_request )
50
51
return bazaar_data
51
52
@@ -54,22 +55,22 @@ def get_player_profile(self, player_name: str):
54
55
Returns a `dict` of profile data on a player.
55
56
"""
56
57
player_uuid = self .get_uuid (player_name )
57
- api_request = requests .get (f"https://api.hypixel.net/skyblock/profiles?key={ self .api_key } &uuid={ player_uuid } " )
58
+ api_request = requests .get (f"https://api.hypixel.net/skyblock/profiles?key={ self .api_key } &uuid={ player_uuid } " ). content
58
59
player_profile_data = json .loads (api_request )
59
60
return player_profile_data
60
61
61
62
def get_collections (self ):
62
63
"""
63
64
Returns a `dict` of information related to Skyblock Collections.
64
65
"""
65
- api_request = requests .get ("https://api.hypixel.net/resources/skyblock/collections" )
66
+ api_request = requests .get ("https://api.hypixel.net/resources/skyblock/collections" ). content
66
67
collections_data = json .loads (api_request )
67
68
return collections_data
68
69
69
70
def get_skills (self ):
70
71
"""
71
72
Returns a `dict` of information related to Skyblock Skills.
72
73
"""
73
- api_request = requests .get ("https://api.hypixel.net/resources/skyblock/skills" )
74
+ api_request = requests .get ("https://api.hypixel.net/resources/skyblock/skills" ). content
74
75
collections_data = json .loads (api_request )
75
76
return collections_data
0 commit comments