I'm trying to make a excel workbook for a game called torn city. I want users to be able to input their game key into a cell and then excel automatically pulls the data from a link with the combined key. For example this is my key(VNWZibo54fSCUM01) and link for the data is: https://api.torn.com/user/?selections=honors&key=VNWZibo54fSCUM01 Now when you go to this specific website it shows the awards that you have gotten for the game, It is in a JSON format with the two things in it being honors_awarded and honors_time. I want the honors_awarded list to be displayed when a user inputs his key into a cell.
I have been able to get the data in excel with this url(https://api.torn.com/user/?selections=honors&key=VNWZibo54fSCUM01)
How this data looks
but I want to have a more user friendly interface. I want this done by simply having users input their key into a cell the the data appears
Might be irrelevant but I also have this python code that does the get the data i want but I dont know if this will be able to be in excel
import requests
api = input("Enter your api key")
url = f"https://api.torn.com/user/?selections=honors&key={api}"
response = requests.get(url)
if response.status_code == 200:
data = response.json() # Parse JSON response into a Python dictionary
if 'honors_awarded' in data:
honors_awarded = data['honors_awarded']
for data_list in honors_awarded:
print(data_list)
else:
print("The key 'honors_awarded' does not exist in the response.")
else:
print("Failed to retrieve data:", response.status_code)
Any suggestions?

