加载中...

OpenWeatherMap

免费

提供商:OpenWeather

全球覆盖的天气数据平台,提供实时天气、历史数据、天气图层等,支持 200 多个国家。

实时天气全球覆盖REST免费

快速接入示例

cURL
curl -X GET "https://api.openweathermap.org/data/2.5/weather" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
JavaScript / Node.js
const response = await fetch('https://api.openweathermap.org/data/2.5/weather', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
});
const data = await response.json();
console.log(data);
Python
import requests

url = "https://api.openweathermap.org/data/2.5/weather"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)