INDEX
- Get Started
- API Credit System
- Parameters
- Supported Symbols
- Currency Profile Information
- Forex Rate Conversion API
- Latest Price API
- Last Candle Prices
- Base Currency
- Currency Cross
- Historical Price API
- Forex Pivot Points API
- Moving Averages API
- Forex Technical Indicator
- Economy Calendar
- Search
- Multi URL at Once
- Disclaimer
FOREX API Documentation
ForexRatesAPI provides comprehensive currency exchange data across 145+ countries and 2000+ forex currency combinations. Powered by 25+ verified data sources, the API delivers real-time and historical currency pricing through multiple specialized endpoints.
Our flexible API architecture allows precise querying of specific currency pairs or broad market analysis, supporting traders, financial analysts, and application developers who require accurate, timely foreign exchange information.
Each endpoint is designed to provide granular, actionable currency market data with minimal latency and maximum reliability.
Get Started
ForexRatesAPI is designed to quickly access tools. Use any programming language to hit on API URL, you will get a response in standard JSON format.
Use Javascript (Ajax), PHP (Curl or file_get_content), Java OR android (HttpURLConnection), C# (httpWebRequest) or CURL from command line
Sample API:
https://forexratesapi.com/api/v1/forex/latest?id=1&access_key=API_KEY
API Credit System
Our Basic Plan provides 10,000 monthly API requests with a nuanced credit allocation model. While most endpoints charge 1 credit per URL request, three specialized endpoints calculate credits differently: 1 credit per 100 records returned.
- Only Latest Price, Candle, and Profile APIs count 1 credit per 100 records returned
- Credits are counted only for successful requests with {200} response codes containing data
- No credits deducted for error responses or empty API returns
Parameters
Supported Symbols
ForexRatesAPI provides continuously updated, accurate data for all major and minor currencies, ensuring you have the most current exchange rates at your fingertips.
Accepted Parameters:
type =forex
access_key=API_KEY
API:
https://forexratesapi.com/api/v1/forex/list?type=forex&access_key=API_KEY
Response:
{
"id": 1,
"name": "Euro US Dollar",
"symbol": "EUR/USD",
"decimal": 4
},
{
"id": 2,
"name": "Euro Swiss Franc",
"symbol": "EUR/CHF",
"decimal": 4
},
{2000+ More Forex Currencies},
Currency Profile Information
With ForexRatesAPI, get details for each currency, including its name, associated country, central bank, currency unit, note types, and more.
Accepted Parameters:
id={any valid ID}
symbol={any valid short name}
access_key=API_KEY
Profile by ID's'
https://forexratesapi.com/api/v1/forex/profile?id=1,2,3,4&access_key=API_KEY
By Symbol Combination:
https://forexratesapi.com/api/v1/forex/profile?symbol=EUR/USD,GBP/CHF&access_key=API_KEY
By Currency Short Name:
https://forexratesapi.com/api/v1/forex/profile?symbol=USD&access_key=API_KEY
Response:
{ //Forex Currency Profile
"short_name" : "CHF",
"name" : "Swiss Franc",
"country" : "Switzerland",
"code_n" : "756",
"subunit" : "Rappen",
"website" : "snb.ch",
"symbol" : "Fr., CHf, SFr.",
"bank" : "Swiss National Bank",
"banknotes" : "10 francs, 20 francs, 50 francs, 200 francs, 1000 francs, 100 francs",
"coins" : "5 francs, 10 centimes, 2 francs, 1/2 francs, 20 centimes, 1 francs, 5 centimes",
"icon" : "https://fcsapi.com/assets/images/flags/chf.svg",
"type" : "forex",
}, {and more}
Forex Rate Conversion API
Currency conversion is a key feature in any Currency API, allowing you to convert between two specified currencies.
To perform a conversion, simply attach the currency symbols and the amount to convert to your desired currency.
Accepted Parameters:
pair1 = EUR & pair2 = USD (Use both at a time) OR
symbol = EUR/USD
amount = 200
access_key = API_KEY
Currency Converter API example:
https://forexratesapi.com/api/v1/forex/converter?symbol=EUR/USD&amount=200&access_key=API_KEY
Converter API example 2:
https://forexratesapi.com/api/v1/forex/converter?pair1=EUR&pair2=USD&amount=200&access_key=API_KEY
Response:
{
"price_1x_EUR": "1.0212418", // 1 EUR = USD
"price_1x_USD": "0.9792", // 1 USD = EUR
"total": "195.84" // Total Price x amount (Amount * 1 USD) = Total (USD)
},
Eligibility :
Latest Price API
ForexRatesAPI allows you to retrieve one or more latest currency prices simultaneously by sending a request with the symbols parameter, using comma-separated currency codes.
Accepted Parameters:
id = {Any valid FX ID}
symbol = {Any valid FX symbol}
access_key = API_KEY
Price of one symbol:
https://forexratesapi.com/api/v1/forex/latest?id=1&access_key=API_KEY
All Prices at once:
(return all latest prices of forex currencies)
https://forexratesapi.com/api/v1/forex/latest?symbol=all_forex&access_key=API_KEY
Multiple prices by ids:
https://forexratesapi.com/api/v1/forex/latest?id=1,2,3,4&access_key=API_KEY
Multiple prices by name:
https://forexratesapi.com/api/v1/forex/latest?symbol=EUR/USD,USD/JPY,GBP/CHF&access_key=API_KEY
Response:
{
"s": "USD/EUR", // Symbol
"o": "1.18000", // Open
"h": "1.18038", // High
"l": "1.17972", // Low
"c": "1.18027", // Price/Close, Current price
"a": "1.18038", // Ask
"b": "1.18016", // Bid
"sp": "2.2", // Spread
"ch": "+0.0002", // Change in 1 day candle
"cp: "+0.02%, // Change in percentage
"t": "1596575732", // When update last time Time Unix Format (UTC)
"tm": "2020-08-04 21:15:03" // When update last time (UTC)
},
{
"s": "USD/JPY", // Symbol
"o": "105.71", // Open
"h": "105.760", // High
"l": "105.725", // Low
"c": "105.747", // Price/Close, Current price
"a": "105.758", // Ask
"b": "105.725", // Bid
"sp": "3.3", // Spread
"ch": "+0.03", // Change in 1 day candle
"cp: "+0.03%", // Change in percentage
"t": "1596575700", // When update last time Time Unix Format (UTC)
"tm": "2020-08-04 21:15:00" // When update last time (UTC)
},
{and more}
Last Candle Prices (Support Time Frame)
Our Last Candle Price API provides users with the most recent OHLC (Open, High, Low, Close) data for currencies.
You can retrieve single or multiple candle prices simultaneously by appending the symbols parameter to your API request, followed by one or more comma-separated currency codes.
Accepted Parameters:
id = {Any FX ID}
symbol = {Any supported FX symbol}
period = {Any supported time period} (all except 1m and 2h)
access_key = API_KEY
candle = {valid values : active, close, both} default: both,
Candle API by ID:
https://forexratesapi.com/api/v1/forex/candle?id=1&period=1h&access_key=API_KEY
https://forexratesapi.com/api/v1/forex/candle?id=1&period=1h&access_key=API_KEY&candle=active
https://forexratesapi.com/api/v1/forex/candle?id=1,2,3,4&period=1h&access_key=API_KEY
Candle API by Symbol Name:
https://forexratesapi.com/api/v1/forex/candle?symbol=EUR/USD&period=1h&access_key=API_KEY
https://forexratesapi.com/api/v1/forex/candle?symbol=EUR/USD,USD/JPY,GBP/CHF&period=1h&access_key=API_KEY
All Prices at once: (return all latest prices of forex currencies)
https://forexratesapi.com/api/v1/forex/candle?symbol=all_forex&period=1h&access_key=API_KEY
Response:
Candle API returns the last two candles for each currency and time period. For the latest price, use the “Latest Price” API. To access additional historical candles, use the Forex Historical API.
{
"s": "USD/EUR", // Symbol
"o": "3.672241", // Open
"h": "3.691708", // High
"l": "3.654802", // Low
"c": "3.673337", // Price/Close
"a": "3.674465", // Ask
"b": "3.671711", // Bid
"sp": "4.00", // Spread
"ch": "0.001096", // Change in 1 day candle
"cp: "0.03%", // Change in percentage
"t": "1583238500", // When candle time Unix Format (UTC)
"tm": "2020-03-03 12:00:00" // When Candle time (UTC)
"up": "2020-03-03 12:29:03" // When last update time (UTC)
},
{and more}
Base Currency
Based on a single base currency, the API returns quote prices for all available currencies.
Accepted Parameters:
symbol = {Any FX/Crypto currency symbol} e.g: EUR,USD, JPY etc
access_key = API_KEY
type = {forex OR crypto} => default: forex
Candle API by ID:
https://forexratesapi.com/api/v1/forex/base_latest?symbol=USD&type=forex&access_key=API_KEY
https://forexratesapi.com/api/v1/forex/base_latest?symbol=USD&type=forex&access_key=API_KEY&time=1
Response:
Retrieve currency quotes for Forex or Crypto based on the value specified in the “type” parameter.
{
"AED":"4.0637",
"AUD":"1.6511",
"CNH":"7.7612568",
"CAD":"1.4647722",
"CHF":"1.0668943"
"TRY":"6.6214",
"USD":"1.1063171",
"XAU":"0.0007008"
{and more...}
},
Currency Cross
Retrieve all currency pairs related to a specified currency. For example, entering “USD” as the parameter will return pairs like EUR/USD, JPY/USD, GBP/USD, PKR/USD, etc.
Note: The Last Forex Cross API supports only valid IDs or names from our FX list. It may be less accurate than the Latest or Historical APIs. For precise pricing, use the Latest, Base, or Historical API.
Accepted Parameters:
symbol = {Any currency symbol} e.g: EUR,USD, JPY etc
period = {any valid time period} (except 1m and 2h)
access_key = API_KEY
candle = {valid values : active, close, both} default: both,
Candle API by ID:
https://forexratesapi.com/api/v1/forex/cross?symbol=USD&period=1d&access_key=API_KEY
https://forexratesapi.com/api/v1/forex/cross?symbol=USD&period=1d&access_key=API_KEY&candle=close
Response:
{
"s": "USD/EUR", // Symbol
"o": "3.672241", // Open
"h": "3.691708", // High
"l": "3.654802", // Low
"c": "3.673337", // Price/Close
"a": "3.674465", // Ask
"b": "3.671711", // Bid
"ch": "0.001096", // Change in 1 day candle
"cp: "0.03%", // Change in percentage
"t": "1583238543", // When update last time Time Unix Format (UTC)
"tm": "2020-03-03 12:29:03" // When update last time (UTC)
},
{
"s": "USD/AFN",
"o": "75.368552",
"h": "75.990915",
"l": "75.239334",
"c": "75.615878",
"a": "75.736746",
"b": "75.486642",
"ch": "0.247326",
"cp: "0.33%",
"t": "1583238543",
"tm": "2020-03-03 12:29:03"
},
{and more}
Historical Price API
ForexRatesAPI provides historical exchange rate data for all supported symbols, enabling market comparisons with previous rates. Historical data is available from 1995 for time frames of 1 day or more, and up to 6 months for shorter time frames (e.g., 1m, 5m).
To access historical rates, append a date (YYYY-MM-DD format) to the base URL and specify the desired period: {1m, 5m, 30m, 1h, 2h, 4h, 5h, 1d, 1w, month}.
Accepted Parameters:
id = {Any valid FX ID}
symbol = {Any valid Fx symbol}
period = {TimeFrame period} {1m,5m,15m,30m,1h,2h,4h,5h,1d,1w,month}
from = {Date from} & To = {date to} (Use both at a time or ignore both for latest history)
level = 1 {values, 1,2,3}, {1: return 300 candles, 2: return 600 candles, 3: return 900 candles}
access_key = API_KEY
This API does not support multiple IDs in the URL as a parameter. Only one ID or symbol name can be sent per request. Additionally, the 2h and 4h time frames return a maximum of 300 candles per request.
Quick Latest 900 Candles History
Our Latest Historical API offers a simple way to access the most recent 900 candles, providing a clear view of the latest market trends. Use the “Level” parameter to control the number of candles returned:
level=1
: 300 candleslevel=2
: 600 candleslevel=3
: 900 candles
Return Latest 300 candles
https://forexratesapi.com/api/v1/forex/history?id=1&period=1h&access_key=API_KEY
Return Latest 900 candles
https://forexratesapi.com/api/v1/forex/history?id=1&period=1h&access_key=API_KEY&level=3
Get history by Symbol
https://forexratesapi.com/api/v1/forex/history?symbol=EUR/USD&period=1h&access_key=API_KEY
History Between Specific Date {YYYY-MM-DD}
Retrieve historical exchange rates for a specific period by specifying a currency pair (e.g., EUR/USD) and using “FROM” and “TO” parameters for the start and end dates.
https://forexratesapi.com/api/v1/forex/history
?symbol=EUR/USD
&period=1d
&from=2024-02-01 OR 1706745600 // Unix format
&to=2024-08-27 OR 1724716800
&access_key=API_KEY
For the latest history of up to 900 candles, omit the “FROM” and “TO” parameters from the URL. Including them may slow down the response time.
Or Between Specific Date-Time
https://forexratesapi.com/api/v1/forex/history?symbol=EUR/USD&period=1d&from=2024-02-01T12:00&to=2024-08-27T12:00&access_key=API_KEY
Response:
{
"o": "0.9765", // Open
"h": "0.9806", // High
"l": "0.9765", // Low
"c": "0.9792", // Close
"t": 1665712800000, // Time Unix Format (UTC)
"tm": "2022-10-14 02:00:00" // Date Time (UTC)
},
{and 900 more historical candles}
Note: For the latest 900 historical candles, do not use the “From/To” parameters, as this will result in faster response times.
Forex Pivot Points API
In financial markets, a pivot point serves as a key support or resistance level, helping traders forecast market movement. It is calculated as the average of the high, low, and close prices from the previous trading period.
Our pivot points, along with resistance and support levels, are derived from the prior high, open, and close prices.
Accepted Parameters:
id = {Any valid ID}
symbol = {Any valid symbol}
period = {any valid supported time frames}
access_key = API_KEY
Pivot Point API:
https://forexratesapi.com/api/v1/forex/pivot_points?id=2&period=1d&access_key=API_KEY
https://forexratesapi.com/api/v1/forex/pivot_points?symbol=JPY/CHF&period=1d&access_key=API_KEY
Response:
The Pivot Point response includes the latest pivot point, plus 3 resistance and 3 support levels for the selected time period.
{
"oa_summary": "Strong Buy", // Overall Summary Buy/Sell based on Moving Avg and Technical Indicators
"pivot_point": {
"Classic": {
"pp": "1.260046", // Pivot Points
"R1": "0.933058", // Resistance 1
"R2": "0.806942", // Resistance 2
"R3": "0.719172", // Resistance 3
"S1": "0.933014", // Support 1
"S2": "0.806912", // Support 2
"S3": "0.719105" // Support 3
},
{ "Fibonacci": {...} },
{ "Camarilla": {...} },
{ "Woodies": {...} },
{ "Demarks": {...} } // High /Low
}
}
Moving Averages (MA Lines) API
Moving Average (MA) API provides SMA and EMA values for the latest active candle based on specified periods (e.g., 5, 10, 20, 50, 100, 200). Simply specify the period in minutes or days to get the values for your desired timeframe.
Accepted Parameters:
id = {Any valid FX ID}
symbol = {Any valid FX symbol}
period = {any valid supported time frames}
access_key = API_KEY
SMA/EMA API:
https://forexratesapi.com/api/v1/forex/ma_avg?id=2&period=1d&access_key=API_KEY
https://forexratesapi.com/api/v1/forex/ma_avg?symbol=JPY/CHF&period=1d&access_key=API_KEY
Response:
The response includes the latest candle’s SMA, EMA, and Buy/Sell signals.
{
"oa_summary": "Strong Buy",
// OverAll Summary Buy/Sell based on Moving Avg and Technical Indicators
"count": { "Total_Buy": "8", "Total_Sell": "3", "Total_Neutral": "1" },
// Count Total Buys, Sells and Neutral
"ma_avg": {
"SMA": { // Simple Moving Averages
// v=Value, s=Signal
"MA5": { "v": 0.8600, "s": "Buy" }, // Based on 5 candles SMA
"MA10": { "v": 0.8800, "s": "Buy" }, // Based on 10 candles SMA
"MA20": { "v": 0.7952, "s": "Sell" }, // Based on 20 candles SMA
"MA50": { "v": 0.7976, "s": "Buy" },
"MA100": { "v": 0.6894, "s": "Buy" },
"MA200": { "v": 0.6580, "s": "Neutral" }
},
"EMA": { // Exponential Moving Averages
"MA5": { "v": 0.8600, "s": "Buy" }, // Based on 5 candles EMA
"MA10": { "v": 0.8800, "s": "Buy" }, // Based on 10 candles EMA
"MA20": { "v": 0.7952, "s": "Sell" }, // Based on 20 candles EMA
"MA50": { "v": 0.7976, "s": "Buy" },
"MA100": { "v": 0.6894, "s": "Buy" },
"MA200": { "v": 0.6580, "s": "Sell" }
},
"summary": "Buy" // Buy/Sell judgment only based on Moving Avg
}
}
Forex Technical Indicator
Our API provides real-time values for top forex technical indicators (MA, RSI, STOCH, ATR, etc.), essential for developing profitable trading strategies. The response includes the latest indicator values, derived from the most current data points of the specified currency pair.
Accepted Parameters:
id = {Any valid FX ID}
symbol = {Any valid FX symbol}
period = {any valid supported time frames}
access_key = API_KEY
Forex Indicator API:
https://forexratesapi.com/api/v1/forex/indicators?id=2&period=1d&access_key=API_KEY
https://forexratesapi.com/api/v1/forex/indicators?symbol=JPY/CHF&period=1d&access_key=API_KEY
Response:
{
"oa_summary": "Strong Buy",
// OverAll Summary Buy/Sell based on Moving Avg and Technical Indicators
"count": { "Total_Buy": "6" , "Total_Sell": "1", "Total_Neutral": "1" },
// Count Total Buys, Sells and Neutral
"indicators": {
"RSI": { "v": 57.823, "s": "Buy" }, // RSI (14)
"STOCH": { "v": 76.209, "s": "Buy" }, // Stochastic (9,6)
"STOCHRSI": { "v": 81.306, "s": "Overbought" }, // STOCH (14,6) + RSI(14)
"MACD": { "v": "0.001", "s": "Buy" }, // MACD (12,26)
"Williams": { "v": -19.355, "s": "Overbought" }, // Williams %R
"CCI": { "v": 105.315, "s": "Buy" }, // CCI (14)
"ATR": { "v": 0.0007 , "s": "Less Volatility" }, // ATR (14)
"UO": { "v": 65.45, "s": "Buy" }, // Ultimate Oscillator
"ROC": { "v": 0.142, "s": "Buy" }, // ROC
"summary": "Strong Buy" // Buy/Sell judgment only based on above Indicators
}
}
Economy Calendar
Get real-time indicator values with past, forecast, and actual figures as economic events impact global markets.
Accepted Parameters:
symbol = {Any valid currency} e.g: USD,EUR,JPY
country = {Any valid country} e.g: US,JP,GB
from = {date from} e.g: 2024-08-28
to = {date to} e.g: 2024-08-29
access_key = API_KEY
To get all history of event
event = {Any valid event name}
Get All Event Today date:
https://forexratesapi.com/api/v1/forex/economy_cal?access_key=API_KEY
Get All Event Specific date:
https://forexratesapi.com/api/v1/forex/economy_cal?from=2024-08-28&to=2024-08-29&access_key=API_KEY
Get by Currency Today:
https://forexratesapi.com/api/v1/forex/economy_cal?symbol=USD,JPY&access_key=API_KEY
Get by Country Today:
https://forexratesapi.com/api/v1/forex/economy_cal?country=US,GB&access_key=API_KEY
Get by Currency Today:
https://forexratesapi.com/api/v1/forex/economy_cal?event=USBCOI&from=2024-07-29&to=2024-08-29&access_key=API_KEY
Response:
{
"event": USBCOI, // use this value to get event history
"title": ISM Manufacturing PMI,
"indicator": "Business Confidence",
"country": "US",
"currency": "USD",
"importance": "2", // 0 = 1 Star, 1=2 Stars, 2 = 3 stars
"period": "Feb",
"actual": "58.6", // Actual value
"forecast": "58", // Forecast value
"previous": "57.6", // Previous value
"scale": "K", // value scale, K thousand, M Million, B Billion
"source": "Institute for Supply Management"
"unit": "Index",
"comment": "Short details about event",
"date": "2022-03-01 15:00:00"
},
Search
This API is like website search. You can search all currency with similar name. It will search in currency full name and short name. Response Return upto 20 result.
Accepted Parameters:
s = {Any words to search} e.g: EURO Dollar
strict = {values 0,1} {0: search if any word exist, 1: search if all words exist}
type = {values : forex/crypto, default:both}
access_key = API_KEY
Search API:
https://forexratesapi.com/api/v1/forex/search?s=EURO Dollar&access_key=API_KEY
https://forexratesapi.com/api/v1/forex/search?s=EURO Dollar&strict=1&access_key=API_KEY
Response:
{
"id": 1,
"name": "Euro US Dollar", // EURO and Dollar match
"symbol": "EUR/USD",
"decimal": 4
},
{
"id": 2,
"name": "Euro New Zealand Dollar", // EURO and Dollar match
"symbol": "EUR/NZD",
"decimal": 4
},
{upto 30 Results},
Multiple URL at Once
When using multiple API endpoints simultaneously, it can be time-consuming. Instead of sending separate requests, use this API to get all results in a fraction of the time. For example, if 10 APIs take 2 seconds each, this API returns all 10 results in just 2 seconds.
Accepted Parameters:
base = base url e.g: https://forexratesapi.com/
url[] = enter 1st API url from where you want to get response
url[] = enter 2nd API url
url[] = enter nth API url
access_key = API_KEY
and its support all parametrs that used in any API
Example 1:
https://forexratesapi.com/api/v1/forex/multi_url?
url[1]=api/v1/forex/history?id=1
&url[2]=api/v1/forex/history?id=2
&access_key=API_KEY
Example 2 with Base:
https://forexratesapi.com/api/v1/forex/multi_url?
url[1]=https://forexratesapi.com/api/v1/forex/history?id=1
&url[2]=https://forexratesapi.com/api/v1/forex/history?id=2
&access_key=API_KEY
Example 3: (multiple parameters for all URL)
https://forexratesapi.com/api/v1/forex/multi_url?
base=api/v1/forex/history?symbol=
&url[history_1]=EUR/USD
&url[history_2]=JPY/AUD
&access_key=API_KEY
https://forexratesapi.com/api/v1/forex/multi_url?
base=api/v1/forex/
&url[candle]=candle?symbol=EUR/USD&period=1h
&url[history]=history?symbol=EUR/USD&period=1h
&url[profile]=profile?symbol=EUR/USD&period=1h
&url[tech]=indicators?symbol=EUR/USD&period=1h
&access_key=API_KEY
Example 3: (Simple) (Also support POST format)
https://forexratesapi.com/api/v1/forex/multi_url?
base=api-v3/forex/
&url[candle]=candle
&url[history]=history
&url[profile]=profile
&url[tech]=indicators
&symbol=EUR/USD&period=1h
&access_key=API_KEY
Response:
{
"latest": {same output response of Latest API},
"history_1": {same output response of History API with ID 1},
"history_2": {same output response of History API with ID 2},
}
Disclaimer
ForexRatesAPI’s Trend/Signals API is designed to help investors analyze current and historical market trends before making forex investment decisions. Our Buy/Sell signals and indicators are calculated using the last 300 candles within a specified time period, providing you with accurate insights to guide your trading strategies.