So , i made this small program to update about the lowest_price of a specific item on steam market , it runs a loop and gets json response.
It works fine initially , displays the price , but after a while it shows the error.
The program code :
import json
import requests
def GetPrice () :
response = requests.get ('https://steamcommunity.com/market/priceoverview/?appid=264710¤cy=1&market_hash_name=Planet%204546B%20Postcard')
json_data = {}
json_data = json.loads (response.text)
return json_data ["lowest_price"]
while True :
print (GetPrice ())
Here is the output of the program :
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
$1.03
Traceback (most recent call last):
File "C:\Users\Admin\Desktop\item_price.py", line 16, in <module>
print (GetPrice ())
File "C:\Users\Admin\Desktop\item_price.py", line 12, in GetPrice
return json_data ["lowest_price"]
TypeError: 'NoneType' object is not subscriptable
[Finished in 20.2s]