8000
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got email from GitHub to remove currency-api repository, due to large size.
I have migrated things to cloudflare and npm.
Please read the migration guide to migrate from old currency-api.
Reacted by infinite-apps-alex, PurpleTape, Braifz, RaptaG, Vadim Iskuchekov, SweetPPro, malle-pietje, Leo, Benjamin Ayles, Bohdan Yurchuk and 8 more
Reacted by Nagy Vilmos and David Manouchehri
Reacted by Nagy Vilmos, Aayan Mumtaz and Lev Iakimov
justice for /currencies/{currencyCode}/{currencyCode} Api user
how exactly can i use the new api
Guys I tried this and it is working.
constbaseURL=`https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies`;constURL=`${baseURL}/${fromCurrency}.json`;// Use it in async func. obviouslytry{letresponse=awaitfetch(URL);if(!response.ok){thrownewError(`Status : ${response.status}\n Status Text : ${response.statusText}`);}letresponseJSON=awaitresponse.json();letrate=responseJSON[fromCurrency][toCurrency];}catch(error){msg.innerHTML=`Failed to fetch exchange rate. Please try again later.`;console.error("Fetch error:",error);return;}
hey guys,this is the simple way of accessing async function main(fromcurrency,tocurrency){ let data=await fetch([https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/${fromcurrency}.json](https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/$%7Bfromcurrency%7D.json%60)) let jsondata=await data.json() let rate=jsondata[fromcurrency][tocurrency] } main('usd','inr')
my code is not working can you please see whats the issue in it?
async function main(fromCurrency, toCurrency) {
let response = await fetch(https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/${fromCurrency}.json);
let jsonData = await response.json();
let rate = jsonData[fromCurrency][toCurrency];
console.log(Exchange rate from ${fromCurrency} to ${toCurrency}: ${rate});
}
main('usd', 'inr');
Activity
iplanwebsites commentedon Mar 3, 2024
thanks for the clarification, let's home NPM will be fine with it.
careybaird commentedon Mar 10, 2024
@fawazahmed0 I just wanted to say a big thank you for providing and maintaining this service 🙏
Great idea to add the cloudflare fallback URL.
vilmosnagy commentedon Mar 15, 2024
@fawazahmed0 is there a way to download the data between 2022 and the migration? thanks
SpazzRabbit commentedon Apr 9, 2024
@fawazahmed0 You also can use ipfs
Migrate to new version of fawazahmed0's currency API
Migrate to NPM Free Currency Exchange Rates API
UsmanAkhtar0 commentedon Aug 6, 2024
justice for /currencies/{currencyCode}/{currencyCode} Api user
Not-Secret-Dev commentedon Aug 31, 2024
Now how can I convert the currency?
fawazahmed0 commentedon Sep 1, 2024
Old Currency API:
New Currency API:
Krishna-D-developer commentedon Sep 25, 2024
how exactly can i use the new api
dnet890 commentedon Oct 18, 2024
@Not-Secret-Dev with this new api we cannot convert currency anymore.
kaustubh-tripathi-1 commentedon Oct 29, 2024
Guys I tried this and it is working.
Sreeman45 commentedon Dec 11, 2024
hey guys,this is the simple way of accessing
async function main(fromcurrency,tocurrency){ let data=await fetch(https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/${fromcurrency}.json`)let jsondata=await data.json()
let rate=jsondata[fromcurrency][tocurrency]
}
main('usd','inr')`
AliAdnansid commentedon Jan 12, 2025
my code is not working can you please see whats the issue in it?
junaid-khalil commentedon Jan 31, 2025
async function main(fromCurrency, toCurrency) {
let response = await fetch(
https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/${fromCurrency}.json);let jsonData = await response.json();
let rate = jsonData[fromCurrency][toCurrency];
console.log(
Exchange rate from ${fromCurrency} to ${toCurrency}: ${rate});}
main('usd', 'inr');
check this it works
Shafiakram209 commentedon Mar 20, 2025
async function main(fromCurrency, toCurrency) {
let response = await fetch(https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/${fromCurrency}.json);
let jsonData = await response.json();
let rate = jsonData[fromCurrency][toCurrency]; // This is old and Not work
let rate = jsonData[fromCurrency.value.toLowerCase()][toCurrency.value.toLowerCase()];// New Change here and It 100% work
console.log(Exchange rate from ${fromCurrency)} to ${toCurrency}: ${rate});
}
main('usd', 'inr');
check this it works