Im trying to get stock prices from this api: https://english.api.rakuten.net/apidojo/api/yahoo-finance1?endpoint=apiendpoint_a1e0ecc6-0a3a-43fd-8133-77a66d33f68c
In the web page you can see the json objects that getting historical data returns, even though Im using their fetch code to call the api, response is empty {}.
Does anyone know how to get the adjclose variable and store it in an array?
This is my code so far
let symbol = "DIS";
let unixTimeStamp = Math.round((new Date()).getTime() / 1000).toString();
let url = "https://apidojo-yahoo-finance-v1.p.rapidapi.com/stock/v2/get-historical-data?frequency=1d&filter=history&period1=1&period2=" + unixTimeStamp + "&symbol=" + symbol;
fetch(url, {
"method": "GET",
"headers": {
"x-rapidapi-host": "apidojo-yahoo-finance-v1.p.rapidapi.com",
"x-rapidapi-key": "Secret api key"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});