Open ShekhFaisal26 opened 2 months ago
bro do u have another api for currency converter
please read the migration
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
const 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