{"id":13814607,"url":"https://github.com/sofish/weather-api","last_synced_at":"2025-04-23T16:03:32.381Z","repository":{"id":4841746,"uuid":"5995948","full_name":"sofish/weather-api","owner":"sofish","description":"提供一个从 weather.com.cn 上根据城市接口取天气信息的方法","archived":false,"fork":false,"pushed_at":"2012-09-30T15:18:27.000Z","size":241,"stargazers_count":56,"open_issues_count":0,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-23T16:03:26.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"square/kochiku","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sofish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-28T10:51:27.000Z","updated_at":"2024-05-30T03:58:03.000Z","dependencies_parsed_at":"2022-09-16T04:54:36.717Z","dependency_job_id":null,"html_url":"https://github.com/sofish/weather-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Fweather-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Fweather-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Fweather-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Fweather-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sofish","download_url":"https://codeload.github.com/sofish/weather-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250468273,"owners_count":21435452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:02:21.687Z","updated_at":"2025-04-23T16:03:32.352Z","avatar_url":"https://github.com/sofish.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"weather-api\n===========\n\nLicensed under: [MIT](http://en.wikipedia.org/wiki/MIT_License)\n\n提供一个从 weather.com.cn 上根据城市接口取天气信息的方法。如果只是小网站引用，不考虑搞挂中国天气网的话，可以直接在[这里](http://service.weather.com.cn/plugin/index.shtml)选择一个官方提供的 iframe 页，如果是像 hao123 这样的大网站，你可能需要这些资源：\n\n```ruby\ni18n\t\t\t\t\t\t\t# 中国以外城市的代码\nindex.php\t\t\t\t\t\t# 演示页\nweather.php\t\t\t\t\t\t# iframe 缓存页\nweather_code.php\t\t\t\t# 中国城市代码（最主要代码）\n```\n\nAPI 接口 [http://m.weather.com.cn/data/城市代码.html](http://m.weather.com.cn/data/101010100.html)，请求结果是一个 JSON 对象：\n\n```js\n{\n    \"weatherinfo\": {\n        \"city\": \"北京\",\n        \"city_en\": \"beijing\",\n        \"date_y\": \"2012年9月30日\",\n        \"date\": \"\",\n        \"week\": \"星期日\",\n        \"fchh\": \"11\",\n        \"cityid\": \"101010100\",\n        \"temp1\": \"25℃~11℃\",\n        \"temp2\": \"26℃~14℃\",\n        \"temp3\": \"26℃~15℃\",\n        \"temp4\": \"25℃~12℃\",\n        \"temp5\": \"25℃~12℃\",\n        \"temp6\": \"24℃~13℃\",\n        \"tempF1\": \"77℉~51.8℉\",\n        \"tempF2\": \"78.8℉~57.2℉\",\n        \"tempF3\": \"78.8℉~59℉\",\n        \"tempF4\": \"77℉~53.6℉\",\n        \"tempF5\": \"77℉~53.6℉\",\n        \"tempF6\": \"75.2℉~55.4℉\",\n        \"weather1\": \"晴\",\n        \"weather2\": \"晴转多云\",\n        \"weather3\": \"多云转阴\",\n        \"weather4\": \"晴\",\n        \"weather5\": \"晴转阴\",\n        \"weather6\": \"阴转多云\",\n        \"img1\": \"0\",\n        \"img2\": \"99\",\n        \"img3\": \"0\",\n        \"img4\": \"1\",\n        \"img5\": \"1\",\n        \"img6\": \"2\",\n        \"img7\": \"0\",\n        \"img8\": \"99\",\n        \"img9\": \"0\",\n        \"img10\": \"2\",\n        \"img11\": \"2\",\n        \"img12\": \"1\",\n        \"img_single\": \"0\",\n        \"img_title1\": \"晴\",\n        \"img_title2\": \"晴\",\n        \"img_title3\": \"晴\",\n        \"img_title4\": \"多云\",\n        \"img_title5\": \"多云\",\n        \"img_title6\": \"阴\",\n        \"img_title7\": \"晴\",\n        \"img_title8\": \"晴\",\n        \"img_title9\": \"晴\",\n        \"img_title10\": \"阴\",\n        \"img_title11\": \"阴\",\n        \"img_title12\": \"多云\",\n        \"img_title_single\": \"晴\",\n        \"wind1\": \"微风\",\n        \"wind2\": \"微风\",\n        \"wind3\": \"微风转北风3-4级\",\n        \"wind4\": \"北风3-4级转微风\",\n        \"wind5\": \"微风\",\n        \"wind6\": \"微风\",\n        \"fx1\": \"微风\",\n        \"fx2\": \"微风\",\n        \"fl1\": \"小于3级\",\n        \"fl2\": \"小于3级\",\n        \"fl3\": \"小于3级转3-4级\",\n        \"fl4\": \"3-4级转小于3级\",\n        \"fl5\": \"小于3级\",\n        \"fl6\": \"小于3级\",\n        \"index\": \"暖\",\n        \"index_d\": \"较凉爽，建议着长袖衬裤等春秋过渡装。体弱者宜着长袖衬衫和马甲。但昼夜温差较大，请适当增减衣服。\",\n        \"index48\": \"暖\",\n        \"index48_d\": \"较凉爽，建议着长袖衬裤等春秋过渡装。体弱者宜着长袖衬衫和马甲。但昼夜温差较大，请适当增减衣服。\",\n        \"index_uv\": \"强\",\n        \"index48_uv\": \"强\",\n        \"index_xc\": \"适宜\",\n        \"index_tr\": \"适宜\",\n        \"index_co\": \"较舒适\",\n        \"st1\": \"24\",\n        \"st2\": \"11\",\n        \"st3\": \"25\",\n        \"st4\": \"15\",\n        \"st5\": \"26\",\n        \"st6\": \"12\",\n        \"index_cl\": \"适宜\",\n        \"index_ls\": \"适宜\",\n        \"index_ag\": \"极易发\"\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofish%2Fweather-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsofish%2Fweather-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofish%2Fweather-api/lists"}