-
Notifications
You must be signed in to change notification settings - Fork 46
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
What happened to old currency-api #89
Comments
thanks for the clarification, let's home NPM will be fine with it. |
@fawazahmed0 I just wanted to say a big thank you for providing and maintaining this service 🙏 Great idea to add the cloudflare fallback URL. |
@fawazahmed0 is there a way to download the data between 2022 and the migration? thanks |
@fawazahmed0 You also can use ipfs |
Due to fawazahmed0/exchange-api#89, the old API is down and doesn't work anymore. This PR migrates it to use the newer API as documented in https://github.com/fawazahmed0/exchange-api/blob/main/MIGRATION.md.
GitHub made the creator remove the code, so they moved it to NPM. fawazahmed0/exchange-api#89
justice for /currencies/{currencyCode}/{currencyCode} Api user |
Now how can I convert the currency? |
Old Currency API: json = fetchJSON(`/currencies/{fromCurrency}/{toCurrency}`)
rate = json[toCurrency] New Currency API: json = fetchJSON(`/currencies/{fromCurrency}`)
rate = json[fromCurrency][toCurrency] |
how exactly can i use the new api |
@Not-Secret-Dev with this new api we cannot convert currency anymore. |
Guys I tried this and it is working.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;
}
|
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.
The text was updated successfully, but these errors were encountered: