import json
res_list = {}
req = requests.get('https://api.inews.qq.com/newsqa/v1/query/inner/publish/modules/list?modules=diseaseh5Shelf%27)
req_data = json.loads(req.text).get('data')
req_data = req_data.get('diseaseh5Shelf')
print('The second interface json verification passed')
lastupdatetime = req_data['lastUpdateTime']
chinatotal = req_data['chinaTotal']
chinaadd = req_data['chinaAdd']
areaTree = req_data['areaTree'][0]
res_list['lastUpdateTime'] = lastupdatetime
res_list['chinaTotal'] = chinatotal
res_list['chinaAdd'] = chinaadd
res_list['citydata'] = []
#for i_areaTree in areaTree['children']:
for i_areaTree_end in i_areaTree['children']:
city_name = i_areaTree_end['name']
if city_name in ['North Sea']:
print(city_name)
#if prov_name in['Beihai']:
for i_areaTree_end in i_areaTree['children']:
i_city_data = {}
i_city_data['prov_name'] = prov_name
i_city_data['city_name'] = i_areaTree_end['name']
i_city_data['local_confirm_add'] = i_areaTree_end['today']['local_confirm_add']#Add local
i_city_data['wzz_add'] = i_areaTree_end['today']['wzz_add']#Add asymptomatic
i_city_data['mediumRiskAreaNum'] = i_areaTree_end['total']['mediumRiskAreaNum']#Number of medium risk areas
i_city_data['highRiskAreaNum'] = i_areaTree_end['total']['highRiskAreaNum']#Number of middle risk areas
i_city_data['suspect'] = 0
i_city_data['dead'] = i_areaTree_end['total']['dead']
i_city_data['heal'] = i_areaTree_end['total']['heal']
i_city_data['grade'] = '' if (i_areaTree_end['total'].get('grade') is None) else
i_areaTree_end['total']['grade']
res_list['citydata'].append(i_city_data)
print(res_list)
![img](
Solution ideas and tried methods