android calls the national weather service weather prediction interface json for data format interpretation
- 2020-05-19 05:50:56
- OfStack
The national weather service provides three forms of data
Web site at:
http://www.weather.com.cn/data/sk/101010100.html
http://www.weather.com.cn/data/cityinfo/101010100.html
http://m.weather.com.cn/data/101010100.html
The last one is the most comprehensive.
Data parsing format:
The json data provided by the first website are:
{"weatherinfo":{"city":" Beijing ","cityid":"101010100","temp":"-2","WD":" The northwest ","WS":"3 level ","SD":"241%","WSE":"3","time":"10:61","isRadar":"1","Radar":"JC_RADAR_AZ9010_JB"}}
The json data provided by the second website are:
{"weatherinfo":{"city":" Beijing ","cityid":"101010100","temp1":"3 ℃ ","temp2":"-8 ℃ ","weather":" sunny ","img1":"d0.gif","img2":"n0.gif","ptime":"11:00"}}
The third website provides more comprehensive json data:
{
"weatherinfo":
{
"city":" Beijing ",
"city_en":"beijing",
"date_y":"2013 years 1 month 17 day ",
"date":"",
"week":" week 4",
"fchh":"11",
"cityid":"101010100",
"temp1":"3 ℃ ~-8 ℃ ",
"temp2":"3 ℃ ~-5 ℃ ",
"temp3":"3 ℃ ~-3 ℃ ",
"temp4":"1 ℃ ~-5 ℃ ",
"temp5":"3 ℃ ~-6 ℃ ",
"temp6":"2 ℃ ~-5 ℃ ",
"tempF1":"37.4 � ~17.6 � ",
"tempF2":"37.4 � ~23 � ",
"tempF3":"37.4 � ~26.6 � ",
"tempF4":"33.8 � ~23 � ",
"tempF5":"37.4 � ~21.2 � ",
"tempF6":"35.6 � ~23 � ",
"weather1":" sunny ",
"weather2":" sunny ",
"weather3":" It's cloudy turn ",
"weather4":" Cloudy to overcast ",
"weather5":" It's cloudy clears ",
"weather6":" Clear to overcast ",
"img1":"0",
"img2":"99",
"img3":"0",
"img4":"99",
"img5":"1",
"img6":"2",
"img7":"2",
"img8":"1",
"img9":"1",
"img10":"0",
"img11":"0",
"img12":"1",
"img_single":"0",
"img_title1":" sunny ",
"img_title2":" sunny ",
"img_title3":" sunny ",
"img_title4":" sunny ",
"img_title5":" It's cloudy ",
"img_title6":" Yin ",
"img_title7":" Yin ",
"img_title8":" It's cloudy ",
"img_title9":" It's cloudy ",
"img_title10":" sunny ",
"img_title11":" sunny ",
"img_title12":" It's cloudy ",
"img_title_single":" sunny ",
"wind1":" The breeze ",
"wind2":" The breeze ",
"wind3":" The breeze ",
"wind4":" The breeze ",
"wind5":" The breeze ",
"wind6":" The breeze ",
"fx1":" The breeze ",
"fx2":" The breeze ",
"fl1":" Less than 3 level ",
"fl2":" Less than 3 level ",
"fl3":" Less than 3 level ",
"fl4":" Less than 3 level ",
"fl5":" Less than 3 level ",
"fl6":" Less than 3 level ",
"index":" cold ",
"index_d":" Cold weather, suggest winter clothing such as cotton-padded jacket, leather jacket and wool sweater. The old and infirm should wear thick cotton-padded clothes or winter coats. ",
"index48":" cold ",
"index48_d":" Cold weather, suggest winter clothing such as cotton-padded jacket, leather jacket and wool sweater. The old and infirm should wear thick cotton-padded clothes or winter coats. ",
"index_uv":" weak ",
"index48_uv":" weak ",
"index_xc":" Suitable for ",
"index_tr":" More appropriate ",
"index_co":" Is not comfortable ",
"st1":"2",
"st2":"-6",
"st3":"2",
"st4":"-3",
"st5":"3",
"st6":"-4",
"index_cl":" Suitable for ",
"index_ls":" The basic right ",
"index_ag":" Highly prone "
}
}
The detailed parsing format is as follows:
Provided in json format, the format is as follows
{"weatherinfo":{
// The basic information ;
"city":" Beijing ","city_en":"beijing",
"date_y":"2013 years 1 month 17 day ","date":" XinMao years ","week":" week 3","fchh":"18","cityid":"101010100",
// Celsius
"temp1":"24 ℃ ~33 ℃ ","temp2":"24 ℃ ~32 ℃ ","temp3":"25 ℃ ~31 ℃ ","temp4":"23 ℃ ~30 ℃ ","temp5":"22 ℃ ~30 ℃ ","temp6":"21 ℃ ~32 ℃ ",
// Fahrenheit ;
"tempF1":"75.2 � ~91.4 � ","tempF2":"75.2 � ~89.6 � ","tempF3":"77 � ~87.8 � ","tempF4":"73.4 � ~86 � ","tempF5":"71.6 � ~86 � ","tempF6":"69.8 � ~89.6 � ",
// Describe the weather ;
"weather1":" It's cloudy ","weather2":" Clear to overcast ","weather3":" Yin ","weather4":" Turn sunny rain shower ","weather5":" A shower ","weather6":" It's cloudy ",
// Weather description picture number
"img1":"1","img2":"99","img3":"0","img4":"1","img5":"2","img6":"99","img7":"0","img8":"3","img9":"3","img10":"99","img11":"1","img12":"99",
"img_single":"1",
// Image name ;
"img_title1":" It's cloudy ","img_title2":" It's cloudy ","img_title3":" sunny ","img_title4":" It's cloudy ","img_title5":" Yin ","img_title6":" Yin ","img_title7":" sunny ","img_title8":" A shower ","img_title9":" A shower ","img_title10":" A shower ","img_title11":" It's cloudy ","img_title12":" It's cloudy ","img_title_single":" It's cloudy ",
// Wind speed to describe
"wind1":" The breeze ","wind2":" The breeze ","wind3":" The breeze ","wind4":" The breeze ","wind5":" The breeze ","wind6":" The breeze ",
//???
"fx1":" The breeze ","fx2":" The breeze ","fl1":" Less than 3 level ","fl2":" Less than 3 level ","fl3":" Less than 3 level ","fl4":" Less than 3 level ","fl5":" Less than 3 level ","fl6":" Less than 3 level ",
// Dress today index ;
"index":" hot ","index_d":" The weather is hot, the proposal is short unlined upper garment, short skirt, shorts, thin model T T-shirt, open collar short sleeve cotton shirt and other cool summer clothing. ",
//48 Hourly dressing index
"index48":" hot ","index48_d":" The weather is hot, the proposal is short unlined upper garment, short skirt, shorts, thin model T T-shirt, open collar short sleeve cotton shirt and other cool summer clothing. "
// Ultraviolet (uv) and 48 Hourly ultraviolet
,"index_uv":" medium ","index48_uv":" weak ",
// Wash the car
"index_xc":" Suitable for ",
// tourism
"index_tr":" More appropriate ",
// Comfort index
"index_co":" Is not comfortable ",
//
"st1":"33","st2":"24","st3":"32","st4":"25","st5":"32","st6":"24",
// Morning exercise
"index_cl":" Suitable for ",
// Air is basked in
"index_ls":" Suitable for ",
// allergy
"index_ag":" Extremely prone "}}
The fields are concise, city name, English name, date, lunar date, week, forecast time, city code, 6 Temperature forecast (Fahrenheit, Celsius), 6 Three weather forecasts and winds, and the rest 1 Some weather Numbers.