hippasus / ExchangeRates

Rate exchange JSON/JSONP APIs
http://rate-exchange.appspot.com
MIT License
60 stars 27 forks source link

Bitcoin issue #26

Closed php5developer closed 10 years ago

php5developer commented 10 years ago

The Bitcoin currency ID in xe.com is XBT, while in google it is BTC. So, from time to time I got error: "failed to parse response from {rate provider}". Thank you.

hippasus commented 10 years ago

Is there any ISO standard for this?

php5developer commented 10 years ago

Actually no. Because most of countries do not consider Bitcoin as currency. As I see, now you do not use GoogleCurrencyRateRequest class to fetch rates from Google. Maybe in the future you will return to its use. All in all, I compared to list of supported currencies by xe.com and www.google.com/finance/converter And what I found:

Not support by xe.com: Chilean Unit of Account (UF) (CLF) Not support by xe.com: CNH (CNH) Not supported by xe.com: PKG (PKG) Not supported by xe.com: Zimbabwean Dollar (2009) (ZWL) Not supported by xe.com: Zambian Kwacha (1968–2012) (ZMK)

Not supported by google: CUC - Cuban Convertible Peso Not supported by google: GGP - Guernsey Pound Not supported by google: IMP - Isle of Man Pound Not supported by google: JEP - Jersey Pound Not supported by google.com: SPL - Seborgan Luigino Not supported by google.com: TVD - Tuvaluan Dollar Not supported by google.com: XAG - Silver Ounce Not supported by google.com: XAU - Gold Ounce Not supported by google.com: XPD - Palladium Ounce Not supported by google.com: XPT - Platinum Ounce Not supported by google.com: ZWD - Zimbabwean Dollar

The list of currencies supported for both providers (156):

    AED: 'Arab Emirates Dirham (AED)',
    AFN: 'Afghan Afghani (AFN)',
    ALL: 'Albanian Lek (ALL)',
    AMD: 'Armenian Dram (AMD)',
    ANG: 'Neth. Antillean Guilder (ANG)',
    AOA: 'Angolan Kwanza (AOA)',
    ARS: 'Argentine Peso (ARS)',
    AUD: 'Australian Dollar (A$)',
    AWG: 'Aruban Florin (AWG)',
    AZN: 'Azerbaijani Manat (AZN)',
    BAM: 'Bosnia-Her. Convertible Mark (BAM)',
    BBD: 'Barbadian Dollar (BBD)',
    BDT: 'Bangladeshi Taka (BDT)',
    BGN: 'Bulgarian Lev (BGN)',
    BHD: 'Bahraini Dinar (BHD)',
    BIF: 'Burundian Franc (BIF)',
    BMD: 'Bermudan Dollar (BMD)',
    BND: 'Brunei Dollar (BND)',
    BOB: 'Bolivian Boliviano (BOB)',
    BRL: 'Brazilian Real (R$)',
    BSD: 'Bahamian Dollar (BSD)',
    BTN: 'Bhutanese Ngultrum (BTN)',
    BWP: 'Botswanan Pula (BWP)',
    BYR: 'Belarusian Ruble (BYR)',
    BZD: 'Belize Dollar (BZD)',
    CAD: 'Canadian Dollar (CA$)',
    CDF: 'Congolese Franc (CDF)',
    CHF: 'Swiss Franc (CHF)',
    CLP: 'Chilean Peso (CLP)',
    CNY: 'Chinese Yuan (CN¥)',
    COP: 'Colombian Peso (COP)',
    CRC: 'Costa Rican Colón (CRC)',
    CUP: 'Cuban Peso (CUP)',
    CVE: 'Cape Verdean Escudo (CVE)',
    CZK: 'Czech Republic Koruna (CZK)',
    DEM: 'German Mark (DEM)',
    DJF: 'Djiboutian Franc (DJF)',
    DKK: 'Danish Krone (DKK)',
    DOP: 'Dominican Peso (DOP)',
    DZD: 'Algerian Dinar (DZD)',
    // EEK: 'Estonian Kroon (EEK)', // obsolete
    EGP: 'Egyptian Pound (EGP)',
    ERN: 'Eritrean Nakfa (ERN)',
    ETB: 'Ethiopian Birr (ETB)',
    EUR: 'Euro (€)',
    FJD: 'Fijian Dollar (FJD)',
    // FIM: 'Finnish Markka (FIM)', // obsolete
    FKP: 'Falkland Islands Pound (FKP)',
    // FRF: 'French Franc (FRF)', // obsolete
    GBP: 'British Pound Sterling (₤)',
    GEL: 'Georgian Lari (GEL)',
    GHS: 'Ghanaian Cedi (GHS)',
    GIP: 'Gibraltar Pound (GIP)',
    GMD: 'Gambian Dalasi (GMD)',
    GNF: 'Guinean Franc (GNF)',
    GTQ: 'Guatemalan Quetzal (GTQ)',
    GYD: 'Guyanaese Dollar (GYD)',
    HKD: 'Hong Kong Dollar (HK$)',
    HNL: 'Honduran Lempira (HNL)',
    HRK: 'Croatian Kuna (HRK)',
    HUF: 'Hungarian Forint (HUF)',
    HTG: 'Haitian Gourde (HTG)',
    IDR: 'Indonesian Rupiah (IDR)',
    // IEP: 'Irish Pound (IEP)', // obsolete
    ILS: 'Israeli New Sheqel (₪)',
    INR: 'Indian Rupee (Rs.)',
    IQD: 'Iraqi Dinar (IQD)',
    IRR: 'Iranian Rial (IRR)',
    ISK: 'Icelandic Króna (ISK)',
    // ITL: 'Italian Lira (ITL)', // obsolete
    JMD: 'Jamaican Dollar (JMD)',
    JOD: 'Jordanian Dinar (JOD)',
    JPY: 'Japanese Yen (¥)',
    KES: 'Kenyan Shilling (KES)',
    KGS: 'Kyrgystani Som (KGS)',
    KHR: 'Cambodian Riel (KHR)',
    KMF: 'Comorian Franc (KMF)',
    KPW: 'North Korean Won (KPW)',
    KRW: 'South Korean Won (₩)',
    KWD: 'Kuwaiti Dinar (KWD)',
    KYD: 'Cayman Islands Dollar (KYD)',
    KZT: 'Kazakhstani Tenge (KZT)',
    LAK: 'Laotian Kip (LAK)',
    LBP: 'Lebanese Pound (LBP)',
    LKR: 'Sri Lankan Rupee (LKR)',
    LRD: 'Liberian Dollar (LRD)',
    LSL: 'Lesotho Loti (LSL)',
    LTL: 'Lithuanian Litas (LTL)',
    // LVL: 'Latvian Lats (LVL)', // obsolete
    LYD: 'Libyan Dinar (LYD)',
    MAD: 'Moroccan Dirham (MAD)',
    MDL: 'Moldovan Leu (MDL)',
    MGA: 'Malagasy Ariary (MGA)',
    MKD: 'Macedonian Denar (MKD)',
    MMK: 'Myanmar Kyat (MMK)',
    MNT: 'Mongolian Tugrik (MNT)',
    MOP: 'Macanese Pataca (MOP)',
    MRO: 'Mauritanian Ouguiya (MRO)',
    MUR: 'Mauritian Rupee (MUR)',
    MVR: 'Maldivian Rufiyaa (MVR)',
    MWK: 'Malawian Kwacha (MWK)',
    MXN: 'Mexican Peso (MX$)',
    MYR: 'Malaysian Ringgit (MYR)',
    MZN: 'Mozambican Metical (MZN)',
    NAD: 'Namibian Dollar (NAD)',
    NGN: 'Nigerian Naira (NGN)',
    NIO: 'Nicaraguan Córdoba (NIO)',
    NOK: 'Norwegian Krone (NOK)',
    NPR: 'Nepalese Rupee (NPR)',
    NZD: 'New Zealand Dollar (NZ$)',
    OMR: 'Omani Rial (OMR)',
    PAB: 'Panamanian Balboa (PAB)',
    PEN: 'Peruvian Nuevo Sol (PEN)',
    PGK: 'Papua New Guinean Kina (PGK)',
    PHP: 'Philippine Peso (Php)',
    PKR: 'Pakistani Rupee (PKR)',
    PLN: 'Polish Zloty (PLN)',
    PYG: 'Paraguayan Guarani (PYG)',
    QAR: 'Qatari Rial (QAR)',
    RON: 'Romanian Leu (RON)',
    RSD: 'Serbian Dinar (RSD)',
    RUB: 'Russian Ruble (RUB)',
    RWF: 'Rwandan Franc (RWF)',
    SAR: 'Saudi Riyal (SAR)',
    SBD: 'Solomon Islands Dollar (SBD)',
    SCR: 'Seychellois Rupee (SCR)',
    SDG: 'Sudanese Pound (SDG)',
    SEK: 'Swedish Krona (SEK)',
    SGD: 'Singapore Dollar (SGD)',
    SHP: 'Saint Helena Pound (SHP)',
    SLL: 'Sierra Leonean Leone (SLL)',
    SOS: 'Somali Shilling (SOS)',
    SRD: 'Surinamese Dollar (SRD)',
    STD: 'São Tomé and Príncipe Dobra (STD)',
    SVC: 'Salvadoran Colón (SVC)',
    SYP: 'Syrian Pound (SYP)',
    SZL: 'Swazi Lilangeni (SZL)',
    // SKK: 'Slovak Koruna (SKK)', // obsolete
    THB: 'Thai Baht (฿)',
    TJS: 'Tajikistani Somoni (TJS)',
    TMT: 'Turkmenistani Manat (TMT)',
    TND: 'Tunisian Dinar (TND)',
    TOP: 'Tongan Paʻanga (TOP)',
    TRY: 'Turkish Lira (TRY)',
    TTD: 'Trinidad and Tobago Dollar (TTD)',
    TWD: 'New Taiwan Dollar (NT$)',
    TZS: 'Tanzanian Shilling (TZS)',
    UAH: 'Ukrainian Hryvnia (UAH)',
    UGX: 'Ugandan Shilling (UGX)',
    USD: 'US Dollar ($)',
    UYU: 'Uruguayan Peso (UYU)',
    UZS: 'Uzbekistan Som (UZS)',
    VEF: 'Venezuelan Bolívar (VEF)',
    VND: 'Vietnamese Dong (₫)',
    VUV: 'Vanuatu Vatu (VUV)',
    WST: 'Samoan Tala (WST)',
    XOF: 'CFA Franc BCEAO (CFA)',
    XCD: 'East Caribbean Dollar (EC$)',
    XDR: 'Special Drawing Rights (XDR)',
    XOF: 'CFA Franc BCEAO (CFA)',
    XPF: 'CFP Franc (CFPF)',
    YER: 'Yemeni Rial (YER)',
    ZAR: 'South African Rand (ZAR)',
    ZMK: 'Zambian Kwacha (ZMK)',

Hope you will find this information useful.

hippasus commented 10 years ago

whoa...bravo!