I am trying to fetch api for crypto app project and i am unable to do so. In my console it is constantly showing error 403. I even tried on endpoint and there also i found no difference in result.The website coingecko
https://www.coingecko.com/en/api/documentation
MY Code-
const Coins = () => {
const [coins, setCoins] = useState([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(false);
const [page, setPage] = useState(1);
const [currency, setCurrency] = useState("inr");
const currencySymbol =
currency == "inr" ? "₹" : currency === "eur" ? "€" : "$";
const changePage = (page) => {
setPage(page);
setLoading(true);
};
const btns = new Array(132).fill(1);
useEffect(() => {
const fetchCoins = async () => {
try {
const { data } = await axios.get(
`${server}/coins/markets?vs_currecy=${currency}&page=${page}`
);
setCoins(data);
setLoading(false);
} catch (error) {
setError(true);
setLoading(false);
}
};
fetchCoins();
}, [currency, page]);