ForeignRateAPI

API Documentation

Main Base URL

https://api.foreignrateapi.com/

Authentication

Pass your API key either as a query parameter (userId) or in the request header userId.

Query param

https://api.foreignrateapi.com/auto-convert/?userId=APIKEY

Header

fetch("https://api.foreignrateapi.com/auto-convert/", {
  headers: { "userId": APIKEY }
})

API Endpoints

Click any request block to copy it.

Convert Currency

Converts a given amount from one currency to another.

GET/convert

Example Request

https://api.foreignrateapi.com/convert/?userId=APIKEY&from=USD&amount=100&to=JPY

Parameters

NameTypeRequiredDescription
userIdstringYesYour API key
fromstringYesOriginal currency code (e.g., USD)
amountnumberYesAmount to convert
tostringYesTarget currency code (e.g., JPY)

Example Response

{
  "success": true,
  "info": {
    "currencySymbol": "¥",
    "priceTag": "¥15180.35",
    "amount": 15180.35,
    "currencyCode": "JPY"
  }
}

Errors

  • 401 Unauthorized - Invalid API key
  • 400 Bad Request - Missing required parameters
  • 422 Unprocessable Entity - Unsupported currency

Auto Convert Currency

Converts a given currency and amount into the user’s regional currency. If the region cannot be determined, falls back to the "defaultCountry" and its currency.it is advisable to call this in the client side otherwise it may get the region base on the server. If you wish to call the API in the server side, the user's IP should be passed through the query parameter like https://api.foreignrateapi.com/?userIp=IP

GET/auto-convert

Example Request

https://api.foreignrateapi.com/auto-convert/?userId=APIKEY&from=USD&amount=100&defaultCountry=US

Parameters

NameTypeRequiredDescription
userIdstringYesYour API key
fromstringYesOriginal currency code (e.g., USD)
amountnumberYesAmount to convert
defaultCountrystringNoFallback country (e.g., US). This is used if a user region currency is not supported

Example Response

{
  "success": true,
  "info": {
    "currencySymbol": "€",
    "priceTag": "€180",
    "amount": 180,
    "currencyCode": "EUR",
    "currencyName": "Euro"
  }
}

Errors

  • 401 Unauthorized - Invalid API key
  • 400 Bad Request - Missing required parameters
  • 422 Unprocessable Entity - Unsupported currency

Auto Toggle Currency

Works like auto-convert, but lets you define a list of supported currencies to toggle between. The principle it also the same with the /convert

GET/auto-toggle

Example Request

https://api.foreignrateapi.com/auto-toggle/?userId=APIKEY&from=USD&amount=100&between=["EUR","NGN","USD"]

Parameters

NameTypeRequiredDescription
userIdstringYesYour API key
fromstringYesOriginal currency code (e.g., USD)
amountnumberYesAmount to convert
betweenarray<string>YesList of supported currencies

Example Response

{
  "success": true,
  "info": {
    "currencySymbol": "₦",
    "priceTag": "₦150,000",
    "amount": 150000,
    "currencyCode": "NGN",
    "currencyName": "Nigeria Naira"
  }
}

Errors

  • 401 Unauthorized - Invalid API key
  • 400 Bad Request - Missing required parameters
  • 422 Unprocessable Entity - Unsupported currency

List of Supported Currencies

We support over 162 currencies.

United States Dollar (USD)

United Arab Emirates Dirham (AED)

Afghan Afghani (AFN)

Albanian Lek (ALL)

Armenian Dram (AMD)

Netherlands Antillean Guilder (ANG)

Angolan Kwanza (AOA)

Argentine Peso (ARS)

Australian Dollar (AUD)

Aruban Florin (AWG)

Azerbaijani Manat (AZN)

Bosnia and Herzegovina Convertible Mark (BAM)

Barbadian Dollar (BBD)

Bangladeshi Taka (BDT)

Bulgarian Lev (BGN)

Bahraini Dinar (BHD)

Burundian Franc (BIF)

Bermudian Dollar (BMD)

Brunei Dollar (BND)

Bolivian Boliviano (BOB)

Brazilian Real (BRL)

Bahamian Dollar (BSD)

Bhutanese Ngultrum (BTN)

Botswana Pula (BWP)

Belarusian Ruble (BYN)

Belize Dollar (BZD)

Canadian Dollar (CAD)

Congolese Franc (CDF)

Swiss Franc (CHF)

Chilean Peso (CLP)

Chinese Yuan (CNY)

Colombian Peso (COP)

Costa Rican Colón (CRC)

Cuban Peso (CUP)

Cape Verdean Escudo (CVE)

Czech Koruna (CZK)

Djiboutian Franc (DJF)

Danish Krone (DKK)

Dominican Peso (DOP)

Algerian Dinar (DZD)

Egyptian Pound (EGP)

Eritrean Nakfa (ERN)

Ethiopian Birr (ETB)

Euro (EUR)

Fijian Dollar (FJD)

Falkland Islands Pound (FKP)

Faroese Króna (FOK)

British Pound Sterling (GBP)

Georgian Lari (GEL)

Guernsey Pound (GGP)

Ghanaian Cedi (GHS)

Gibraltar Pound (GIP)

Gambian Dalasi (GMD)

Guinean Franc (GNF)

Guatemalan Quetzal (GTQ)

Guyanese Dollar (GYD)

Hong Kong Dollar (HKD)

Honduran Lempira (HNL)

Croatian Kuna (HRK)

Haitian Gourde (HTG)

Hungarian Forint (HUF)

Indonesian Rupiah (IDR)

Israeli Shekel (ILS)

Isle of Man Pound (IMP)

Indian Rupee (INR)

Iraqi Dinar (IQD)

Iranian Rial (IRR)

Icelandic Króna (ISK)

Jersey Pound (JEP)

Jamaican Dollar (JMD)

Jordanian Dinar (JOD)

Japanese Yen (JPY)

Kenyan Shilling (KES)

Kyrgyzstani Som (KGS)

Cambodian Riel (KHR)

Kiribati Dollar (KID)

Comorian Franc (KMF)

South Korean Won (KRW)

Kuwaiti Dinar (KWD)

Cayman Islands Dollar (KYD)

Kazakhstani Tenge (KZT)

Lao Kip (LAK)

Lebanese Pound (LBP)

Sri Lankan Rupee (LKR)

Liberian Dollar (LRD)

Lesotho Loti (LSL)

Libyan Dinar (LYD)

Moroccan Dirham (MAD)

Moldovan Leu (MDL)

Malagasy Ariary (MGA)

Macedonian Denar (MKD)

Myanmar Kyat (MMK)

Mongolian Tögrög (MNT)

Macanese Pataca (MOP)

Mauritanian Ouguiya (MRU)

Mauritian Rupee (MUR)

Maldivian Rufiyaa (MVR)

Malawian Kwacha (MWK)

Mexican Peso (MXN)

Malaysian Ringgit (MYR)

Mozambican Metical (MZN)

Namibian Dollar (NAD)

Nigerian Naira (NGN)

Nicaraguan Córdoba (NIO)

Norwegian Krone (NOK)

Nepalese Rupee (NPR)

New Zealand Dollar (NZD)

Omani Rial (OMR)

Peruvian Sol (PEN)

Papua New Guinean Kina (PGK)

Philippine Peso (PHP)

Pakistani Rupee (PKR)

Polish Zloty (PLN)

Paraguayan Guaraní (PYG)

Qatari Riyal (QAR)

Romanian Leu (RON)

Serbian Dinar (RSD)

Russian Ruble (RUB)

Rwandan Franc (RWF)

Saudi Riyal (SAR)

Solomon Islands Dollar (SBD)

Seychellois Rupee (SCR)

Sudanese Pound (SDG)

Swedish Krona (SEK)

Singapore Dollar (SGD)

Saint Helena Pound (SHP)

Sierra Leonean Leone (SLE)

Sierra Leonean Old Leone (SLL)

Somali Shilling (SOS)

Surinamese Dollar (SRD)

South Sudanese Pound (SSP)

São Tomé and Príncipe Dobra (STN)

Syrian Pound (SYP)

Eswatini Lilangeni (SZL)

Thai Baht (THB)

Tajikistani Somoni (TJS)

Turkmenistani Manat (TMT)

Tunisian Dinar (TND)

Tongan Paʻanga (TOP)

Turkish Lira (TRY)

Trinidad and Tobago Dollar (TTD)

Tuvaluan Dollar (TVD)

New Taiwan Dollar (TWD)

Tanzanian Shilling (TZS)

Ukrainian Hryvnia (UAH)

Ugandan Shilling (UGX)

Uruguayan Peso (UYU)

Uzbekistani Soʻm (UZS)

Venezuelan Bolívar (VES)

Vietnamese Dong (VND)

Vanuatu Vatu (VUV)

Samoan Tala (WST)

Central African CFA Franc (XAF)

East Caribbean Dollar (XCD)

Caribbean Guilder (XCG)

IMF Special Drawing Rights (XDR)

West African CFA Franc (XOF)

CFP Franc (XPF)

Yemeni Rial (YER)

South African Rand (ZAR)

Zambian Kwacha (ZMW)

Zimbabwean Dollar (ZWL)