笔记-windy气象数据获取

文章讨论了如何通过设置代理访问被墙的Windy气象数据API,展示了一个示例程序来获取点预测数据。API返回的时间间隔不固定,每年的费用大约在7-8千人民币。同时提到,Windy的数据来源在API文档中有详细说明,而GitHub上的Windy爬虫可能已不再适用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • 气象数据获取
    • 网站: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直接返回

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YingCai85

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值