Updated the currency API

Author: rehan2003guptaCreated Aug 10, 2025Updated Feb 2, 2026

The new API is :- [(https://v6.exchangerate-api.com/v6/ff7f40c44ff6bb383af60905/latest/${currency})]

//This is the code snippet if you want to update the existing code

import { useEffect, useState } from "react";

function useCurrencyInfo(currency) { const [data, setData] = useState({});

useEffect(() => { fetch(https://v6.exchangerate-api.com/v6/ff7f40c44ff6bb383af60905/latest/${currency}) .then((res) => res.json()) .then((res) => { if (res.result === "success") { setData(res.conversion_rates); // ✅ fix: correct data path } else { setError("Failed to fetch currency data"); } }) .catch((err) => { console.log("ERROR :- FETCHING API") }); }, [currency]);

return data; // return loading & error if needed }

export default useCurrencyInfo;

Source: hiteshchoudhary/chai-aur-react