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

Filter unwanted currency output in the new API #107

Open
dnet890 opened this issue Oct 18, 2024 · 6 comments
Open

Filter unwanted currency output in the new API #107

dnet890 opened this issue Oct 18, 2024 · 6 comments

Comments

@dnet890
Copy link

dnet890 commented Oct 18, 2024

Hi
on the old API we can mention the output of the currency. But, how we can do the same thing on the new API?

@fawazahmed0
Copy link
Owner

Please read the migration

@dnet890
Copy link
Author

dnet890 commented Oct 18, 2024

Wait, I don't get it. For example: if I type: curl https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/eur.json
I got Euro with all currency. How about if I just want to know the value 1 USD to EUR currency?

@joshbmarshall
Copy link

That's easy, the eur.usd tells you how many usd 1 EUR is.

The jsdelivr is a cdn, it gives all currencies in the one request. No need to have hundreds of endpoints with just one conversion.

@dnet890
Copy link
Author

dnet890 commented Oct 18, 2024

So, we cannot filter or currency pairing anymore and we just got long list of unnecessary currencies?
image

@joshbmarshall
Copy link

That json file is only 7kb, and easy to parse. Would you prefer there be 300+ endpoints for every currency to do a 1:1 conversion? That's thousands of combinations, just to save a few bytes in the one request.

The reason the new api was made is because there were too many files in the previous one. It's not difficult to deal with and I actually prefer this one because from the one base currency I can get all the currencies my visitors will need, and cache for the day.

So one request per day and I have every currency converted. I love it. Thanks @fawazahmed0

@dnet890
Copy link
Author

dnet890 commented Oct 18, 2024

it is depending on everyone situation though. if you want to view all currencies in the world in one command that is fine for you. But, someone want a simplicity like simple currency pairing viewing in the bank or money changer or in your smartphone app (i.e: iOS Stocks).

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

3 participants