I will please need another pair of eyes on this. I am getting historical data from cryptocompare API and can't access the values I receive.
When I hardcode it, something like res.data.OMG.USD
, I am able to get the result.
These is the exact format it comes in. I tried parsing it into a string and pushing the results into an array but haven't been able to access the prices, when I did Object.key, it returned only the name and not the USD or EUR values. What am I missing here?
UPDATE:here is the request, I am trying to access the USD values.
$http.get(
'data/pricehistorical?fsym=BTC&tsyms=USD,EUR'
).then(
function(res) {
//sample response
/*
{"OMG":{"USD":8.19,"EUR":6.65}}
{"BTC":{"USD":10226.86,"EUR":8153.29}}
*/
},
function(res) {
console.log(res);
}
);