Can you explain to me what's wrong with my code?

I came across an interesting problem while studying and have made code to it and I can't understand why it doesn't work. So that I can explain if not difficult where the error in this code:
api_url = ''
while True:
 inp = input()
 api_url2 = api_url + inp
 res = requests.get(api_url2, timeout = 5)
 ans = res.json()
 if ans.get('found') == True:
March 23rd 20 at 19:40
1 answer
March 23rd 20 at 19:42
Well, maybe the problem is that you did not read what is written on the website?
When sending the request via your links you will receive
written in type-plain, i.e. plain text, in the code you think is JSON and write res.json()

The site is written to get json Nada to add json to the request parameters...
Here's your same code in fact, the current with the correct link....

PS Python is too easy to do something wrong in the code, look at data and logic better...
Read docks to the API
Thank you very much! I have something to casually read information on the website. - Columbus_Cremin59 commented on March 23rd 20 at 19:45

Find more questions by tags Python