Forex API Documentation

FCS API

Powered by 25+ currency exchange rate data sources, the FCS delivering real-time 145+ country and 2000+ forex currencies combination prices rates. The FCS provides different API endpoints, each serving a different data response. We provides the latest FX price for all or a specific pair of currency, retrieving historical currency data for one or multiple currencies, technical indicators for market analyzing from 5min to 1 month.

In this document, you will learn how to use API with its parameters, potential unwanted errors and some code examples. After this document, if you face difficulty to understand API structure, you can contact us any time and our team will be happy to help out.

Get Started

For those users who are demanding different tools related to the Forex API. FCS API has been designed and manipulates for the user to access tools quickly and troubleshoot their problems through this Forex API documentation. We have such capability to deliver the exchange rate data which is taking place in real-time for 145+ currencies of the world.
For developer, you can work in any programming language to hit on API URL. Use PHP (Curl or file_get_content), JavaScript (Ajax), Android (HttpURLConnection) or JAVA, C# (HttpWebRequest) or CURL for this. And finally, the users will be able to get a response in the format of standard JSON. Multiple endpoints are the source to get an API and they all serve different use cases. The function of the endpoint is to get the latest market exchange rate data that apply to all or a specific set of currencies.

API Access Key
You need an access key in order to access our database. Your access Key is the unique key that is passed into the API base URL's access_key parameter in order to authenticate with the FCS API.

Note: Maximum 10 API requests allow/minute. Please use multiple ids in the API URL to reduce API requests. Our purpose is not to restrict you to access our service, but we want to manage our server from extra hits. Your IP will block for 1 minute if you reached maximum allowed limit. If you need more Request/minute please contact us.

Sample API:

https://fcsapi.com/api/forex/latest?id=1&access_key=API_KEY
Sign up for a free using the button below to use the our Quick start tool.
Signup

Parameters

Parameters Details
ID You needs to set Forex-ID in URL parameters get a response from a specific Forex API.
Default: none. Values: 1,2,3... etc,
To get all list of Forex ID's or Symbols use "List API" below.
Symbol Our Symbol is pair of 2 currencies, or "short name" combination of 2 currencies. You can used it to get specific Forex data from our database through a specific symbol or their short names.
Default: none
Values: EUR/USD,USD/JPY,GBP/NZD etc,

Note: At least one "id" or "symbol" parameter is required. If ID parameter exist in URL than symbol parameter will be ignored. You can use any 1 parameter (ID or Symbol) both will return same result.
Period It is required in a few API requests, when you request for candle prices, history, signals, moving average lines, pivot points. So you need to specify which time frames data you want.

Default: 1h
Valid Values: 5m, 15m, 30m,1h, 5h, 1d, 1w, month
OR Alternate: 5, 15, 30,60, 300, 1440, 10080, 43200
From
(Optional)
When you access history API and you are looking for any historical data from a specific date, you need to specify date between from/to date by using (from,to) parameter

Default: none
Format: YYYY-MM-DD E.g: 2018-01-01
OR YYYY-MM-DDTHour:Min E.g: 2018-01-01T12:30
To
(Optional)
When you access forex history API, It is required with "From" Parameter.

Default: none
Format: YYYY-MM-DD E.g: 2018-01-31
OR YYYY-MM-DDTHour:Min E.g: 2018-01-31T12:30

Note: When you not set FROM and TO parameters, then it will return latest 300 candles.

What is T in date format!!! It is nothing, we use it to remove space between time. It has no use and no validation.
Type
(Optional)
Only used in "List API", when you want a specific type of symbols Forex/Crypto currency
Default: both Values: Forex, Crypto or both
Output
(Optional)
Set your API response format.
Default: JSON
Valid Values: JSON, JSONP, object, XML, serialize and array

Supported Symbols List

You can get all the list of supported currencies short names by below API. You can use symbol name to get indicator values,historical and real-time rates. We made it easy for you to search and get all the supported currencies names list. We provide you a constantly updated forex API endpoint showing all the forex currencies API which is available in real-time.

Accepted Parameters:
type = forex
top_symbol = 0 OR 1
access_key=API_KEY

API:

Return All symbols, You need to use these symbols in Latest Price API, Price conversation, Historical and for Technical signals.

https://fcsapi.com/api/forex/list?type=forex&access_key=API_KEY
Forex Top Currencies List:

If the value of top_symbol=1, It will return a list of popular currencies. "latest candle" API only accepts top currencies ids. If top_symbol=0 it will return all currencies.

https://fcsapi.com/api/forex/list?type=forex&top_symbol=1&access_key=API_KEY
Response:

After you request on API, It would give you the response in JSON format which you can change, it is up to your need. Moreover, We have characterized our FCS API response in the form of different index keys (id, name, symbol, and decimals) concerning the different popular currencies which you can use according to your requirements.

{ 
  "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},

Forex Currency Profile Details

In our API, You can get all the details about Forex currencies. Details like its name, country name, bank name, currency unit, type of notes and more details.


Accepted Parameters:
id={any valid ID}
symbol={any valid short name}
access_key=API_KEY

By profile API, you can get the profiles of the different currencies by passing their IDs, Symbols or Single currency short name in URL to get a response.

Profile by ID's'
https://fcsapi.com/api/forex/profile?id=1,2,3,4&access_key=API_KEY
By Symbol Combination:
https://fcsapi.com/api/forex/profile?symbol=CHF/USD,USD/JPY,BTC/USD&access_key=API_KEY
By Currency Short Name:
https://fcsapi.com/api/forex/profile?symbol=CHF,USD,JPY,GBP,NZD,BTC,XRP&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}

Currency Converter

In any Forex API, currency conversion is the most common and a popular part, through which we can get price conversion between two different specified currencies. To do so, you just simply have to attach the symbols parameter with amount to convert it into your required currency.

Note: Below API does not support multiple symbols name in URL as a parameter. Send only one ID/Symbol name at a time with the request.

Accepted Parameters :
pair1 = EUR & pair2 = USD (Use both at a time) OR
symbol = EUR/USD
amount = 200
access_key = API_KEY

Note: Forex currency converter also support all crypto currencies ids.

Forex Converter by ID:
https://fcsapi.com/api/forex/converter?id=1&amount=200&access_key=API_KEY
Currency Converter API example 2:
https://fcsapi.com/api/forex/converter?symbol=EUR/USD&amount=200&access_key=API_KEY
Converter API example 3:
https://fcsapi.com/api/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)
},

Currency Latest Price

Forex latest price API is very useful, you must have to get in touch with the updated price of a currency That's why the latest prices are included in any API which is the most common part. We provide one or multiple currency prices at the same time, To do so, you just have to send the request with symbols parameter in API request and set it to one or more comma-separated codes of a currency.
Note: We update the prices of each currency in every 30 seconds or less.

Accepted Parameters :
id = {Any valid FX ID}
symbol = {Any valid FX symbol}
access_key = API_KEY

Price of one symbol:
https://fcsapi.com/api/forex/latest?id=1&access_key=API_KEY
Multiple prices by ids:
https://fcsapi.com/api/forex/latest?id=1,2,3,4,5,6&access_key=API_KEY
Multiple prices by name:
https://fcsapi.com/api/forex/latest?symbol=EUR/USD,USD/JPY,GBP/CHF&access_key=API_KEY
Response:
{ 
  "symbol""EUR/USD",
  "price""1.1192", // Price
  "change""0.0042", // Change in 1 day candle
  "change_per"2.1%", // Change in percentage
  "last_changed""2019-08-01 12:30:00" // When update last time
},
{

  "symbol""USD/JPY",
  "price""106.04",
  "change""-0.22",
  "change_per"-0.21%",
  "last_changed""2019-08-01 12:30:00"
},
{
and more}

Last Candle Prices (Open,High,Low,Close)

We provide the last candle price of a currency to our users and it is also the useful part of API. Here, you can get single or multiples candle prices at the same time. To get the candle OHLC prices, you just have to append the symbols parameter with the URL request, and append single or multiple comma-separated currency codes.
Note : Last Forex Candle API only support ID/Symbols of Popular currencies list as described above in the "All Symbols List" Section.

Accepted Parameters :
id = {Any popular FX ID}
symbol = {Any popular FX symbol}
period = {Chart time period}
access_key = API_KEY

Candle API by ID:
https://fcsapi.com/api/forex/candle?id=1&period=1h&access_key=API_KEY
https://fcsapi.com/api/forex/candle?id=1,2,3,4&period=1h&access_key=API_KEY
Candle API by Symbol Name:
https://fcsapi.com/api/forex/candle?symbol=EUR/USD&period=1h&access_key=API_KEY
https://fcsapi.com/api/forex/candle?symbol=EUR/USD,USD/JPY,GBP/USD&period=1h&access_key=API_KEY
Response:

The candle response only returns 1 last candle of each single currency and time period from the chart. If you want only latest price (without open/high/low), Please use "Latest Price" API, If you need more previous candles please use Forex Historical API.

{ 
  "symbol""EUR/USD", // 1 Hour Candle
  "candle": {
     "o""0.9765", // Open
     "h""0.9806", // High
     "l""0.9765", // Low
     "c""0.9792", // Close
     "t"1665712800000, // Unix Time (UTC) (Candle Time)
     "tm""2022-10-14 02:00:00" // Date Time (UTC) (Candle Time)
  }
},
{

  "symbol""JPY/CHF",
  "candle": {
     "o""147.36",
     "h""147.45",
     "l""147.09",
     "c""147.31",
     "t"1665712800000,
     "tm""2022-10-14 02:00:00"
  }
},
{
and more}

FX Historical Price API

You want to know about the historical exchange prices to compare the latest exchange price with the previous rates to watch the market. In our forex history API we provide the historical exchange price data for all supported symbols. Old prices are available for most symbols all the way back to the year of 1995. You can see the historical rates by appending a date (format YYYY-MM-DD) in API URL with the base URL and specify the period parameter values: {5m, 30m, 1h, 5h, 1d, 1w, month}

Accepted Parameters :
id = {Any valid FX ID}
symbol = {Any valid Fx symbol}
period = {TimeFrame period}
from = {Date from} & To = {date to} (Use both at a time or ignore both for latest)
access_key = API_KEY

If you always need the latest history candles, then you must have to take care of From/To parameter, that should not be assigned and remove them from URL, Then it will work better.
Note: Below API does not support multiple IDs in URL as a Parameter. You have to send only one ID or Symbol name at a time with the request.

Quick Latest 300 Candles History

We provide a simple and easy to use latest historical API which returns the previous 300 candle which is the latest and easy to watch the latest market.

https://fcsapi.com/api/forex/history?id=1&period=1h&access_key=API_KEY
https://fcsapi.com/api/forex/history?symbol=EUR/USD&period=1h&access_key=API_KEY
For Graphic Charts

Return response in special json format so you can use it directly in graph charts. Develop for HTML/JS graphs.

https://fcsapi.com/api/forex/history?symbol=EUR/USD&period=1h&access_key=API_KEY&chart=1
History Between Specific Date {YYYY-MM-DD}

Returns the specific period historical exchange rate data between two specified dates for all available symbols by using FROM/TO parameters. Here symbol would be two currencies with the slash between them and put the first date in FROM while putting the second date in TO. So you can get the historical data of the exchange rate for a specific period.

https://fcsapi.com/api/forex/history 
   ?symbol=EUR/USD
   &period=1d
   &from=2023-10-01
   &to=2024-04-18
   &access_key=API_KEY
Or Between Specific Date-Time
https://fcsapi.com/api/forex/history?symbol=EUR/USD&period=1d&from=2023-10-01T12:00&to=2024-04-18T12:00&access_key=API_KEY
Response:

Response It will return the response for the above forex historical API with different index keys(o, h, l, c, t, tm) which shows the open, high, low, close, time in unix, and time in standard format values for the data of specific historical candles in forex

{
  "symbol""EUR/USD",
  "candle": {
     "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 300 more historical candles},
}

Market Trends / Signals API

In the forex market, it is up to the investor how they analyze the previous and the current market trend before investing in forex and make a profitable entry. Market Trend / Signals API is specially developed for those peoples who want to know market trends or want to develop forex indicator. Our Indicators OR Buy/Sell Signals are calculated on the base of the previous 300 candles in a specific time period.
Check below different kinds of signals or indicators data.

Forex Pivot Points API

In financial markets, a pivot point is a support/resistance level is a helper that is used by traders as a possible indicator of market movement. A pivot point is calculated as an average of significant prices (high, low, close) from the performance of a market in the prior trading period. It will indicate to you about the Resistances and supports in a forex trading.
Our PP, resistance and support points are calculated on previous high open close.

Accepted Parameters :
id = {Any valid ID}
symbol = {Any valid symbol}
period = {any valid supported time frames}
access_key = API_KEY

Note: Below API does not support multiple ids in URL as a parameter. Send only 1 ID/Symbol name at a time with API request.

Pivot Point API:
https://fcsapi.com/api/forex/pivot_points?id=2&period=1d&access_key=API_KEY
https://fcsapi.com/api/forex/pivot_points?symbol=JPY/CHF&period=1d&access_key=API_KEY
Response:
Pivot Point response include latest candle pivot point, 3 Resistance and 3 Support points in 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
}
}

Forex Moving Averages API (MA Lines)

Moving Average (MA) is a trend indicator. MA lines are used by traders to check the average market value on the base of previous (5,10,20,50,100,200) candles. This API can help you to know MA values of the last active candle. Now you dont need to worry about, how to calculate simple MA (moving average) lines, how to SMA calulated, what is moving averages rules to calculate, so we take care of all these problem for you, we calculate all SMA and EMA values for you. if you wanted to get SMA of a 5min or 7days period, you would add the period min/days in period parameter.
Response Contains "Simple Moving Average(SMA)" and "Exponential Moving Average(EMA)" values

Accepted Parameters :
id = {Any valid FX ID}
symbol = {Any valid FX symbol}
period = {any valid supported time frames}
access_key = API_KEY

Note: Below API does not support multiple ids in URL as a parameter. Send only 1 ID/Symbol name at a time with API request.

SMA/EMA API:
https://fcsapi.com/api/forex/ma_avg?id=2&period=1d&access_key=API_KEY
https://fcsapi.com/api/forex/ma_avg?symbol=JPY/CHF&period=1d&access_key=API_KEY
Response:
Response get latest candle's Moving average values including Simple moving average and Exponential with Buy OR 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 API

Technical indicators are calculated with the help of top forex indicators (MA,RSI,STOCH,ATR etc). The Collection of Indicators Powerful & Profitable Forex Trading Strategies and Systems that work. It is developed to get the latest technical indicator values. In response, you will get the values of top indicators. Technical indicator values are the real-time updated value. The current data point derives the new and latest data point of a given exchange pair of currency.

Accepted Parameters :
id = {Any valid FX ID}
symbol = {Any valid FX symbol}
period = {any valid supported time frames}
access_key = API_KEY

Note: Below API does not support multiple ids in URL as a parameter. Send only one ID/Symbol name at a time with API request.

Forex Indicator API:
https://fcsapi.com/api/forex/indicators?id=2&period=1d&access_key=API_KEY
https://fcsapi.com/api/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
  }
}

Sample Code PHP

Real-time rates: Find below a simple PHP example for getting exchange rate data via the FCS API's latest endpoint.

$access_key = "API_KEY"; // Your API access key, Signup to get API KEY 
$symbol = "EUR/USD"; // FX Pairs

// Enter your API URL below
$api_url = "https://fcsapi.com/api/forex/latest?symbol=".$symbol."&access_key=".$access_key;

// Initialize CURL:
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch); // Store the data
curl_close($ch);

$response = json_decode($json, true); // convert JSON into Array
foreach ($response['data'] as $key => $value) {
  echo "Open Price Of ".$value['symbol']." is ".$value['candle']['o']; // Open Price Of EUR/USD is 1.1266
  echo "Close Price Of ".$value['symbol']." is ".$value['candle']['c']; // Close Price Of EUR/USD is 1.1277
}

Sample Code jQuery.ajax

Real-time rates: Find below a simple jQuery.ajax example of getting exchange rate data via the FCS API's latest endpoint.

access_key = "API_KEY"; // Your API access key, Signup to get API KEY 
id = 1; // Stock id

$.ajax({
    url:
"https://fcsapi.com/api/stock/latest?id=" + id + "&access_key=" + access_key,
    dataType:
"json",
    success: function(data) {
        console.log(data);
    }
});

Disclaimer

Prices, Market trends and signals are not designed for trading purpose, These signals are only for education or non-commercial purpose use. Data contained in this application/website is not necessarily real-time nor accurate and so prices may not be accurate and may differ from the actual market price, meaning prices are indicative and not appropriate for trading purposes. Therefore we doesn`t bear any responsibility for any trading losses you might incur as a result of using this data.
Latest price minimum refresh rate is 20 Seconds