1、省份列表:

http://weather.com.cn/data/city3jdata/china.html

2、根据省 ID  获取市(地区)列表:

http://weather.com.cn/data/city3jdata/provshi/.html

http://weather.com.cn/data/listinfo/city.xml

1id = 省份ID (101 + 两位数字01~34)
2sid = 省份ID 后两位

如: http://weather.com.cn/data/city3jdata/provshi/10111.html

 1{
 2  "01": "西安",
 3  "02": "咸阳",
 4  "03": "延安",
 5  "04": "榆林",
 6  "05": "渭南",
 7  "06": "商洛",
 8  "07": "安康",
 9  "08": "汉中",
10  "09": "宝鸡",
11  "10": "铜川",
12  "11": "杨凌"
13}

如: http://weather.com.cn/data/listinfo/city11.xml

11101|西安,1102|咸阳,1103|延安,1104|榆林,1105|渭南,1106|商洛,1107|安康,1108|汉中,1109|宝鸡,1110|铜川,1111|杨凌

3、根据市(地区)ID  获取县列表:

http://weather.com.cn/data/city3jdata/station/<id>.html

http://weather.com.cn/data/listinfo/city<sid>.xml

1id = 省份ID + 市(地区)ID
2sid = 省份ID 后两位 + 市(地区)ID 

如:http://weather.com.cn/data/city3jdata/station/1011101.html

1{
2  "01": "西安",
3  "02": "长安",
4  "03": "临潼",
5  "04": "蓝田",
6  "05": "周至",
7  "06": "户县",
8  "07": "高陵"
9}

如: http://weather.com.cn/data/listinfo/city1101.xml

1110101|西安,110102|长安,110103|临潼,110104|蓝田,110105|周至,110106|户县,110107|高陵

4、根据 ID,获取天气详情:

详情: http://m.weather.com.cn/data/<id>.html

概要: http://weather.com.cn/data/cityinfo/<id>.html

1ID =  省份 ID +  市(地区)ID +   县 ID

如:http://m.weather.com.cn/data/101110101.html

http://weather.com.cn/data/cityinfo/101110101.html

国外貌似都是以 40 开头的 ID,如   纽约:401110101

http://m.weather.com.cn/data/401110101.html

http://weather.com.cn/data/cityinfo/401110101.html

5、根据城市名、全拼、简拼、电话区号、邮编查询、英文(国外)获取城市对应 ID:

http://t.weather.com.cn/SearchBox/searchBox?callback=&_=&language=&keyword=

包含 4 个参数,callback_languagekeyword

1calkback:若为空,则返回 json 格式,否则返回 callback 的 jsonp;
2_:       时间戳,精确到毫秒,js 可以直接输出这个值;
3language:语言,可选  zh|en ,默认  zh;
4keyword: 关键词,可输入城市名、全拼、简拼、电话区号、邮编查询。如  ny  返回:
 1{
 2  "f": [{ "n": "纽约", "m": "NY", "d": "美国", "i": "401110101", "t": "f" }],
 3  "i": [
 4    { "n": "南阳", "m": "NY", "d": "河南", "i": "101180701", "t": "i" },
 5    { "n": "南岳", "m": "NY", "d": "湖南", "i": "101250409", "t": "i" },
 6    { "n": "纳雍", "m": "NY", "d": "贵州", "i": "101260706", "t": "i" },
 7    { "n": "宁阳", "m": "NY", "d": "山东", "i": "101120806", "t": "i" },
 8    { "n": "宁远", "m": "NY", "d": "湖南", "i": "101251406", "t": "i" }
 9  ]
10}

6、通过 IP 获取城市 id:

http://61.4.185.32/g/

返回:

1var ip = "113.140.7.122";
2var id = 101110101;
3if (typeof id_callback != "undefined") {
4  id_callback();
5}

7、xml 天气

http://flash.weather.com.cn/wmaps/xml/china.xml

各省份列表及天气。

http://flash.weather.com.cn/wmaps/xml/.xml

市级天气信息。

转载请保留出处,thanks