Skip to content

Instantly share code, notes, and snippets.

@mcneds
Created April 4, 2023 14:10
Show Gist options
  • Save mcneds/57f3a0ae8f82248e11ccbf5df3aa08b7 to your computer and use it in GitHub Desktop.
Save mcneds/57f3a0ae8f82248e11ccbf5df3aa08b7 to your computer and use it in GitHub Desktop.
[hypixel skyblock] retrieve data of sacks given uuid and profile
import requests
import os
from dotenv import load_dotenv
load_dotenv("secrets.env")
api_key = os.getenv("HYPIXEL_API_KEY")
uuid = "78eac36d-1de3-48e9-8ef0-bd65d90953ef"
profile = "Banana"
item_name = "CRUDE_GABAGOOL"
crude_gabagool_count=0
def get_sack_data(uuid, profile, api_key):
uuid = uuid.replace("-", "")
data = requests.get(f"https://api.hypixel.net/skyblock/profiles?key={api_key}&uuid={uuid}").json()
for profile_data in data["profiles"]:
if profile_data.get("cute_name") == profile:
print("found")
crude_gabagool_count = int(
profile_data["members"][f"{uuid}"]["sacks_counts"][item_name]
)
break
print(crude_gabagool_count)
get_sack_data(uuid, profile, api_key)
#token unused as of now
DISCORD_TOKEN=token of discord bot you wanna use
HYPIXEL_API_KEY=your api key here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment