const axios = require('axios')
const url = 'https://api.aoikujira.com/tenki/week.php?fmt=json'
axios.get(url).then(res => {
console.log(res.data.鹿児島)
});
以下のように出力される。
[
{
date: '30日(水)',
forecast: '晴後曇',
mintemp: '-',
maxtemp: '-',
pop: '-'
},
{
date: '01日(木)',
forecast: '曇時々雨',
mintemp: '24',
maxtemp: '28',
pop: '70'
},
{
date: '02日(金)',
forecast: '雨',
mintemp: '24',
maxtemp: '28',
pop: '90'
},
{
date: '03日(土)',
forecast: '曇時々雨',
mintemp: '25',
maxtemp: '31',
pop: '80'
},
{
date: '04日(日)',
forecast: '曇一時雨',
mintemp: '26',
maxtemp: '31',
pop: '60'
},
{
date: '05日(月)',
forecast: '曇',
mintemp: '26',
maxtemp: '31',
pop: '40'
},
{
date: '06日(火)',
forecast: '曇一時雨',
mintemp: '25',
maxtemp: '31',
pop: '60'
}
]
参考
クジラWeb API - tenki