import requests
import json
# 通传入日期和身份号编码获取数据
def get_data(start_date,end_date):
# url = "https://heat.qq.com/api/getLocation_uv_percent_new.php?region=790&date_begin=2020-09-27&date_end=2020-09-28&range=60&predict=true".format(date)
url = "https://heat.qq.com/api/getLocation_uv_percent_new.php?region=790&date_begin={}&date_end={}&range=60&predict=true".format(start_date,end_date)
res = requests.get(url)
return res.text
start_date="2020-09-01"
end_date="2020-09-08" #时间间隔为10天
#for date in date_list:
res_text = get_data(start_date,end_date)
print(res_text)
# print(res_text)
# results = res_text.replace('{"status":0,"data":', "").replace("}", "")
# print(results)
# for item in json.loads(results):
# print(item)
36python腾讯位置大数据位置流量趋势
最新推荐文章于 2025-05-16 01:17:39 发布
本文介绍了一个Python脚本示例,该脚本通过调用腾讯热力图API来获取特定日期范围内的人流量数据。具体展示了如何构造请求URL、发送GET请求并解析返回的响应文本。
1862

被折叠的 条评论
为什么被折叠?



