Technology

Google Weather API

Learn about the Google Weather API, including supported cities, attribute descriptions, and how to retrieve weather data in XML format using EUC-KR encoding.

Sangrak

http://www.google.co.kr/ig/api?weather=city_name

The above is the address of the Google Weather API. As expected from Google, it supports many more cities than typical portal sites. The encoding it receives is not UTF-8 but EUC-KR (CP949) in XML format.

Supported Cities

The supported cities are as follows. There may be more.

$googleWeatherCity['kor'] = array("강릉", "경주", "고양", "광명", "광주", "구미", "군산", "군포", "김해", "대구", "대전", "동해", "목포", "부산", "부천", "서귀포", "서울", "성남", "송탄", "수원", "시흥", "안산", "안양", "용인", "울릉도", "울산", "원주", "의정부", "익산", "인천", "일산", "전주", "제주", "진주", "철원", "청주", "춘천", "파주", "평택", "포항", "흑산도", "충주", "상주", "창원", "천안", "여수", "안동", "양산", "태안", "진해", "오산", "순천", "당진", "마산", "삼척", "거제");
$googleWeatherCity['eng'] = array("gangneung", "gyeongju", "goyang", "gwangmyeong", "gwangju", "gumi", "gunsan", "gunpo", "gimhae", "daegu", "daejeon", "donghae", "mokpo", "busan", "bucheon", "seogwipo", "seoul", "seongnam", "songtan", "suwon", "siheung", "ansan", "anyang", "yongin", "ulleung-do", "ulsan", "wonju", "uijeongbu", "iksan", "incheon", "ilsan", "jeonju", "jeju", "jinju", "cheorwon", "cheongju", "chuncheon", "paju", "pyeongtaek", "pohang", "heuksan-do", "chungju", "sangju", "changwon", "cheonan", "yeosu", "andong", "yangsan", "taean", "jinhae", "osan", "suncheon", "dangjin", "masan", "samchok", "kuje");

Attribute Description

[xml_api_reply][weather][problem_cause] An error occurred. The error content is displayed in the data attr of problem_cause.

[xml_api_reply][weather][forecast_information][postal_code] This is the city name. The requested city name is displayed. To get a more detailed city name, read the city.

[xml_api_reply][weather][forecast_information][current_date_time] This is the most recently updated date. It is based on GMT+0.

[xml_api_reply][weather][current_conditions][condition] This is the current weather condition. Clear, rain, etc. are displayed in Korean.

[xml_api_reply][weather][current_conditions][temp_c] This displays the current temperature in ℃.

[xml_api_reply][weather][current_conditions][humidity] This displays the current humidity. It is displayed in the format Humidity: 10%.

[xml_api_reply][weather][current_conditions][wind_condition] This displays the current wind. It is displayed in the format Wind: Storm, 8 km/h.

[$i days later weather information] (up to 4 days, including today) [xml_api_reply][weather][forecast_conditions][$i][day_of_week] This displays the day of the week.

[xml_api_reply][weather][forecast_conditions][$i][low] This displays the minimum temperature.

[xml_api_reply][weather][forecast_conditions][$i][high] This displays the maximum temperature.

[xml_api_reply][weather][forecast_conditions][$i][condition] This displays the weather condition in Korean.

More on this topic