Weather API 개요

Weather API를 사용하면 전 세계 위치의 실시간 세부 지역 날씨 데이터를 요청하여 실시간 날씨 대시보드, 날씨 업데이트 앱, 경로 날씨 오버레이, 날씨 기반 건강 또는 활동 추적기를 지원할 수 있습니다. 날씨 정보에는 현재 기온, 강수량, 상대 습도, 풍속, 자외선 지수 등이 포함됩니다.

지정된 위도 및 경도의 위치에 대해 API는 다음 표의 데이터에 대한 엔드포인트(https://weather.googleapis.com/v1/...)를 제공합니다.

REST 엔드포인트 한눈에 보기

API 엔드포인트 URL 설명 문서화된 매개변수
현재 상태 https://weather.googleapis.com/v1/currentConditions:lookup 실시간 기상 상황 location.latitude, location.longitude
시간별 예보 https://weather.googleapis.com/v1/forecast/hours:lookup 최대 240시간의 예측 조건 location.latitude, location.longitude
일일 예보 https://weather.googleapis.com/v1/forecast/days:lookup 최대 10일간의 예측 조건 location.latitude, location.longitude
시간별 기록 https://weather.googleapis.com/v1/history/hours:lookup 최대 24시간 동안 캐시된 과거 상태 location.latitude, location.longitude
악천후 알림 https://weather.googleapis.com/v1/publicAlerts:lookup 악천후 알림 key, location.latitude, location.longitude

일반적인 사용 사례

Weather API의 기능

Weather API 데이터에는 다음이 포함됩니다.

  • 날씨 조건 및 아이콘: weatherCondition의 현재 날씨 조건(예: '흐림' 또는 '눈발')을 나타내는 설명 및 해당 아이콘입니다.
  • 온도: 현재 온도(temperature), 최저 및 최고 온도(일일 예보의 minTemperature 및 maxTemperature 또는 currentConditionsHistory 내부), 체감 온도(feelsLikeTemperature)입니다.
  • 강수량: 총 강수량 및 강수 유형 (눈, 비, 얼음, 혼합)입니다.
  • 바람: 체감 온도(windChill), 풍향(wind.direction), 풍속(wind.speed), 돌풍(wind.gust)입니다.
  • 얼음 두께: 얼음의 두께입니다.
  • 습도: 이슬점(dewPoint), 열 지수(heatIndex), 습구 온도(wetBulbTemperature), 상대 습도(relativeHumidity)
  • 자외선 지수: 자외선(UV) 지수(uvIndex)입니다.
  • 뇌우 확률: 뇌우가 발생할 확률(%)입니다.
  • 가시거리: 물체가 선명하게 보이는 거리입니다.
  • 기압: 평균 해수면 기압입니다.
  • 일출/일몰 및 월출/월몰 이벤트: 일출, 일몰, 월출, 월몰 시간입니다.
  • 구름량: 구름이 하늘을 덮고 있는 비율입니다.

Weather API 사용 방법

1 설정하기 Google Cloud 프로젝트 설정부터 시작하여 다음 안내를 완료합니다.
2 현재 날씨 확인하기 현재 상태 가져오기를 참고하세요.
3 시간별 일기예보 확인하기 시간별 예측 가져오기를 참고하세요.
4 일일 일기예보 확인하기 일일 예측 가져오기를 참고하세요.
5 시간별 기록 가져오기 시간별 기록 가져오기를 참고하세요.
6 날씨 알림 받기 날씨 알림 받기를 참고하세요.

공기질 지수(AQI) 및 미세먼지 오염 물질(PM2.5, PM10)의 경우 Air Quality API(https://airquality.googleapis.com/v1/currentConditions:lookup)를 사용하세요. Weather API는 이러한 값을 반환하지 않습니다.

기타 관련 환경 API는 다음과 같습니다.

  • 꽃가루 수치: Pollen API(https://pollen.googleapis.com/v1/forecast:lookup)
  • 일사량 및 옥상 잠재 발전량: Solar API(https://solar.googleapis.com/v1/buildingInsights:findClosest)

다음 단계