Skip to content
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

Open
fawazahmed0 opened this issue Mar 2, 2024 · 10 comments
Open

What happened to old currency-api #89

fawazahmed0 opened this issue Mar 2, 2024 · 10 comments

Comments

@fawazahmed0
Copy link
Owner

fawazahmed0 commented Mar 2, 2024

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.

@iplanwebsites
Copy link

thanks for the clarification, let's home NPM will be fine with it.

@careybaird
Copy link

@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
Copy link

@fawazahmed0 is there a way to download the data between 2022 and the migration? thanks

@windows8prew
Copy link

@fawazahmed0 You also can use ipfs

quantum5 added a commit to quantum5/domainmod that referenced this issue Jul 18, 2024
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.
gregdotca added a commit to gregdotca/gjclasses that referenced this issue Aug 6, 2024
GitHub made the creator remove the code, so they moved it to NPM.

fawazahmed0/exchange-api#89
@UsmanAkhtar0
Copy link

justice for /currencies/{currencyCode}/{currencyCode} Api user

@Not-Secret-Dev
Copy link

Now how can I convert the currency?

@fawazahmed0
Copy link
Owner Author

fawazahmed0 commented Sep 1, 2024

justice for /currencies/{currencyCode}/{currencyCode} Api user

Old Currency API:

json = fetchJSON(`/currencies/{fromCurrency}/{toCurrency}`)
rate = json[toCurrency]

New Currency API:

json = fetchJSON(`/currencies/{fromCurrency}`)
rate = json[fromCurrency][toCurrency]

@Krishna-D-developer
Copy link

justice for /currencies/{currencyCode}/{currencyCode} Api user

how exactly can i use the new api

@dnet890
Copy link

dnet890 commented Oct 18, 2024

@Not-Secret-Dev with this new api we cannot convert currency anymore.

@kaustubh-tripathi-1
Copy link

kaustubh-tripathi-1 commented Oct 29, 2024

justice for /currencies/{currencyCode}/{currencyCode} Api user

how exactly can i use the new api

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;
    }
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants