import requests
url = "http://apis.juhe.cn/simpleWeather/query" # 接口的地址
params = {
"city": "武汉", # 输入任意一个城市
"key": "adfdb863ddb1101bb6b40c0700d6203b",
}
response = requests.get(url, params=params)
res = response.json()
print(res)
# if res['result'] == 0:
# print(False)
# else:
# print(True)
接口的地址如何查找:
key值如何查找: