Lim Seunghyun Space

[Weather] One Call API 3.0 본문

Data

[Weather] One Call API 3.0

Lim Seung Hyun 2023. 2. 16. 09:16

One Call API 3.0

  • API를 통해 특정 위치에 대한 날씨 데이터를 획득하는 API

 

API Docs

 

One Call API 3.0 - OpenWeatherMap

Make just one API call and get all your essential weather data for a specific location with our new OpenWeather One Call API 3.0. Easy migration from the Dark Sky API. The One Call API provides the following weather data for any geographical coordinates: P

openweathermap.org

 

API Provider

  • openweathermap.org

 

API Plan

  • "One Call by Call" 구독을 해야 API 호출이 가능
  • 기본인 Base plan은 하루에 최대 2,000 회 호출이 가능하며 1000회 호출까지는 무료지만 그 이후에는 100회 호출당 0.12 GBP(약 185원) 부과되는 형태

 

제공하는 Data

  • Current weather
  • Minute forecast for 1 hour
  • Hourly forecast for 48 hours
  • Daily forecast for 8 days
  • National weather alerts
  • Historical weather data for 40+ years back

 

API Method

  • GET
  • URL: https://api.openweathermap.org/data/3.0/onecall
  • Query Param
    • lat: 위도
    • lon: 경도
    • appid: API Key
    • exclude: 제공하는 데이터에서 제외하고 싶은 값 (여러 개 입력 시 ","로 구분)
    • units: 측정 단위 (standard, metric, imperial 중 선택, 기본값은 standard)

 

API 결과

API 결과

  • 제외한 데이터가 없을시 current(현재), minutely(분별), hourly(시간별), daily(일별) 카테고리로 데이터를 제공
728x90