How to fetch "high" and "low" price from the following web api using AXIOS. Here you will find the following code, but obviously I need to change to make it work properly for all dates.
axios.get('https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=MSFT&apikey=TUVR')
.then(response => {
console.log(response.data['Time Series (Daily)']['2018-10-18']['2. high']);
console.log(response.data['Time Series (Daily)']['2018-10-18']['3. low']);
})
.catch(error => {
console.log(error);
});
sample of the original data I am trying to extract
{
"Meta Data": {
"1. Information": "Weekly Prices (open, high, low, close) and Volumes",
"2. Symbol": "MSFT",
"3. Last Refreshed": "2018-10-18",
"4. Time Zone": "US/Eastern"
},
"Weekly Time Series": {
"2018-10-18": {
"1. open": "108.9100",
"2. high": "111.8100",
"3. low": "106.9468",
"4. close": "108.5000",
"5. volume": "122020154"
},
"2018-10-12": {
"1. open": "111.6600",
"2. high": "113.0800",
"3. low": "104.2000",
"4. close": "109.5700",
"5. volume": "228861873"
},
"2018-10-05": {
"1. open": "114.7500",
"2. high": "116.1800",
"3. low": "110.6400",
"4. close": "112.1300",
"5. volume": "120208912"
},
"2018-09-28": {
"1. open": "113.0300",
"2. high": "115.1000",
"3. low": "112.2175",
"4. close": "114.3700",
"5. volume": "110093609"
}
}
}
Time Series (Daily)came from