openweathermap-免費的天氣預報接口
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLiYWan5SNyIDOwQDO5ADN0gDMxIzLcBTM0EDMy8CXyQTN3AjNvw1ZvxmYvwVbvNmLn9GbiRXauNmLzV2Zh1Wavw1LcpDc0RHaiojIsJye.gif)
其官方網址為:http://www.openweathermap.org/api
靜态截圖:
具備以下的一些特點:
1. current weather data 目前天氣的資料
2. 5 and 16 day forecast 5到16天的天氣預報
3. historical data 以往的天氣資訊
4. weather stations 氣象站點
5. weather map layers 詳細的氣象資訊
以下是本人的測試結果(根據經緯度直接擷取天氣預報的資訊的接口示例,傳回的資料為json):
列印資訊如下:
{
city = {
coord = {
lat = "39.905281";
lon = "116.599442";
};
country = cn;
id = 1792520;
name = tongzhou;
population = 0;
};
cnt = 7;
cod = 200;
list = (
{
clouds = 48;
deg = 254;
dt = 1413860400;
humidity = 49;
pressure = "1018.75";
speed = "2.06";
temp = {
day = "290.15";
eve = "289.23";
max = "291.57";
min = "279.75";
morn = "285.15";
night = "279.75";
};
weather = (
{
description = "\u591a\u4e91";
icon = 03d;
id = 802;
main = clouds;
}
);
},
clouds = 44;
deg = 184;
dt = 1413946800;
humidity = 56;
pressure = "1016.36";
speed = "1.71";
day = "287.61";
eve = "287.9";
max = "289.8";
min = "277.35";
morn = "277.35";
night = "279.92";
clouds = 0;
deg = 214;
dt = 1414033200;
humidity = 0;
pressure = "1003.24";
speed = "1.89";
day = "291.47";
eve = "281.35";
max = "291.47";
min = "277.05";
morn = "278.44";
night = "277.05";
description = "\u6674";
icon = 01d;
id = 800;
main = clear;
deg = 162;
dt = 1414119600;
pressure = "1002.31";
speed = "1.98";
day = "293.07";
eve = "284.09";
max = "293.07";
min = "279.56";
morn = "280.17";
night = "279.56";
clouds = 1;
deg = 84;
dt = 1414206000;
pressure = "1009.16";
speed = "6.79";
day = "292.6";
eve = "285.1";
max = "292.6";
min = "279.54";
morn = "282.6";
night = "279.54";
description = "\u5c0f\u96e8";
icon = 10d;
id = 500;
main = rain;
clouds = 15;
deg = 212;
dt = 1414292400;
pressure = "1011.96";
speed = "2.17";
day = "290.18";
eve = "282.25";
max = "290.18";
min = "279.5";
morn = "279.93";
night = "279.5";
clouds = 24;
deg = 151;
dt = 1414378800;
pressure = "1006.46";
speed = "1.88";
day = "290.33";
eve = "282.58";
max = "290.33";
min = "279.86";
morn = "282.81";
night = "279.86";
}
);
message = "0.3612";
}
其他的就自己去看官方api了,不過是英文的。