天气网的api返回不了城市列表
www.weather.com.cn/data/list3/city.xml。
在学习安卓第一行代码,开发酷欧天气用到的,有没有类似的api吗?
迷茫2017-04-17 14:20:19
https://www.juhe.cn/docs/api/id/39
This is based on aggregated data. There are many such API platforms now, and they should all be available. I will give this example. You can find others by yourself, such as good services, APIstore, etc.
National weather forecast API:
1. Query weather based on city name/id
2. List of weather types and identifiers
3. Based on IP Check the weather
4. Check the weather based on GPS coordinates
5. Three-hour city weather forecast
6.Supported city list
JSON return example:
{
"resultcode":"200",
"reason":"successed",
"result":[
{
"id":"1", /*城市ID*/
"province":"北京",/*省份名称*/
"city":"北京", /*城市*/
"district":"北京" /*城市/区名称*/
},
{
"id":"2",
"province":"北京",
"city":"北京",
"district":"海淀"
},
{
"id":"3",
"province":"北京",
"city":"北京",
"district":"朝阳"
},
{
"id":"4",
"province":"北京",
"city":"北京",
"district":"顺义"
},
{
"id":"5",
"province":"北京",
"city":"北京",
"district":"怀柔"
},
{
"id":"6",
"province":"北京",
"city":"北京",
"district":"通州"
},
{
"id":"7",
"province":"北京",
"city":"北京",
"district":"昌平"
},
{
"id":"8",
"province":"北京",
"city":"北京",
"district":"延庆"
},
{
"id":"9",
"province":"北京",
"city":"北京",
"district":"丰台"
},
{
"id":"10",
"province":"北京",
"city":"北京",
"district":"石景山"
},
{
"id":"11",
"province":"北京",
"city":"北京",
"district":"大兴"
},
{
"id":"12",
"province":"北京",
"city":"北京",
"district":"房山"
},
{
"id":"13",
"province":"北京",
"city":"北京",
"district":"密云"
},
{
"id":"14",
"province":"北京",
"city":"北京",
"district":"门头沟"
},
{
"id":"15",
"province":"北京",
"city":"北京",
"district":"平谷"
},
{
"id":"16",
"province":"上海",
"city":"上海",
"district":"上海"
},
{
"id":"17",
"province":"上海",
"city":"上海",
"district":"闵行"
},
{
"id":"18",
"province":"上海",
"city":"上海",
"district":"宝山"
},
{
"id":"19",
"province":"上海",
"city":"上海",
"district":"嘉定"
},
{
"id":"20",
"province":"上海",
"city":"上海",
"district":"南汇"
},
{
"id":"21",
"province":"上海",
"city":"上海",
"district":"金山"
},
{
"id":"22",
"province":"上海",
"city":"上海",
"district":"青浦"
},
{
"id":"23",
"province":"上海",
"city":"上海",
"district":"松江"
},
{
"id":"24",
"province":"上海",
"city":"上海",
"district":"奉贤"
},
{
"id":"25",
"province":"上海",
"city":"上海",
"district":"崇明"
},
{
"id":"26",
"province":"上海",
"city":"上海",
"district":"徐家汇"
},
{
"id":"27",
"province":"上海",
"city":"上海",
"district":"浦东"
}
],
"error_code":0
}
怪我咯2017-04-17 14:20:19
Find an API divided by data type: http://www.thinkpage.cn/ There are a wide range of weather data types, but there is a fee