openweathermap-免费的天气预报接口

其官方网址为: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):

    // http://www.openweathermap.org/api
// http://www.openweathermap.org/current
// http://www.openweathermap.org/forecast
// http://www.openweathermap.org/weather-conditions
NETWorkRequest *request = [[NETWorkRequest alloc] initWithUrlString:@"http://api.openweathermap.org/data/2.5/forecast/daily?lat=39.88293652833437&lon=116.4621119300779&lang=zh_cn"]; NETWorkConnection *connection = [[NETWorkConnection alloc] initWithRequest:request];
[connection infoBlock:^(NSDictionary *info, NETWorkConnection *myConnection) {
} progressBlock:^(long long currentBytes, long long totalBytes, NETWorkConnection *myConnection) {
} resultBlock:^(NSDictionary *info, NSData *data, NSError *error, NETWorkConnection *myConnection) {
NSLog(@"%@", [data toPropertyList]);
}];
[connection start];

打印信息如下:

{

    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";

            temp =             {

                day = "287.61";

                eve = "287.9";

                max = "289.8";

                min = "277.35";

                morn = "277.35";

                night = "279.92";

            };

            weather =             (

                                {

                    description = "\U591a\U4e91";

                    icon = 03d;

                    id = 802;

                    main = Clouds;

                }

            );

        },

                {

            clouds = 0;

            deg = 214;

            dt = 1414033200;

            humidity = 0;

            pressure = "1003.24";

            speed = "1.89";

            temp =             {

                day = "291.47";

                eve = "281.35";

                max = "291.47";

                min = "277.05";

                morn = "278.44";

                night = "277.05";

            };

            weather =             (

                                {

                    description = "\U6674";

                    icon = 01d;

                    id = 800;

                    main = Clear;

                }

            );

        },

                {

            clouds = 0;

            deg = 162;

            dt = 1414119600;

            humidity = 0;

            pressure = "1002.31";

            speed = "1.98";

            temp =             {

                day = "293.07";

                eve = "284.09";

                max = "293.07";

                min = "279.56";

                morn = "280.17";

                night = "279.56";

            };

            weather =             (

                                {

                    description = "\U6674";

                    icon = 01d;

                    id = 800;

                    main = Clear;

                }

            );

        },

                {

            clouds = 1;

            deg = 84;

            dt = 1414206000;

            humidity = 0;

            pressure = "1009.16";

            speed = "6.79";

            temp =             {

                day = "292.6";

                eve = "285.1";

                max = "292.6";

                min = "279.54";

                morn = "282.6";

                night = "279.54";

            };

            weather =             (

                                {

                    description = "\U5c0f\U96e8";

                    icon = 10d;

                    id = 500;

                    main = Rain;

                }

            );

        },

                {

            clouds = 15;

            deg = 212;

            dt = 1414292400;

            humidity = 0;

            pressure = "1011.96";

            speed = "2.17";

            temp =             {

                day = "290.18";

                eve = "282.25";

                max = "290.18";

                min = "279.5";

                morn = "279.93";

                night = "279.5";

            };

            weather =             (

                                {

                    description = "\U6674";

                    icon = 01d;

                    id = 800;

                    main = Clear;

                }

            );

        },

                {

            clouds = 24;

            deg = 151;

            dt = 1414378800;

            humidity = 0;

            pressure = "1006.46";

            speed = "1.88";

            temp =             {

                day = "290.33";

                eve = "282.58";

                max = "290.33";

                min = "279.86";

                morn = "282.81";

                night = "279.86";

            };

            weather =             (

                                {

                    description = "\U6674";

                    icon = 01d;

                    id = 800;

                    main = Clear;

                }

            );

        }

    );

    message = "0.3612";

}

其他的就自己去看官方api了,不过是英文的。

openweathermap-免费的天气预报接口的更多相关文章

  1. 开源免费的天气预报接口API以及全国所有地区代码(国家气象局提供)

    天气预报一直是各大网站的一个基本功能,最近小编也想在网站上弄一个,得瑟一下,在网络搜索了很久,终于找到了开源免费的天气预报接口API以及全国所有地区代码(国家气象局提供),具体如下: 国家气象局提供的 ...

  2. [Android] 免费天气预报接口

    [Android] 免费天气预报接口 这是 国家气象局提供的天气预报接口 [免费] 当然,网上有很多的收费API或者每天定次数的接口 使用 国家气象局 的步骤如下: 1.首先获取城市ID号 北京:10 ...

  3. 开源免费天气预报接口API以及全国所有地区代码!!(国家气象局提供) 【转】

    国家气象局提供的天气预报接口 接口地址: http://www.weather.com.cn/data/sk/101010100.html http://www.weather.com.cn/data ...

  4. 开源免费天气预报接口API以及全国全部地区代码!!(国家气象局提供)

    国家气象局提供的天气预报接口 接口地址: http://www.weather.com.cn/data/sk/101010100.html http://www.weather.com.cn/data ...

  5. 开源免费天气预报接口API以及全国所有地区代码[值得收藏]

    国家气象局提供的天气预报接口 接口地址: http://www.weather.com.cn/data/sk/101010100.html http://www.weather.com.cn/data ...

  6. (转)免费天气预报接口API以及全国所有地区代码!!

    国家气象局提供的天气预报接口 接口地址: http://www.weather.com.cn/data/sk/101010100.html http://www.weather.com.cn/data ...

  7. 免费web api接口大全

    下面的接口来自互联网,部分功能需要付费 查询手机 http://www.yodao.com/smartresult-xml/search.s?type=mobile&q=手机号码 查询IP h ...

  8. 互联网 免费的WebService接口

    winform开发暂告于段落,最近再用webservice写接口,接下来的一段时间应该偏向于此方向. (转)一批的免费webservice接口,没有技术含量,只是写在这里做个记忆 股票行情数据 WEB ...

  9. JAVA的免费天气api接口调用示例

    step1:选择本文所示例的接口"免费天气api" url:https://www.juhe.cn/docs/api/id/39/aid/87 step2:每个接口都需要传入一个参 ...

随机推荐

  1. 代码查看php是否已开启rewrite功能模块

    通过php代码来查询,是否把rewrite模块打开了 <?php $result = apache_get_modules(); if(in_array('mod_rewrite', $resu ...

  2. Memcached理解笔记4---应对高并发攻击

    近半个月过得很痛苦,主要是产品上线后,引来无数机器用户恶意攻击,不停的刷新产品各个服务入口,制造垃圾数据,消耗资源.他们的最好成绩,1秒钟可以并发6次,赶在Database入库前,Cache进行Mis ...

  3. Major GC和Full GC的区别是什么?触发条件呢?

    作者:RednaxelaFX链接:http://www.zhihu.com/question/41922036/answer/93079526来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非 ...

  4. 反应器(Reactor)模式

    Java NIO非堵塞技术实际是采取反应器模式,或者说是观察者(observer)模式为我们监察I/O端口,如果有内容进来,会自动通知我们,这样,我们就不必开启多个线程死等,从外界看,实现了流畅的I/ ...

  5. no awt in java.libary.path

    缺少依赖包. linux下进入jdk安装路径/jre/lib/i386 使用ldd查看依赖包情况: ldd libawt.so 如果发现有not found的,就安装上,或者从jdk下查找,使用软连接 ...

  6. 【Xmail】使用Xmail搭建局域网邮件服务器

    下载地址:  http://www.xmailserver.org/xmail-1.27.win32bin.zip,当前最新版本  1.27. 解压文件:xmail-1.27.win32bin.zip ...

  7. UIKit 框架之UITableView二

    // // ViewController.m // UITableView // // Created by City--Online on 15/5/21. // Copyright (c) 201 ...

  8. Vue 让元素抖动/摆动起来

    首先展示一下效果,狠狠点击 https://zhangkunusergit.github.io/vue-component/dist/jitter.html 代码github : https://gi ...

  9. 什么是memcached?

    缓存是一种常驻与内存的内存数据库,内存的读取速度远远快于程序在磁盘读取数据的速度.我们在设计程序的时候常常会考虑使用缓存,将经常访问的数据放到内存上面这样可以提高访问数据的速度,同时可以降低磁盘或数据 ...

  10. SVN版本控制——SVN 合并的六种方式

    合并的工作是把主干或者分支上合并范围内的所有改动列出,并对比当前工作副本的内容,由合并者手工修改冲突,然后提交到服务器的相应目录里.如果当前工作副本是主干,则合并的范围是分支上的改动,如果工作副本是分 ...