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

[Suggestion] API v2 #84

Open
RaptaG opened this issue Feb 14, 2024 · 9 comments
Open

[Suggestion] API v2 #84

RaptaG opened this issue Feb 14, 2024 · 9 comments

Comments

@RaptaG
Copy link

RaptaG commented Feb 14, 2024

The Problem

In the current version, even though it works, there are many flaws and problems which should be fixed on the side of this API (not the developer side).

Just to name a few:

  • Storage space of the repo is too big
  • The daily currency fetching takes more than 5 hours to complete
  • There is no categorization in national currencies, obsolete national currencies and cryptocurrencies
  • There is few (and often missing) information about each currency

Solution

There are many fixes about these issues:

Efficiency

  1. Host the project on NPM
  2. Do not generate .min.jsons (see jsDelivr docs)
  3. Use the purge cache jsDelivr API for faster user access to the new data

Organization

  1. Use a new JSON format:

currencies.json

{
  "date": "YYYY-MM-DD",
  "national": {
    "currency-id-in-the-api": {
      "id": "id-here",
      "name": "name-here",
      "symbol": "symbol-here",
      "country": "country-here"
    }
  },
  "obsolete": {
    "currency-id-in-the-api": {
      "id": "id-here",
      "name": "name-here",
      "symbol": "symbol-here",
      "country": "country-here"
    }
  },
  "crypto": {
    "currency-id-in-the-api": {
      "id": "id-here",
      "name": "name-here",
      "symbol": "symbol-here"
    }
  }
}

Description:

  • date: The date when the data updated, in YYYY-MM-DD format.
    • Example: 2024-1-1
  • national: National currencies.
    • Example: Euro
  • obsolete: National currencies that don't exist anymore.
    • Example: Greek Drahma
  • crypto: Cryptocurrencies.
    • Example: Bitcoin
  • currency-id-in-the-api: The same as the each value's key currently
    • Example: US Dollar -> usd
  • id: The ISO-4271 currency code, or if it's a cryptocurrency, the standard ID.
    Examples:
    • US Dollar -> USD
    • Bitcoin -> BTC
  • name: The full name of each currency.
    Example: eur -> Euro
  • symbol: The symbol for each currency (if none then it should have the same value as id)
    Examples:
    • Euro ->
    • Bitcoin ->
  • country (national and obsolete only): The country (or area) this currency was/is used.
    Example:
    • US Dollar -> United States Of America
    • Greek Drahma -> Greece
  1. Using the Calver versioning system instead of putting historical data to folders
  2. Cleanup and remove useless files from the repo

Other

A cleanup of the API currency IDs would be a useful, yet optional, addition as well.

References

fawazahmed0/currency-api#104 #83 #81 #78 #73 #72 #53 #42

@RaptaG
Copy link
Author

RaptaG commented Feb 24, 2024

It is sad that the developer ignores this

@RaptaG
Copy link
Author

RaptaG commented Feb 26, 2024

Hey @fawazahmed0, how likely is it for this to be implemented? I can provide my assistance if you want me to.

@fawazahmed0
Copy link
Owner

Thanks for assistance @RaptaG , I will let you know when I start implementing v2 of this api.

@RaptaG
Copy link
Author

RaptaG commented Feb 26, 2024

Thanks for assistance @RaptaG , I will let you know when I start implementing v2 of this api.

Do you plan it anytime soon and if yes, when?
Thanks for replying @fawazahmed0 , too

@fawazahmed0
Copy link
Owner

I don't have an exact date, but v2 of this api is something I am considering from long time.
To be more precise, I am not intending to start this in next coming days because there are more high priority tasks in my backlog.

@RaptaG
Copy link
Author

RaptaG commented Feb 26, 2024

Btw, I suggest removing obsolete currencies altogether, they are of no real value

@fawazahmed0 fawazahmed0 transferred this issue from another repository Feb 29, 2024
@RaptaG
Copy link
Author

RaptaG commented Mar 4, 2024

why did you close all these issues man?

@fawazahmed0
Copy link
Owner

Most of these things are not relevant now, the project has been migrated to npm and cloudflare.
For example:

Storage space of the repo is too big

Currently the data is not stored in git repo, its stored in npm.

Host the project on NPM

This is already done now

@RaptaG
Copy link
Author

RaptaG commented Mar 5, 2024

Most of these things are not relevant now, the project has been migrated to npm and cloudflare.
For example:

Storage space of the repo is too big

Currently the data is not stored in git repo, its stored in npm.

Host the project on NPM

This is already done now

What about the proposed json format?

@fawazahmed0 fawazahmed0 reopened this Mar 5, 2024
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

2 participants