- 气象数据获取
- 网站:https://www.windy.com/?23.118,113.254,5
- 接口:Windy: Point Forecast API - Docs
- 问题
- 接口域名被墙,使用需要通过代理才能连通
-
示例程序
``` import requests import os # https://www.windy.com/21.572/111.832?20.987,111.833,8 os.environ["http_proxy"] = "http://127.0.0.1:1088" os.environ["https_proxy"] = "http://127.0.0.1:1088" import requests import json api_url = 'https://api.windy.com/api/point-forecast/v2' data = { "lat": 20.987, "lon": 111.833, "model": "gfs", "parameters": ["wind", "dewpoint", "rh", "pressure"], "key": "你的key" } response = requests.post(api_url, json=data) print(response.text) result = response.json() ```
-
API返回数据时间间隔不定,如
``` 2023-07-26 05:00:00 2023-07-26 08:00:00 2023-07-26 11:00:00 2023-07-26 14:00:00 2023-07-26 17:00:00 2023-07-26 20:00:00 2023-07-26 23:00:00 2023-07-27 02:00:00 2023-07-27 05:00:00 2023-07-27 08:00:00 2023-07-27 11:00:00 2023-07-27 14:00:00 2023-07-27 17:00:00 2023-07-27 20:00:00 2023-07-27 23:00:00 2023-07-28 02:00:00 2023-07-28 05:00:00 2023-07-28 08:00:00 2023-07-28 11:00:00 2023-07-28 14:00:00 2023-07-28 17:00:00 2023-07-28 20:00:00 2023-07-28 23:00:00 2023-07-29 02:00:00 2023-07-29 05:00:00 2023-07-29 08:00:00 2023-07-29 11:00:00 2023-07-29 14:00:00 2023-07-29 17:00:00 2023-07-29 20:00:00 2023-07-29 23:00:00 2023-07-30 02:00:00 2023-07-30 05:00:00 2023-07-30 08:00:00 2023-07-30 11:00:00 2023-07-30 14:00:00 2023-07-30 17:00:00 2023-07-30 20:00:00 2023-07-30 23:00:00 2023-07-31 02:00:00 2023-07-31 05:00:00 2023-07-31 08:00:00 2023-07-31 11:00:00 2023-07-31 14:00:00 2023-07-31 17:00:00 2023-07-31 20:00:00 2023-07-31 23:00:00 2023-08-01 02:00:00 2023-08-01 05:00:00 2023-08-01 08:00:00 2023-08-01 11:00:00 2023-08-01 14:00:00 2023-08-01 17:00:00 2023-08-01 20:00:00 2023-08-01 23:00:00 2023-08-02 02:00:00 2023-08-02 05:00:00 2023-08-02 08:00:00 2023-08-02 11:00:00 2023-08-02 14:00:00 2023-08-02 17:00:00 2023-08-02 20:00:00 2023-08-02 23:00:00 2023-08-03 02:00:00 2023-08-03 05:00:00 2023-08-03 08:00:00 2023-08-03 11:00:00 2023-08-03 14:00:00 2023-08-03 17:00:00 2023-08-03 20:00:00 2023-08-03 23:00:00 2023-08-04 02:00:00 2023-08-04 05:00:00 2023-08-04 08:00:00 2023-08-04 11:00:00 2023-08-04 14:00:00 2023-08-04 17:00:00 2023-08-04 20:00:00 2023-08-04 23:00:00 2023-08-05 02:00:00 ```
API被墙,项目侧使用需考虑合规专线网络调用
API费用约一年7-8k RMB
windy的数据来源在API文档中有详细说明
Github上仅有的windy爬虫通过查看源代码判断基本已不可使用,底部信息栏数据并没有通过html直接返回