I am currently trying to implement an API in my Android App.
The .fetch command works and I get a long list with the data but I can´t figure out for the life of me, how to get specific data out of the list.
For example, I want only the "Open" value from a specific time.
Here is my code:
document.addEventListener("click", function (event) {
if (!event.target.matches("#button")) return;
fetch("https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=IBM&interval=5min&apikey=demo")
.then((response) => response.json())
.then((data)=>console.log(data))
.then((data) => renderData(data));
});
function renderData(data) {
var metaData = document.getElementById("2022-01-28 20:00:00").innerText;
//var time = document.getElementsByName("2022-01-28 20:00:00");
//var test = document.filter(data => data.id);
//Just tried different methods above.
// console.log(test)
// console.log(time)
console.log(metaData)
}
This is the URL for the API: https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=IBM&interval=5min&apikey=demo