exchange-api
exchange-api copied to clipboard
[Suggestion] API v2
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
- Host the project on NPM
- Do not generate
.min.json
s (see jsDelivr docs) - Use the purge cache jsDelivr API for faster user access to the new data
Organization
- 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
- Example:
-
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
- Example: US Dollar ->
-
id
: The ISO-4271 currency code, or if it's a cryptocurrency, the standard ID. Examples:- US Dollar ->
USD
- Bitcoin ->
BTC
- US Dollar ->
-
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 asid
) Examples:- Euro ->
€
- Bitcoin ->
₿
- Euro ->
-
country
(national and obsolete only): The country (or area) this currency was/is used. Example:- US Dollar -> United States Of America
- Greek Drahma -> Greece
- Using the Calver versioning system instead of putting historical data to folders
- 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 fawazahmed0/exchange-api#83 fawazahmed0/exchange-api#81 fawazahmed0/exchange-api#78 fawazahmed0/exchange-api#73 fawazahmed0/exchange-api#72 fawazahmed0/exchange-api#53 fawazahmed0/exchange-api#42
It is sad that the developer ignores this
Hey @fawazahmed0, how likely is it for this to be implemented? I can provide my assistance if you want me to.
Thanks for assistance @RaptaG , I will let you know when I start implementing v2 of this api.
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
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.
Btw, I suggest removing obsolete currencies altogether, they are of no real value
why did you close all these issues man?
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
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?