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

Lack of documentation #79

Open
RaptaG opened this issue Jan 14, 2024 · 14 comments
Open

Lack of documentation #79

RaptaG opened this issue Jan 14, 2024 · 14 comments

Comments

@RaptaG
Copy link

RaptaG commented Jan 14, 2024

Although this project is amazing, supporting many currencies without rate limits, there are still some flaws regarding documentation and organization in general:

  1. There is no wiki or a website explaining how this API works
  2. There is no explanation on when the currencies refresh and also the various time gaps
    (Currency CDN not working #85)
  3. (Optional) There are no example requests
  4. The currencies are not categorized in physical currencies and cryptocurrencies
  5. The JSONs containing the currency lists don't use the ISO-4217 format, their full names are improperly capitalized and there are many empty names

I believe 1., 2., 4., and 5. are very major points which should be addressed, to allow more developers to better use this amazing API.

References: #72, #78

@RaptaG
Copy link
Author

RaptaG commented Jan 14, 2024

I asked ChatGPT to better format https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json and these are the results. It does not include some empty things, like "1000sats": "", but overall it looks better the existing one in terms of formatting. Manual approval is mandatory though.

National currencies
{
    "AED": "Emirati Dirham",
    "AFN": "Afghan Afghani",
    "ALL": "Albanian Lek",
    "AMD": "Armenian Dram",
    "ANG": "Dutch Guilder",
    "AOA": "Angolan Kwanza",
    "ARS": "Argentine Peso",
    "AUD": "Australian Dollar",
    "AWG": "Aruban or Dutch Guilder",
    "AZN": "Azerbaijan Manat",
    "BAM": "Bosnian Convertible Mark",
    "BBD": "Barbadian or Bajan Dollar",
    "BDT": "Bangladeshi Taka",
    "BGN": "Bulgarian Lev",
    "BHD": "Bahraini Dinar",
    "BIF": "Burundian Franc",
    "BMD": "Bermudian Dollar",
    "BND": "Bruneian Dollar",
    "BOB": "Bolivian Bolíviano",
    "BRL": "Brazilian Real",
    "BSD": "Bahamian Dollar",
    "BWP": "Botswana Pula",
    "BYN": "Belarusian Ruble",
    "BZD": "Belizean Dollar",
    "CAD": "Canadian Dollar",
    "CHF": "Swiss Franc",
    "CLP": "Chilean Peso",
    "CNY": "Chinese Yuan Renminbi",
    "COP": "Colombian Peso",
    "CRC": "Costa Rican Colon",
    "CVE": "Cape Verdean Escudo",
    "CZK": "Czech Koruna",
    "DJF": "Djiboutian Franc",
    "DKK": "Danish Krone",
    "DOP": "Dominican Peso",
    "DZD": "Algerian Dinar",
    "EGP": "Egyptian Pound",
    "ERN": "Eritrean Nakfa",
    "ETB": "Ethiopian Birr",
    "EUR": "Euro",
    "FJD": "Fijian Dollar",
    "FKP": "Falkland Island Pound",
    "GBP": "British Pound",
    "GEL": "Georgian Lari",
    "GHS": "Ghanaian Cedi",
    "GIP": "Gibraltar Pound",
    "GMD": "Gambian Dalasi",
    "GNF": "Guinean Franc",
    "GTQ": "Guatemalan Quetzal",
    "GYD": "Guyanese Dollar",
    "HKD": "Hong Kong Dollar",
    "HNL": "Honduran Lempira",
    "HRK": "Croatian Kuna",
    "HTG": "Haitian Gourde",
    "HUF": "Hungarian Forint",
    "IDR": "Indonesian Rupiah",
    "ILS": "Israeli Shekel",
    "INR": "Indian Rupee",
    "ISK": "Icelandic Krona",
    "JMD": "Jamaican Dollar",
    "JOD": "Jordanian Dinar",
    "JPY": "Japanese Yen",
    "KES": "Kenyan Shilling",
    "KGS": "Kyrgyzstani Som",
    "KHR": "Cambodian Riel",
    "KWD": "Kuwaiti Dinar",
    "KYD": "Caymanian Dollar",
    "KZT": "Kazakhstani Tenge",
    "LAK": "Lao Kip",
    "LBP": "Lebanese Pound",
    "LKR": "Sri Lankan Rupee",
    "LSL": "Basotho Loti",
    "LTL": "Lithuanian Litas",
    "LVL": "Latvian Lat",
    "MAD": "Moroccan Dirham",
    "MDL": "Moldovan Leu",
    "MKD": "Macedonian Denar",
    "MNT": "Mongolian Tughrik",
    "MUR": "Mauritian Rupee",
    "MVR": "Maldivian Rufiyaa",
    "MWK": "Malawian Kwacha",
    "MXN": "Mexican Peso",
    "MYR": "Malaysian Ringgit",
    "MZN": "Mozambican Metical",
    "NAD": "Namibian Dollar",
    "NGN": "Nigerian Naira",
    "NIO": "Nicaraguan Cordoba",
    "NOK": "Norwegian Krone",
    "NPR": "Nepalese Rupee",
    "NZD": "New Zealand Dollar",
    "OMR": "Omani Rial",
    "PAB": "Panamanian Balboa",
    "PEN": "Peruvian Sol",
    "PGK": "Papua New Guinean Kina",
    "PHP": "Philippine Peso",
    "PKR": "Pakistani Rupee",
    "PLN": "Polish Zloty",
    "PYG": "Paraguayan Guarani",
    "QAR": "Qatari Riyal",
    "RON": "Romanian Leu",
    "RSD": "Serbian Dinar",
    "RUB": "Russian Ruble",
    "RWF": "Rwandan Franc",
    "SAR": "Saudi Arabian Riyal",
    "SBD": "Solomon Islander Dollar",
    "SCR": "Seychellois Rupee",
    "SEK": "Swedish Krona",
    "SGD": "Singapore Dollar",
    "SHP": "Saint Helenian Pound",
    "SLL": "Sierra Leonean Leone",
    "SOS": "Somali Shilling",
    "STD": "Sao Tomean Dobra",
    "SZL": "Swazi Lilangeni",
    "THB": "Thai Baht",
    "TND": "Tunisian Dinar",
    "TOP": "Tongan Pa'anga",
    "TRY": "Turkish Lira",
    "TTD": "Trinidadian Dollar",
    "TWD": "Taiwan New Dollar",
    "TZS": "Tanzanian Shilling",
    "UAH": "Ukrainian Hryvnia",
    "UGX": "Ugandan Shilling",
    "USD": "US Dollar",
    "UYU": "Uruguayan Peso",
    "UZS": "Uzbekistani Som",
    "VND": "Vietnamese Dong",
    "VUV": "Ni-Vanuatu Vatu",
    "WST": "Samoan Tala",
    "XAF": "Central African CFA Franc BEAC",
    "XOF": "CFA Franc",
    "YER": "Yemeni Rial",
    "ZAR": "South African Rand",
    "ZMK": "Zambian Kwacha",
    "ZWD": "Zimbabwean Dollar"
}
Cryptocurrencies
{
    "BTC": "Bitcoin",
    "ETH": "Ethereum",
    "BNB": "Binance Coin",
    "ADA": "Cardano",
    "SOL": "Solana",
    "XRP": "XRP",
    "DOT": "Polkadot",
    "USDT": "Tether",
    "DOGE": "Dogecoin",
    "AVAL": "Avalanche",
    "LTC": "Litecoin",
    "LINK": "Chainlink",
    "BUSD": "Binance USD",
    "MATIC": "Polygon",
    "BCH": "Bitcoin Cash",
    "VET": "VeChain",
    "ATOM": "Cosmos",
    "CRO": "Crypto.com Coin",
    "EOS": "EOS",
    "UNI": "Uniswap",
    "WBTC": "Wrapped Bitcoin",
    "XMR": "Monero",
    "THETA": "Theta",
    "AAVE": "Aave",
    "FIL": "Filecoin",
    "TRX": "TRON",
    "XTZ": "Tezos",
    "ALGO": "Algorand",
    "ETC": "Ethereum Classic",
    "SNX": "Synthetix",
    "FTT": "FTX Token",
    "ICP": "Internet Computer",
    "CHZ": "Chiliz",
    "DOGE": "DogeCoin",
    "SHIBA": "Shiba Inu",
    "SAFEMOON": "SafeMoon"
}

@fawazahmed0
Copy link
Owner

fawazahmed0 commented Jan 14, 2024

Thanks for your feedback.

There is no wiki or a website explaining how this API works

Here

There is no explanation on when the currencies refresh and also the various time gaps

You shouldn't worry about this as long as you are using /latest

@RaptaG
Copy link
Author

RaptaG commented Jan 14, 2024

You shouldn't worry about this as long as you are using /latest

I would like to check on my program when to refresh the rates, so that it is done once per 24 hours. I might use the GitHub API for that, but we'll see.

@RaptaG
Copy link
Author

RaptaG commented Jan 14, 2024

I asked ChatGPT to better format https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json and these are the results. It does not include some empty things, like "1000sats": "", but overall it looks better the existing one in terms of formatting. Manual approval is mandatory though.
National currencies
Cryptocurrencies

What about this @fawazahmed0 (and points 4. & 5. for that matter).

Thanks for the quick response

@fawazahmed0
Copy link
Owner

https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json link is used by alot many people. Any changes will break things for other.

@RaptaG
Copy link
Author

RaptaG commented Jan 14, 2024

Can you then explain me why are there so many empty names? Are there rates for all the entries inside this JSON? I believe making an announcement and reformatting the JSON would not be a problem.

Any changes will break things for other.

On that matter adding any new cryptocurrency will break everything as well.

This JSON is awfully organized.

@RaptaG
Copy link
Author

RaptaG commented Jan 14, 2024

At the very least, we could apply these modifications in a new JSON inside the repo, which would be updated (when a new currency is added) alongside with https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json

I could help applying this solution.

Do you agree @fawazahmed0

@fawazahmed0
Copy link
Owner

You will have to update this file to fix issues in currencies.json

@RaptaG
Copy link
Author

RaptaG commented Jan 14, 2024

I will make a Pull Request, you can approve it once I finish

@RaptaG
Copy link
Author

RaptaG commented Jan 14, 2024

This file include >7000 entries, does this API include them all?

@fawazahmed0
Copy link
Owner

fawazahmed0 commented Jan 14, 2024

This file include >7000 entries, does this API include th

Add entries for 1000sats etc in this file to fix empty names issue in currencies.json

@RaptaG
Copy link
Author

RaptaG commented Jan 14, 2024

How can I sort the currencies and separate them to national and cryptocurrencies? Is it possible?

@fawazahmed0
Copy link
Owner

fawazahmed0 commented Jan 14, 2024

no, not possible, this will break things

@RaptaG
Copy link
Author

RaptaG commented Jan 15, 2024

no, not possible, this will break things

Can I make a Pull Request with two new JSONs, separating the national and the crypto currencies? Then you can indicate people adding new cryptocurrencies in #40 to update the new crypto file as well when adding a new cryptocurrency and run it through a tool like https://novicelab.org/jsonabc/ so that they are always sorted alphabetically.

@fawazahmed0

@fawazahmed0 fawazahmed0 transferred this issue from another repository Feb 29, 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