Powered by 30+ exchange rate data sources, the FCS API delivering real-time stock exchange rate data for 30+ Countries and 25,000+ Stocks. The FCS provides different API endpoints, each serving a different data response. FCS provides the latest price for all or a specific pair of stock, retrieving historical stocks data for one or multiple stocks, technical indicators for market analyzing, and stock performance includes company income, cash flow, earnings, and financial reporting.
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.
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 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 request allow/minute. Please use multiple ids in the API URL to reduce API requests.
Sample API:
https://fcsapi.com/api/stock/list?category_id=1&access_key=API_KEY
Sign up for free using the button below to use the FCS Quickstart tool. Parameters | Details |
---|---|
ID | Specify Symbol id, Set id in URL parameter to get a stock response Default: none. Values: 1,2,3... etc, To get all list of Stock ID's or Symbols use "List API" below. |
Symbol | Symbol parameter uses to get specific stock data by symbol name from the database. Default: none. Values: {Any valid stock symbol name} Note: At least one "id" or "symbol" is required. If the ID parameter exists in URL than the symbol parameter will be ignored. You can use any 1 parameter (ID or Symbol) both will return the same result. |
Country | It is required when you use "All Stocks list" API, so you will get all stock from your selected country. Support 30 Countries Default: none. Valid Values: brazil, canada, china, denmark, dubai, finland, france, germany, hong-kong, india, indonesia, ireland, japan, malaysia, mexico, netherlands, pakistan, philippines, russia, saudi-arabia, singapore, south-africa, south-korea, spain, sweden, switzerland, thailand, turkey, united-kingdom, united-states, Note: You can set 1 or more country names to get all stocks from multiple countries by comma-separated names. |
Category_id | When you need all stocks of specific category from any country. Set category_id={category_id} in URL parameter. Default: none. Valid Values: {any valid Category id as shown in "All Stock List" API} Note: You can set 1 or more category id to get all stocks from multiple category id by comma-separated ids. Note: If the "Country" parameter exists in URL than the "country_id" parameter will be ignored. |
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 stock 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 Date 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 Date Format: YYYY-MM-DD E.g: 2018-01-31 OR YYYY-MM-DDTHour:Min E.g: 2018-01-31T12:30 Note: When you do 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. |
Output (Optional) | Set your API response format. Default: json Valid Values: json, object, xml, serialize and array |
You can get all the list of supported categories in your favorite country. You can use these categories ids in the "All Stocks List" API. Enter your category name in parameters to get a category list.
Parameters:
country={any valid supported country name} (optional)
access_key=API_KEY
https://fcsapi.com/api/stock/category?country=indonesia&access_key=API_KEYMultiple list by country:
https://fcsapi.com/api/stock/category?country=japan,turkey,indonesia&access_key=API_KEYAll category list from all countries:
https://fcsapi.com/api/stock/category?access_key=API_KEYResponse:
{
"id": 1,
"country": "United-states",
"category_name": "Nasdaq 100"
},
{
"id": 2,
"country": "Japan",
"category_name": "Topix 500"
},
{and more}
You can get all list of our supported stocks names, ids and category name.
Parameters:
country={any valid supported country name}
category_id={any valid supported category id} (optional)
access_key=API_KEY
https://fcsapi.com/api/stock/list?country=United-states&access_key=API_KEY
https://fcsapi.com/api/stock/list?country=United-states,Japan&access_key=API_KEYStock list by category id:
https://fcsapi.com/api/stock/list?category_id=1&access_key=API_KEY
https://fcsapi.com/api/stock/list?category_id=1,2,3&access_key=API_KEYResponse:
{
"stock_id": 1,
"name": "Advanced Micro Devices Inc",
"symbol": "AMD",
"country": "United-states",
},
{
"stock_id": 2,
"name": "Apple Inc",
"symbol": "AAPL",
"country": "United-states",
},
{Many More Stock List}
The most common part of API is to get the latest price of stocks, You can get one or multiple stock prices at the same time. To do so, simply append the stock ID/symbol parameter to your API request and set it to one or more by comma-separated.
Note: Prices update in every 30 seconds
Parameters:
id={any valid supported stock id}
symbol={any valid supported stock short name}
access_key=API_KEY
https://fcsapi.com/api/stock/latest?id=1&access_key=API_KEY
https://fcsapi.com/api/stock/latest?id=1,2,3,4,5&access_key=API_KEYStocks by symbol:
https://fcsapi.com/api/stock/latest?symbol=AMD,AAPL,MSFT,FB&access_key=API_KEYResponse:
{
"symbol": "Facebook",
"price": "183.28", // Open Price
"price": "188.89", // Current/Close Price
"high": "190.38", // High
"low": "183.66", // Low
"chg": "+5.61", // Change in 1 Day
"chg_percent: "+3.06%", // Change in percentage in 1 Day
"dateTime": "2019-10-15 12:30:00" // When price changed last time
},
{and more}
Returns stocks historical candle price data for a specific stock. Historical rates are available for most stocks all the way back to the year of the stock starting date. You can query the FCS API for historical rates by appending a date (format YYYY-MM-DD) to the base URL and specify the period time {5m, 15m, 30m,1h, 5h, 1d, 1w, month}
Accepted Parameters :
id = {Any valid Stock ID}
symbol = {Any valid stock short name}
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.
https://fcsapi.com/api/stock/history?id=1&period=1h&access_key=API_KEY
https://fcsapi.com/api/stock/history?symbol=IBM&period=1h&access_key=API_KEYFor 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/stock/history?id=1&period=1h&access_key=API_KEY&chart=1History Between Specific Date {YYYY-MM-DD}
https://fcsapi.com/api/stock/historyOr Between Specific Date-Time
?id=1
&period=1d
&from=2023-10-01
&to=2024-04-23
&access_key=API_KEY
https://fcsapi.com/api/stock/history?id=1&period=1d&from=2023-10-01T12:00&to=2024-04-23T12:00&access_key=API_KEYResponse:
{
"symbol": "FB",
"candle": {
"o": "134.22", // Open
"h": "136.48", // High
"l": "134.15", // Low
"c": "135.22", // Close
"t": 1713830400, // Time Unix Format (UTC)
"tm": "2024-04-23" // Date Time (UTC)
},
{and 300 more historical candles},
}
Technical indicators are calculated with the help of top chart indicators (MA, RSI, STOCH, ATR etc). The collection of chart indicators powerful & profitable stock trading strategies and systems that work. It is developed to get latest technical indicator values. In Response you will get a result of top indicators.
Parameters:
id={any valid supported stock id}
symbol={any valid supported stock short name}
access_key=API_KEY
https://fcsapi.com/api/stock/technicals?id=1&access_key=API_KEY
https://fcsapi.com/api/stock/technicals?id=1,2,3,4,5&access_key=API_KEYTechnical Stocks by symbol:
https://fcsapi.com/api/stock/technicals?symbol=TSLA,MSFT,FB&access_key=API_KEYResponse:
{
"id": 1,
"symbol": "TSLA",
"hourly": "Strong Buy",
"daily": "Sell",
"weekly": "Strong Sell",
"monthly": "Strong Sell"
},
{and more}
Get stock performance, when and how much stock price performs.
Parameters:
id={any valid supported stock id}
symbol={any valid supported stock short name}
access_key=API_KEY
https://fcsapi.com/api/stock/performance?id=1&access_key=API_KEY
https://fcsapi.com/api/stock/performance?id=1,2,3,4,5&access_key=API_KEYPerformance by symbol:
https://fcsapi.com/api/stock/performance?symbol=TSLA,MSFT,FB&access_key=API_KEYResponse:
{
"id": 1,
"symbol": "MSFT",
"daily": "+1.6 %",
"week": "-9.29 %",
"month": "+2.6 %",
"ytd": "+15.62 %",
"year": "+52.6 %",
"year3": "-23.47 %"
},
{and more}
Get stock fundamental to track stock performance for screening.
Stock Fundamental API:https://fcsapi.com/api/stock/fundamental?id=1,2,3,4,5&access_key=API_KEY
https://fcsapi.com/api/stock/fundamental?id=1&access_key=API_KEYFundamental API by Symbol:
https://fcsapi.com/api/stock/fundamental?symbol=MYTX,AHAP,BMAS&access_key=API_KEYResponse:
{
"id": 1,
"symbol": "MYTX",
"avg_vol_3m": "5.05K",
"market_cap": "139.74B",
"revenue": "163.95B",
"pe_ratio": "48.65",
"beta": "2",
},
{and more}
Finance is a heart of stock, You can get all current and historical income of stock, Balance and cash flow.
Below are 4 different API sample URLs.
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.
Parameters:
id={any valid supported stock id}
symbol={any valid supported stock short name}
access_key=API_KEY
https://fcsapi.com/api/stock/income?id=1&access_key=API_KEYBalance API:
https://fcsapi.com/api/stock/balance?id=1&access_key=API_KEYCash Flow API:
https://fcsapi.com/api/stock/cash?id=1&access_key=API_KEYEarnig API:
https://fcsapi.com/api/stock/earning?id=1&access_key=API_KEYResponse:
{
"id": 1,
"symbol": "FB",
"type": "Income",
"report": "Annual",
"data": "{...}" // more detail
}
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.
Parameters:
id={any valid supported stock id}
symbol={any valid supported stock short name}
access_key=API_KEY
https://fcsapi.com/api/stock/profile?id=1&access_key=API_KEYMultiple prices by ids:
https://fcsapi.com/api/stock/profile?id=1,2,3,4&access_key=API_KEYMultiple prices by name:
https://fcsapi.com/api/stock/profile?symbol=TSLA,MSFT,FB,AAPL&access_key=API_KEYResponse:
{
"id": 1,
"symbol": "NFLX",
"name": "Netflix Inc",
"country": "United-states",
"sector": "Services",
"industry": "Broadcasting & Cable TV",
"employees": "7000",
"equity_type": "ORD",
"info": {
"Address": "---",
"City": "Los Gatos",
"Postal_code": "CA 95032-1815",
"Country": "United-states",
"Phone": "+1-408-996****",
"Fax": "+1-408-996****",
"Website": "-",
},
},
{and more}
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
$id = 1; // Stock id
// Enter your API URL below
$api_url = "https://fcsapi.com/api/stock/latest?id=".$id."&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
print_r($response);
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);
}
});
Stock Prices, Profile, Market trends and signals, and historical data are not designed for trading purpose, These signals are only for education or noncommercial 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.