Hello,
I’m a beginner on working with APIs and currently am trying to develop a small WebApp using Vuejs and axios.
I’m currently working with the history side of the API and am able to get any currency’s history, one by one (https://developers.coinranking.com/api/documentation/coins#get-coin-history).
However I would like to be able to make a single request for all currencies instead of having to make a single one per currency (for example, showing the last element of the history for every coins).
Since the call for this data is “/coin/:uuid/history” I’m struggling a bit and can’t seem to find the right approach.
This is the code I used to access the BTC history (and make a comparison to know if it’s going up or down) which is working:
axios
.get(proxyurl + history_url, {
reqHeaders
})
.then((reponseHistory) => {
//get data from last element
const history = reponseHistory.data.data.history
this.lastItem = history[history.length-1]
this.lastEvol = this.lastItem.price
//get data from previous element:
this.previousItem = history[history.length-2]
this.previousEvol = this.previousItem.price
})
.catch((error) => {
console.error(error)
})
Thanks for you help!
Let me know if you’re missing information.
Cheers,