-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
currency converter api was not working sir.... #105
Comments
bro do u have another api for currency converter |
please read the migration |
Try this brother, it's workingconst baseURL = `https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies`;
const URL = `${baseURL}/${fromCurrency}.json`;
// Use it in async func. obviously
try {
let response = await fetch(URL);
let responseJSON = await response.json();
let rate = responseJSON[fromCurrency][toCurrency];
if (!response.ok) {
throw new Error(`Network response was not ok`);
}
} catch (error) {
msg.innerHTML = `Failed to fetch exchange rate. Try again later.`;
console.error("Fetch error:", error);
return;
}
``` |
brother please help.. i am new to programing. just making currency converter. you have migrated the files to github. I want to use this link https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies/eur/jpy.json in my code but i can't. so as per the given instructions i figured out a little bit and i was able to make this link https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/inr.json but at the last of this link i need usd/inr.json Plz help me out
The text was updated successfully, but these errors were encountered: