Hello!
I’ve been trying to “axios.get()” updated news regarding coinmarketcaps top 10 coins. I keep getting an error message and I can’t figure what adjustment I need to make… Can anyone help?
Here is my code
const coinInfo = async() => {
//fetch coin update data thorugh RANK
const apiKey = {
key: '68da4c90-613d-4068-8f6d-0e7dfeff457c'
};
const response = await axios.get('https://pro-api.coinmarketcap.com/v1/cryptocurrency/info/CMC_PRO_API_KEY=' + apiKey.key);
const coinInformation = response.data.slice(0, COIN_COUNT).map(coin => coin.info);
const promises = coinInformation.map(info => info.data.urls);
const coinNews = await Promise.all(promises);
const coinNewsData = coinNews.map(function(response) {
const info = response.data;
return{
key: info.id,
info: info.message_board,
};
});
setcoinNews(coinNewsData);
}
And here is my error…
GET https://pro-api.coinmarketcap.com/v1/cryptocurrency/info/CMC_PRO_API_KEY=68da4c90-613d-4068-8f6d-0e7dfeff457c 404
createError.js:16 Uncaught (in promise) Error: Request failed with status code 404
at createError (createError.js:16)
at settle (settle.js:17)
at XMLHttpRequest.handleLoad (xhr.js:62)