全国天气预报信息数据接口API,精确到行政区的7日天气预报日4次数据更新/小时级天气预报。
产品功能
全国天气预报每隔6小时更新数据;精确到行政区级别的天气预报数据;提供最长7天的天气预报数据;提供每日小时级别的天气预报数据;提供本地日出日落、当日历史温度等附加数据;提供紫外线、穿衣、洗车、空气污染等额外指导数据;全接口支持HTTPS;全面兼容AppleATS;全国多节点CDN部署;接口极速响应,多台服务器构建API接口负载均衡。
API文档
接口地址:https://apgugudatcom/weather/weatherinfo返回格式:application/json;charset=utf-8请求方式:GET请求协议:HTTPS请求示例:https://apgugudatcom/weather/weatherinfo?appkey=YOUR_APPKEY&code=YOUR_VALUE&days=1接口测试:https://apgugudatcom/weather/weatherinfo/demo
前置接口
前置接口说明:查询地区编码,根据市或区的关键字进行查询,如北京、苏州、海淀、吴中等前置接口地址:https://apgugudatcom/weather/weatherinfo/region?appkey=APPKEY&keyword=查询编码的市或区关键字,如北京、海淀前置接口参数说明:appkey=YOUR_APPKEY&keyword=查询编码的市或区关键字,如北京、海淀前置接口返回格式:application/json;charset=utf-8前置接口返回说明:包含地区编码以及省、市、区相关信息前置接口请求方式:GET前置接口请求协议:HTTPS
请求参数
参数名参数类型是否必须默认值备注appkeystring是YOUR_APPKEY付费后获取的APPKEYcodestring是YOUR_VALUE获取天气预报信息的地区编码,可通过前置接口查询获得daysint否1获取天气预报的天数,默认为即为当天数据。最大值为
返回参数
参数名参数类型备注DataStatus.StatusCodeint接口返回状态码DataStatus.StatusDescriptionstring接口返回状态说明DataStatus.ResponseDateTimestring接口数据返回时间DataStatus.DataTotalCountint此条件下的总数据量DatCodestring地区编码DatWeatherDatestring天气预报的日期DatWeatherRegionobject当前天气预报的详细地区信息,数据格式与查询地区编码接口返回数据格式一致。DatWeatherRegioReginTypestring位置信息类型,2为市级别数据,3为区级别数据DatWeatherRegioCodestring地区完整编码DatWeatherRegioProvinceCodestring省编码DatWeatherRegioProvinceNamestring省名称DatWeatherRegioCityCodestring市编码DatWeatherRegioCityNamestring市名称DatWeatherRegioRegionCodestring区编码DatWeatherRegioRegionNamestring区名称DatWeatherRegioTownCodestring镇编码DatWeatherRegioTownNamestring镇名称DatWeatherInfostring天气情况DatTemperatureHighint最高温度DatTemperatureLowint最低温度DatTodayHistoryHighestTemperatureint当日历史最高温度DatTodayHistoryLowestTemperatureint当日历史最低温度DatWeatherWindCondition1string风向1DatWeatherWindCondition2string风向2DatWeatherWindLevelstring风级DatSunRiseTimestring日出时间DatSunSetTimestring日落时间DatWeatherPerHourarray当日小时级别的天气预报数据数组DatWeatherPerHour.WeatherTimestring预报的小时时间,24小时制DatWeatherPerHour.WeatherInfostring天气情况DatWeatherPerHour.Temperaturestring温度DatWeatherPerHour.WeatherWindConditionstring风向DatWeatherPerHour.WeatherWindLevelstring风级DatLifeHelperUVobjectUV指数DatLifeHelperWearobject穿衣指数DatLifeHelperWashCarobject洗车指数DatLifeHelperAirobject空气指数DatLifeHelper.HelperNamestring指数名称DatLifeHelper.HelperStatusstring指数状态DatLifeHelper.HelperValuestring指数值。总分:紫外线5分,穿衣7分,洗车4分,空气5分DatLifeHelper.HelperContentstring指数内容DatWeatherDataGenerateDateTimestring天气预报内容数据生成时间
接口错误码
错误码错误内容备注100正常返回101参数错误102请求频率受限每分钟请求不能超过100次103账号欠费104APPKEY错误请检查传递的APPKEY是否为开发者中心获取到的值110接口响应错误
文章为作者独立观点,不代表股票交易接口观点