From b1ad8d6266c1359a0419ef412a99420f373bb8d8 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Thu, 5 Jan 2023 10:07:23 +0530 Subject: [PATCH] Add API endpoint return function for getting recently ended auctions --- api.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api.py b/api.py index f3e0639..bb42866 100644 --- a/api.py +++ b/api.py @@ -34,6 +34,14 @@ def get_player_auctions(self, player_name: str) -> dict: player_auctions = json.loads(api_request) return player_auctions + def get_recently_ended_auctions(self) -> dict: + """ + Returns a `dict` of all the auctions that have recently ended within 60 seconds. + """ + api_request = requests.get("https://api.hypixel.net/skyblock/auctions_ended").content + recently_ended_auctions = json.loads(api_request) + return recently_ended_auctions + def get_news(self) -> dict: """ Returns a `dict` of the latest Skyblock news from Hypixel.