Forex & Crypto JSON API Documentation

FCS API

Powered by 25+ currency exchange rate data sources, the FCS API delivering real-time Forex 145+ currencies and crypto 2000+ coins rates. The FCS provides different API endpoints, each serving a different data response. FCS provides the latest FX/Crypto price for all or a specific pair of currency, retrieving historical currency data for one or multiple currencies, technical indicators for market analyzing, cryptocurrency supply details 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

FCS API 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

API Access Key
You need an API key in order to access our database. Your API 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/list?access_key=API_KEY
Sign up for a free using the button below to use the FCS Quick start tool.
Signup

Parameters

Parameters Details
ID Set Forex/Crypto-ID in URL parameters to get specific forex response.
Default: none. Values: 1,2,3... etc,
To get all list of Forex/Crypto ID's or Symbols use "List API" below.
Symbol Its use to get specific FX/Crypto data from the database by a symbol or short name.
Default: none
Values: EUR/USD,USD/JPY,BTC/USD etc,

Note: At least one "id" or "symbol" 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 of any FX/Crypto and you need 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 history API.

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 specify FROM and TO parameters, then history 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
Convert Its use to convert USD price into other specific currencies.

Default: none. Values: EUR,JPY,GBP,XRP etc,
Note: Currently it is only support/use in "Crypto Supply API"
Output
(Optional)
Set your API response format.
Default: json
Valid Values: json, object, xml, serialize and array

Supported Symbols List

You can get all the list of supported currencies names.

Accepted Parameters:
type = forex OR crypto OR both
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?access_key=API_KEY
https://fcsapi.com/api/forex/list?type=forex&access_key=API_KEY
https://fcsapi.com/api/forex/list?type=crypto&access_key=API_KEY
API Famous Symbols 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?top_symbol=1&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},
{
5000+ More Crypto Currencies}

Profile Details (Forex/Crypto Currency)

Get Forex currency details (name, currency country, bank name, etc) and CryptoCurrency profile details.


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

Profile by currency 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",
},
{ //Crypto Currency Profile
  "slug" : "bitcoin",
  "name" : "Bitcoin",
  "symbol" : "BTC",
  "category" : "coin",
  "short_name" : "BTC",
  "website" : "https://bitcoin.org/",
  "icon" : "https://fcsapi.com/assets/images/coin/btc.svg",
  "urls" : {
    "technical_doc" : "https://bitcoin.org/bitcoin.pdf",
    "twitter" : "https://twitter.com/Bitcoin",
    "reddit" : "https://reddit.com/r/bitcoin",
    "announcement" : "https://news.bitcoin.com/category/announcements",
    "source_code" : https://github.com/bitcoin/
  },
  "type": "crypto"
}, {and more}

Price Converter

The most common part of API is to get price conversation. To do so, simply append the FCS API's symbols parameter to your API request.

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

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

Price conversation:
https://fcsapi.com/api/forex/converter?symbol=EUR/USD&amount=200&access_key=API_KEY
Price conversation example 2:
https://fcsapi.com/api/forex/converter?pair1=EUR&pair2=USD&amount=200&access_key=API_KEY
Pair Conversation by ID:
https://fcsapi.com/api/forex/converter?id=1&amount=200&access_key=API_KEY
Response:
{ 
  "price_1x"1.1009, // 1 EUR/USD
  "total"220.18 // Price x amount = Total
},

Latest Price

The most common part of API is to get the latest price of a currency, You can get one or multiple currency prices at the same time. To do so, simply append the FCS API's symbols parameter to your API request and set it to one or more comma-separated currency codes.
Note: Prices update in every 30 seconds

Accepted Parameters :
id = {Any valid FX/Crypto ID}
symbol = {Any valid FX/Crypto 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
  "trend""Buy", // Trend Up/Down
  "last_changed""2019-08-01 12:30:00" // When price changed last time
},
{

  "symbol""USD/JPY",
  "price""106.04", // Price
  "change""-0.22", // Change in 1 day candle
  "change_per"-0.21%", // Change in percentage
  "trend""Sell", // Trend Up/Down
  "last_changed""2019-08-01 12:30:00" // When price changed last time
},
{
and more}

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

The also useful part of API is to get the candle price of a currency, You can get single or multiples candle prices at the same time. To do so, just append the FCS API's symbols parameter with API request and set single or multiple comma-separated currency codes.
Note : Last Candle API, only support ID/Symbols of Popular currency list as described above in the "All Symbols List" API.

Accepted Parameters :
id = {Any popular FX/Crypto ID}
symbol = {Any popular FX/Crypto symbol}
period = {Currency 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 selected currency id and time period from the chart. If you want only latest price (without high/low prices), Please use "Latest Price" API, If you need more previous candles of the single currency, Please use "Historical" API.

{ 
  "symbol""EUR/USD", // 1 Hour Candle
  "candle": {
     "o""1.1013", // Open
     "h""1.1013", // High
     "l""1.1008", // Low
     "c""1.1009", // Close
     "t"1573603200000, // Unix Time (UTC) (Candle Time)
     "tm""2019-11-13 00:00:00" // Date Time (UTC) (Candle Time)
  }
},
{

  "symbol""JPY/CHF",
  "candle": {
     "o""109",
     "h""109",
     "l""108.88",
     "c""108.89",
     "t"1573603200000,
     "tm""2019-11-13 00:00:00"
  }
},
{
and more}

Historical Price API

Returns historical exchange price data for a specific symbol. Historical rates are available for most symbols all the way back to the year of 1995. You can query the FCS API for historical rates by appending a date (format YYYY-MM-DD) to the base URL and specify the time period {5m, 15m, 30m, 1h, 5h, 1d, 1w, month}

Accepted Parameters :
id = {Any valid FX/Crypto ID}
symbol = {Any valid Fx/Crypto symbol}
period = {Currency time period}
from = {History 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, then please do not set From/To parameter, it will work better.
Note: Below API does not support multiple ids in URL as a parameter. Send only 1 ID/Symbol name at a time with the API request.

Quick Latest 300 Candles History
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 specific time period historical exchange rate data between two specified dates for all available symbols. Use FROM/TO parameters.
https://fcsapi.com/api/forex/history 
   ?symbol=EUR/USD
   &period=1d
   &from=2019-05-01
   &to=2019-11-12
   &access_key=API_KEY
Or Between Specific Date-Time
https://fcsapi.com/api/forex/history?symbol=EUR/USD&period=1d&from=2019-05-01T12:00&to=2019-11-12T12:00&access_key=API_KEY
Response:
{
  "symbol""EUR/USD",
  "candle": {
     "o""1.1013", // Open
     "h""1.1013", // High
     "l""1.1008", // Low
     "c""1.1009", // Close
     "t"1573603200000, // Time Unix Format (UTC)
     "tm""2019-11-13 00:00:00" // Date Time (UTC)
  },
  {
and 300 more historical candles},
}

Crypto Supply

Returns the latest market crypto supply for 1 or more crypto-currencies.

Accepted Parameters :
id = {Any valid Crypto ID}
symbol = {Any valid Crypto symbol}
convert = {Currency name to convert price into specific price} e.g: JPY,EUR,XRP,ETC
access_key = API_KEY

Crypto Supply by Short Name:
https://fcsapi.com/api/forex/supply?symbol=BTC,XRP&convert=USD&access_key=API_KEY
Supply by ID's'
https://fcsapi.com/api/forex/supply?id=100,90&convert=USD&access_key=API_KEY
Response:
 { //Crypto Currency Supply 
  "id" : "78",
  "rank" : 1,
  "name" : "Bitcoin",
  "symbol" : "BTC",
  "update" : "1 min ago",
  "update_time" : "2019-10-03 07:01:24",
  "circulating_supply" : "17970625",
  "max_supply" : "21000000",
  "quote": {
    "usd": {
      "price" : "8323.27671014",
      "market_cap" : "149574484529.16",
      "vol_24H" : "12579486945.484",
      "percentage_change_1h" : "-0.2291",
      "percentage_change_24h" : "0.8181",
      "percentage_change_7d" : "-1.4546"
   }
  }
}, {and more}

Market Trends / Signals API

Market Trend / Signals API is specially developed for those peoples who want to know market trends or want to develop EA. 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.

Pivot Points API

In financial markets, a pivot point is a price level 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.
Our PP, resistance and support points are calculated on previous (high,open,close) prices.

Accepted Parameters :
id = {Any valid FX/Crypto ID}
symbol = {Any valid FX/Crypto symbol}
period = {Currency time period}
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.

PP 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:
Response include latest candle PP, Resistance and 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
}
}

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.
Response Contains "Simple Moving Average(SMA)" and "Exponential Moving Average(EMA)" values

Accepted Parameters :
id = {Any valid FX/Crypto ID}
symbol = {Any valid FX/Crypto symbol}
period = {Currency time period}
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 with Magic trend (Buy/Sell)
{ 
 "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
  }
}

Technical Indicator API

Technical indicators are calculated with the help of top forex indicators (MA,RSI,Stoch,ATR etc). The Collection of Forex 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 values of top indicators.

Accepted Parameters :
id = {Any valid FX/Crypto ID}
symbol = {Any valid FX/Crypto symbol}
period = {Currency time period}
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.

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"; // Currency 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