🌤️
实时天气预报
已测试可用GET天气与环境提供商: Open-Meteo Weather
获取全球城市实时天气、温度、风速等信息
#天气#气象#温度#免费
请求地址
GET https://api.open-meteo.com/v1/forecast在线测试
GET
https://api.open-meteo.com/v1/forecast注册并登录后即可在线测试 API
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| latitude | number | 是 | 纬度坐标,例如 39.9042 |
| longitude | number | 是 | 经度坐标,例如 116.4074 |
| current_weather | boolean | 否 | 是否包含当前天气数据 |
JavaScriptfetch
fetch('https://api.open-meteo.com/v1/forecast')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));cURL命令行
curl "https://api.open-meteo.com/v1/forecast"