2024最新可用免费天气预报API接口

天气API接口数据, 数据字段最全,免费,稳定的实况天气预报接口

5分钟左右更新一次,支持全国3000多个市区县, 包含基本天气信息、24小时逐小时天气、气象预警列表、湿度、能见度、气压、降雨量、紫外线、风力风向风速、日出日落、空气质量、pm2.5、pm10、o3、no2、so2、是否需要带口罩、外出适宜、开窗适宜、是否需要打开净化器等等,可按地名、城市编号、IP查询、经纬度查询。

看上面的说明, 返回数据够多的吧, 该接口有每日免费次数, 付费最高可每日请求50万次

注意:本文档对接的是天气API的实况天气数据, 如需7日或更多请查看官网文档
接口特点
  1. 5分钟左右更新一次
  2. 支持全国所有市区县(3200个左右吧)
  3. 含24小时天气
  4. 含气象灾害预警
  5. 空气六因子
  6. 支持经纬度查询
  7. 多线路
对接流程
  1. 打开并注册天气API平台 (http://tianqiapi.com/) 进入用户中心,获取appid和appsecret
  2. 阅读实况天气开发文档
    http://tianqiapi.com/index/doc?version=2030
  3. 请求接口
  4. 解析JSON

Tips:大家在请求这类三方http接口的时候, 请一定将接口地址设置在服务端, 为动态可修改的, 请勿在C端直连接口, 防止遇到网络问题导致程序异常。

请求接口 (appid和appsecret换成自己的)
https://v1.yiketianqi.com/free/v2030?appid=85841439&appsecret=EKCDLT4I&adcode=130200000000&aqi=
请求参数
参数名必选类型说明备注(示例)
appidstring用户appid先注册开发账号
appsecretstring用户appsecret
adcodestring国家统计局城市ID如:130200000000 请参考 全国统计用区划代码表
cityidstring城市ID请参考 城市ID列表
citystring城市名称不要带市和区; 如: 青岛、铁西
provincestring所在省如果您担心city重名可传此参数, 不要带省和市; 如: 山东、上海
ipstringIP地址查询IP所在城市天气
lngString经度如: 119.545023 (需额外开通lbs权限)
latString纬度如: 36.044254
pointString坐标体系默认百度坐标, 如使用高德坐标, 请传参: gaode
callbackstringjsonp参数如: jQuery.Callbacks
vuestring跨域参数如果您使用的是react、vue、angular请填写值: 1
hoursInt是否显示小时天气默认隐藏, 如需显示, 请传参: 1
aqiInt是否显示AQI六因子默认隐藏, 如需显示, 请传参: 1
返回JSON内容
{"cityid":  "101160602","date":  "2024-02-25","week":  "星期日","update_time":  "22:55","city":  "永昌","cityEn":  "yongchang","country":  "中国","countryEn":  "China","wea":  "阴","wea_img":  "yin","tem":  "-7.5","tem1":  "-2","tem2":  "-14","win":  "东南风","win_speed":  "2级","win_meter":  "6km\/h","humidity":  "94%",//湿度"visibility":  "17km",//能见度"pressure":  "792",//气压"air":  "124",//空气质量"air_pm25":  "124","air_level":  "轻度污染","air_tips":  "各类人群可多参加户外活动,多呼吸一下清新的空气。","alarm":  [{"alarm_type":  "道路结冰","alarm_level":  "黄色","alarm_title":  "甘肃省永昌县发布道路结冰黄色预警","alarm_content":  "永昌县气象台2024年02月25日21时14分发布道路结冰黄色预警信号:受降雪和低温天气影响,预计未来24小时,我县大部乡镇将出现对交通有影响的道路结冰,请注意防范。(预警信息来源:国家预警信息发布中心)"},{"alarm_type":  "道路结冰","alarm_level":  "黄色","alarm_title":  "甘肃省金昌市发布道路结冰黄色预警","alarm_content":  "金昌市气象台2024年02月25日17时02分发布道路结冰黄色预警信号:受降雪和低温天气影响,预计未来24小时,我市部分路段将出现道路结冰,影响交通安全,请注意防范。(预警信息来源:国家预警信息发布中心)"}],"rain_pcpn":  "0",//降雨量mm"uvIndex":  "0",//紫外线0-11"uvDescription":  "低","wea_day":  "阴",//白天天气"wea_day_img":  "yin","wea_night":  "多云",//夜间天气"wea_night_img":  "yun","sunrise":  "07:50",//日出"sunset":  "19:00",//日落"hours":  [{"hours":  "22:00","wea":  "轻度雾霾","wea_img":  "wu","tem":  "-6","win":  "东北风","win_speed":  "1级","vis":  "14.9",//能见度"aqinum":  "114",//aqi"aqi":  "轻度污染"},{"hours":  "23:00","wea":  "多云","wea_img":  "yun","tem":  "-6","win":  "东南风","win_speed":  "1级","vis":  "78.06","aqinum":  "52","aqi":  "良"},{"hours":  "00:00","wea":  "多云","wea_img":  "yun","tem":  "-7","win":  "东南风","win_speed":  "无风","vis":  "80.35","aqinum":  "50","aqi":  "优"},{"hours":  "01:00","wea":  "阴","wea_img":  "yin","tem":  "-7","win":  "西南风","win_speed":  "无风","vis":  "82.84","aqinum":  "48","aqi":  "优"},{"hours":  "02:00","wea":  "阴","wea_img":  "yin","tem":  "-7","win":  "西南风","win_speed":  "无风","vis":  "95.67","aqinum":  "47","aqi":  "优"},{"hours":  "03:00","wea":  "多云","wea_img":  "yun","tem":  "-7","win":  "东风","win_speed":  "1级","vis":  "88.93","aqinum":  "45","aqi":  "优"},{"hours":  "04:00","wea":  "多云","wea_img":  "yun","tem":  "-8","win":  "东北风","win_speed":  "1级","vis":  "86.09","aqinum":  "44","aqi":  "优"},{"hours":  "05:00","wea":  "多云","wea_img":  "yun","tem":  "-8","win":  "风","win_speed":  "1级","vis":  "82.28","aqinum":  "42","aqi":  "优"},{"hours":  "06:00","wea":  "多云","wea_img":  "yun","tem":  "-8","win":  "西北风","win_speed":  "1级","vis":  "85.25","aqinum":  "41","aqi":  "优"},{"hours":  "07:00","wea":  "晴","wea_img":  "qing","tem":  "-8","win":  "西北风","win_speed":  "2级","vis":  "94.49","aqinum":  "40","aqi":  "优"},{"hours":  "08:00","wea":  "晴","wea_img":  "qing","tem":  "-8","win":  "西北风","win_speed":  "2级","vis":  "103.71","aqinum":  "40","aqi":  "优"},{"hours":  "09:00","wea":  "晴","wea_img":  "qing","tem":  "-8","win":  "西北风","win_speed":  "2级","vis":  "177.04","aqinum":  "38","aqi":  "优"},{"hours":  "10:00","wea":  "晴","wea_img":  "qing","tem":  "-7","win":  "西北风","win_speed":  "2级","vis":  "231.08","aqinum":  "37","aqi":  "优"},{"hours":  "11:00","wea":  "晴","wea_img":  "qing","tem":  "-6","win":  "西北风","win_speed":  "2级","vis":  "231.08","aqinum":  "35","aqi":  "优"},{"hours":  "12:00","wea":  "晴","wea_img":  "qing","tem":  "-5","win":  "西北风","win_speed":  "2级","vis":  "231.08","aqinum":  "32","aqi":  "优"},{"hours":  "13:00","wea":  "多云","wea_img":  "yun","tem":  "-4","win":  "西北风","win_speed":  "1级","vis":  "231.08","aqinum":  "31","aqi":  "优"},{"hours":  "14:00","wea":  "多云","wea_img":  "yun","tem":  "-3","win":  "西北风","win_speed":  "1级","vis":  "231.08","aqinum":  "30","aqi":  "优"},{"hours":  "15:00","wea":  "多云","wea_img":  "yun","tem":  "-2","win":  "东北风","win_speed":  "2级","vis":  "231.08","aqinum":  "33","aqi":  "优"},{"hours":  "16:00","wea":  "多云","wea_img":  "yun","tem":  "-1","win":  "东北风","win_speed":  "3级","vis":  "231.08","aqinum":  "27","aqi":  "优"},{"hours":  "17:00","wea":  "多云","wea_img":  "yun","tem":  "-2","win":  "东风","win_speed":  "3级","vis":  "231.08","aqinum":  "25","aqi":  "优"},{"hours":  "18:00","wea":  "多云","wea_img":  "yun","tem":  "-3","win":  "东南风","win_speed":  "3级","vis":  "231.08","aqinum":  "24","aqi":  "优"},{"hours":  "19:00","wea":  "多云","wea_img":  "yun","tem":  "-5","win":  "东风","win_speed":  "3级","vis":  "231.08","aqinum":  "22","aqi":  "优"},{"hours":  "20:00","wea":  "多云","wea_img":  "yun","tem":  "-6","win":  "东风","win_speed":  "2级","vis":  "128.67","aqinum":  "21","aqi":  "优"},{"hours":  "21:00","wea":  "晴","wea_img":  "qing","tem":  "-6","win":  "东北风","win_speed":  "2级","vis":  "120.35","aqinum":  "21","aqi":  "优"},{"hours":  "22:00","wea":  "晴","wea_img":  "qing","tem":  "-6","win":  "东北风","win_speed":  "2级","vis":  "117.9","aqinum":  "21","aqi":  "优"},{"hours":  "23:00","wea":  "晴","wea_img":  "qing","tem":  "-7","win":  "东风","win_speed":  "1级","vis":  "97.76","aqinum":  "21","aqi":  "优"},{"hours":  "00:00","wea":  "晴","wea_img":  "qing","tem":  "-7","win":  "东北风","win_speed":  "1级","vis":  "90.18","aqinum":  "21","aqi":  "优"},{"hours":  "01:00","wea":  "晴","wea_img":  "qing","tem":  "-7","win":  "风","win_speed":  "1级","vis":  "83.73","aqinum":  "21","aqi":  "优"}],"aqi":  {"update_time":  "22:30","air":  "114","air_level":  "轻度污染","air_tips":  "各类人群可多参加户外活动,多呼吸一下清新的空气。","pm25":  "86","pm25_desc":  "轻度污染","pm10":  "172","pm10_desc":  "中度污染","o3":  "80","o3_desc":  "","no2":  "20","no2_desc":  "","so2":  "6","so2_desc":  "","co":  "0.9","co_desc":  "","kouzhao":  "不用佩戴口罩","yundong":  "适宜运动","waichu":  "不适宜外出","kaichuang":  "适宜开窗","jinghuaqi":  "不需要打开"},"nums":  19
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/704003.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

细粒度目标检测问题剖析

问题剖析 相对于一般目标检测任务,细粒度目标更容易出现类内差异大、类间差异小等现象。 所谓细粒度目标识别,是指在目标检测的基础上,识别出目标的具体型号与类别,例如不只识别出飞机目标,还能识别出飞机型号。粗粒…

洛谷P1106题解

题目描述 键盘输入一个高精度的正整数 N(不超过 250 位),去掉其中任意 k 个数字后剩下的数字按原左右次序将组成一个新的非负整数。编程对给定的 N 和 k,寻找一种方案使得剩下的数字组成的新数最小。 输入格式 输入两行正整数。…

Google炸场,推出开“放”可商用的大语言模型Gemma!超级轻量,个人电脑即可运行

与OpenAI的封闭式大型模型不同,谷歌、Meta等科技巨头正致力于开发开源模型,以期实现技术上的快速追赶。 介绍 2月21日,谷歌发布了其最新一代的开源AI模型——Gemma(https://ai.google.dev/gemma),这是一个…

2024.2.29 模拟实现 RabbitMQ —— 项目展示

目录 项目介绍 核心功能 核心技术 演示直接交换机 演示扇出交换机 演示主题交换机 项目介绍 此处我们模拟 RabbitMQ 实现了一个消息队列服务器 核心功能 提供了 虚拟主机、交换机、队列、绑定、消息 概念的管理九大核心 API 创建队列、销毁队列、创建交换机、销毁交换机、…

【LeetCode】升级打怪之路 Day 06:哈希表的应用

今日题目: 349. 两个数组的交集 | LeetCode202. 快乐数 | LeetCode1. 两数之和 | LeetCode205. 同构字符串 | LeetCode599. 两个列表的最小索引总和 | LeetCode 目录 应用 1 -- 哈希集合LeetCode 349. 两个数组的交集 【easy】LeetCode 202. 快乐数 【小技巧】 应用…

基于JSP的毕业设计选题系统的设计与实现

基于JSP的毕业设计选题系统的设计与实现 (源代码论文) A. 项目简介 毕业设计选题系统就是能够使学生通过互联网完成毕业设计课题的选定,它采用Web方式,同时适用于局域网和Internet,它要实现审核,权限管理,邮件通知…

Python中的atexit模块:优雅地处理程序退出

前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到网站AI学习网站。 目录 前言 atexit模块概述 atexit模块的基本用法 示例代码:文件操作时的应用场景 典型应用场景 1 资源释放…

【Java】Deque接口与List接口中的remove方法

Deque接口与List接口中的remove方法的区别 太长不看系列: Deque的remove(Object o)。指定的是元素,List的remove(int index),指定的是索引。 在刷力扣113.路径总和 II 时使用Deque的remove方法出现错误,记录一下原因和理清相关概念…

云里物里轻薄系列电子价签,如何革新零售?

云里物里的DS轻薄系列电子价签,凭借轻巧外观和强劲性能,为零售行业提供了更便捷的商品改价方案。这不仅是对纸质价标的替代,更以其安全性和可持续发展性,实现对零售行业的效率升级,让商家们轻松迎接数字化时代的挑战&a…

【Vue3】学习watch监视:深入了解Vue3响应式系统的核心功能(下)

💗💗💗欢迎来到我的博客,你将找到有关如何使用技术解决问题的文章,也会找到某个技术的学习路线。无论你是何种职业,我都希望我的博客对你有所帮助。最后不要忘记订阅我的博客以获取最新文章,也欢…

OD(9)之Mermaid序列图(Sequence diagrams)使用详解

OD(8)之Mermaid序列图(Sequence diagrams)使用详解 Author: Once Day Date: 2024年2月21日 漫漫长路才刚刚开始… 全系列文章可参考专栏: Mermiad使用指南_Once_day的博客-CSDN博客 参考文章: 关于 Mermaid | Mermaid 中文网 (nodejs.cn)Mermaid | Diagramming and charti…

C++实现Date类

Date.h #pragma once#include <iostream> using std::cout; using std::endl;class Date { private:int _year 1;int _month 1;int _day 1;public://日期类无需显式定义拷贝构造函数、析构函数、赋值运算符重载//打印void Print();//有参构造函数Date(int year 1, i…

4.4 MySQL存储

目录 1、使用前提 2、使用连接数据库最初步骤 2.1 最初步骤 2.2 connect()方法中参数简单传递 3、创建数据库(创建架构)和创建表 3.1 创建数据库(创建架构) 3.2 创建表 3.2.1 基本创建 3.2.2 创建自增主键 4、Pycharm 可视化连接 MySQL 图形界面 5、插入、更新、查询…

【蓝桥杯】青蛙跳杯子(BFS)

一.题目描述 二.输入描述 输入为 2 行&#xff0c;2 个串&#xff0c;表示初始局面和目标局面。我们约定&#xff0c;输入的串的长度不超过 15。 三.输出描述 输出要求为一个整数&#xff0c;表示至少需要多少步的青蛙跳。 四.问题分析 注意&#xff1a;空杯子只有一个 …

3种SQL语句优化方法,测试人必知必会!

关于SQL语句的优化&#xff0c;本质上就是尽量降低SQL语句的执行时间&#xff0c;对于如何降低SQL语句的执行时间&#xff0c;可以从以下几个方面入手。 一、降低SQL语句执行时的资源消耗 这是我们在数据库性能调优中常用的方法&#xff0c;该方法以分析SQL语句的执行计划为切…

Qt程序设计-报警灯自定义控件实例

本文讲解Qt报警灯自定义控件实例。 实现功能 设置边框和内部颜色。 设置是否闪烁点亮。 添加的报警灯类 #ifndef LIGHT_H #define LIGHT_H#include <QWidget> #include <QDebug> #include <QPainter> #include <QTimer>class Light : public QWid…

Python实用技巧:处理JSON文件写入换行问题

Python实用技巧&#xff1a;处理JSON文件写入换行问题 &#x1f308; 个人主页&#xff1a;高斯小哥 &#x1f525; 高质量专栏&#xff1a;Matplotlib之旅&#xff1a;零基础精通数据可视化、Python基础【高质量合集】、PyTorch零基础入门教程 &#x1f448; 希望得到您的订阅…

linux中将普通用户添加sudo权限

1.登录root权限账号&#xff0c;编辑/etc/sudoers文件 2.找到"root ALL(ALL) ALL"&#xff0c;并在下面添加普通用户 格式&#xff1a;username ALL(ALL) ALL vim /etc/sudoers ## Next comes the main part: which users can run what software …

理解大数据处理过程中的小文件问题

相信很多开发都知道这个问题&#xff0c;看文章&#xff0c;看博客都有了解过。但是如果让你自己讲&#xff0c;能不能从头到尾讲明白原理和对应的解决方案呢&#xff1f; 这个小文件是怎么产生的&#xff1f;就一句话&#xff0c;spark处理完数据输出时&#xff0c;一个分区一…

CMake和VsCode调试的使用

目录 CMake使用 CMake下载 创建系统文件目录 MakeList编写规范 VsCode启动调试 添加配置文件 添加断点&#xff0c;启动调试 CMake使用 CMake下载 输入指令 sudo apt install cmake 安装cmake&#xff0c;使用 cmake -version可查看cmake的版本信息 创建系统文件目…