KMA(Korea Meteorological Administration) Open API Helper - Simple KMA Open API Client
Summary
This is designed to help request KMA's open API such as forecast, middle forecast.
It just need KMA's open API service key, forecast date, area code which is download KMA's web site.
Forecast Request
This is forecast weather per 3 hours by 3 days.
const KmaHelper = require('./index.js');
const options = {
"date": "YYYYMMDD",
"time": "0500",
"nx" : "59",
"ny" : "126"
};
const serviceKey = '[Input Forecast KMA Open API Key]';
KmaHelper.requestWeatherRequest(serviceKey, 0, options, (code, result)=>{
console.log(result);
}, (err,code, msg) => {
console.log(err);
} );
Middle Forecast
This is forecast middle weather land information, forecast report and middle temperature information.
const KmaHelper = require('./index.js');
const options = {
"landRegId": "11B00000",
"tempRegId": "11B20101",
"stnId" : "109",
"time" : "YYYYMMDD0600"
};
const serviceKey = '[Input Middle Forecast KMA Open API Key]';
KmaHelper.requestWeatherRequest(serviceKey, 1, options, (code, result) =>{
console.log(code, result);
}, (err,code, msg) => {
console.log(err);
} );