Use bo api to create weather check software, boapi
Let's take a look at the effect.
Interface address: http://service.boapi.net/Weather/Weather.ashx? Appkey = The appkey & city = city name you applied
Interface Description view http://www.boapi.net/weather.htm
Key code of request service
JToken WheatherJson (string city) {WebClient wc = new WebClient (); string json = ""; try {wc. encoding = System. text. encoding. UTF8; json = wc. downloadString ("http://service.boapi.net/Weather/Weather.ashx? Appkey = Your appkey & city = "+ city); return (JToken) JsonConvert. DeserializeObject (json);} catch {}}
Returned results
{"C": "101010100", "cn": "China", "pn": "Beijing", "dn": "Beijing", "unch ": "beijing", "unen": "beijing", "date": "11:00:00", "fw": [{"dph": "Qing", "dp ": "d00.gif", "nph": "Multi-cloud", "np": "n01.gif", "dt": "27", "nt": "14", "dwd ": "Nanfeng", "nwd": "Nanfeng", "dwp": "3-4", "nwp": "3-4", "ss ": "|" },{ "dph": "Cloudy", "dp": "d01.gif", "nph": "clear", "np": "n00.gif ", "dt": "29", "nt": "11", "dwd": "North Wind", "nwd": "No sustained wind direction", "dwp ": "Grade 3-4", "nwp": "Breeze", "ss": "|" },{ "dph": "clear", "dp ": "d00.gif", "nph": "clear", "np": "n00.gif", "dt": "27", "nt": "14", "dwd ": "No sustained wind direction", "nwd": "No sustained wind direction", "dwp": "Breeze", "nwp": "Breeze", "ss ": "05:24 | 19:01"}]}
Response parameter description
C |
City code |
Fi |
Weather index |
Cn |
Country name |
Cin |
Chinese index name |
Pn |
Name of a province/Municipality/Autonomous Region |
Ic |
Exponential level |
Dn |
City name |
Ad |
Index suggestions |
Unch |
Chinese city name |
|
|
Unen |
English city name |
|
|
Date |
Weather update time |
|
|
Fw |
Future weather |
|
|
Dph |
Daytime weather |
|
|
Dp |
Daytime weather icon |
|
|
Nph |
Night weather |
|
|
Np |
Weather icon at night |
|
|
Dt |
Daytime temperature |
|
|
Nt |
Night Temperature |
|
|
Dwd |
Daytime wind direction |
|
|
Nwd |
Night wind direction |
|
|
Dwp |
Daytime wind |
|
|
Nwp |
Night wind |
|
|
Ss |
Sunrise and sunset time |
If you want to get more weather icons to http://www.boapi.net/TechBlog.aspx? Id = 1001 & blog = boapi download