I want to make an application that can tell you the Steam AppID when you insert the name of the game as input, but I do not know how to display the name of the game selected and the AppID properly to the user.
The AppID and the Game's name is on this format: {"appid":000000,"name":"Game_Name"}. What I want to communicate then, is the "Game Name" and then the number of the appid right after it.
Here's the code I got thus far, I got another code for a GUI, this is the fetcher from which I would import the data, I'm planning on calling the input from the GUI as the Game_Fetched variable.
while True:
import requests
from bs4 import BeautifulSoup
# Definitions
SteamAPI = 'https://api.steampowered.com/ISteamApps/GetAppList/v2/'
response = requests.get(SteamAPI)
soup = BeautifulSoup(response.text, "html.parser")
Game_List = str(soup)
Line = 'Undefined'
# Start of script
print('Game to be fetched')
Game_fetched = input()
if str(Game_fetched) in Game_List:
**(Uncertain)**
if Line == -1:
print("Game not found")
This should be as minimal as it gets while also working, some other strings are needed, for instance upper and lower for games with upper and lower case to be properly read, but for the question it will suffice, to the point, I do not know what to write in the (Uncertain) line of the code to make the script read the name and the appid thereof.
Thanks for reading and for your help.