0

I'm using the Hypixel API while getting a response I try to find a certain key (last_save) in the json request.get(url) gets but while to print it, it keeps saying that the key doesn't exist this is my code

import requests
import json
api_key = 'API KEY HERE'
uuid = 'UUID HERE'
profileID = 'PROFILE ID HERE'

 #Set the player name to the desired username
player = 'PLAYER NAME HERE'

 #Make the request to the API
url = f'https://api.hypixel.net/skyblock/profile?key={api_key}&profile={profileID}'
response = requests.get(url)

 #Parse the JSON response
data = response.json()
last_save = data["last_save"]

 #Print the player's information
print(data['profile'])

this is the error it throws

'Traceback (most recent call last):
  File "c:\Users\...\main.py", line 16, in <module>
    last_save = data["last_save"]
KeyError: 'last_save''

how do i fix

null
  • 5
  • 2

0 Answers0