### Merge API Example
Source: https://fcsapi.com/document/crypto-api
This GET request example demonstrates how to merge data from latest, performance, technical, profile, and meta APIs for a specific symbol and period. Ensure you replace 'API_KEY' with your actual access key.
```http
https://api-v4.fcsapi.com/crypto/advance?symbol=BINANCE:BTCUSDT,COINBASE:ETHUSD&merge=latest,perf,tech,profile,meta&period=1d&access_key=API_KEY
```
--------------------------------
### Token Symbols (All fields) Example
Source: https://fcsapi.com/document/crypto-api
This GET request example retrieves all available fields for token symbols. It can be used with various parameters to filter and sort the results. Replace 'API_KEY' with your actual access key.
```http
https://api-v4.fcsapi.com/crypto/advance
```
--------------------------------
### Fetch Indicators for Multiple Symbols (GET Request)
Source: https://fcsapi.com/document/forex-api
Example of a GET request to fetch indicators for multiple currency symbols. Ensure to replace 'API_KEY' with your actual access key.
```http
https://api-v4.fcsapi.com/forex/indicators?symbol=EURUSD,GBPUSD,USDJPY&period=1D&access_key=API_KEY
```
--------------------------------
### Node.js Installation
Source: https://fcsapi.com/document/socket-api
Install the required dependencies and require the library in your Node.js application.
```bash
npm install ws
```
```javascript
const FCSClient = require("./fcs-client-lib.js");
```
--------------------------------
### All Supported Stocks List Response Example
Source: https://fcsapi.com/document/stock-api
Example JSON response for the 'All Supported Stocks List' endpoint, providing details for each stock.
```JSON
{
"status": true,
"code": 200,
"msg": "Successfully",
"response": [
{
"ticker": "NASDAQ:AAPL",
"profile": {
"symbol": "AAPL",
"exchange": "NASDAQ",
"currency": "USD",
"name": "Apple Inc.",
"type": "stock",
"sub_type": "common",
"curr_logo": "country/US",
"exc_logo": "exchange/nasdaq"
},
"meta": {
"update_mode": "delayed_streaming_900",
"fractional": "false",
"curr_logo": "https:fcsapi.com/assets/logos/country/US.svg",
"sector": "Electronic Technology",
"region": "United States",
"market": "america",
"currency_desc": "U.S. dollar",
"minmov": 1,
"pricescale": 100,
"indexes": [
{
"name": "S&P 500",
"proname": "SP:SPX"
},
{
"name": "NASDAQ 100",
"proname": "NASDAQ:NDX"
},
{
"name": "Dow Jones Industrial Average",
"proname": "DJ:DJI"
},
{
"name": "NASDAQ Composite",
"proname": "NASDAQ:IXIC"
},
{
"name": "S&P 500 Information Technology",
"proname": "SP:S5INFT"
},
{
"name": "S&P 100",
"proname": "SP:OEX"
},
{
"name": "Nasdaq US Large Cap Growth",
"proname": "NASDAQ:NQUSLG"
}
]
}
}
],
"info": {
"server_time": "2025-01-31 21:53:51 UTC",
"credit_count": 1
}
}
```
--------------------------------
### Install FCS WebSocket Client
Source: https://fcsapi.com/document/socket-api
Install the necessary WebSocket client library for Node.js using npm.
```bash
npm install ws
```
--------------------------------
### Retrieve Crypto Indicators via GET
Source: https://fcsapi.com/document/crypto-api
Examples of fetching technical indicators using different query parameters for single tokens, single coins, and multiple coins.
```text
https://api-v4.fcsapi.com/crypto/indicators?type=crypto&symbol=BINANCE:BTCUSDT&period=1h&access_key=API_KEY
```
```text
https://api-v4.fcsapi.com/crypto/indicators?type=coin&symbol=BTCUSD&period=1h&exchange=crypto&access_key=API_KEY
```
```text
https://api-v4.fcsapi.com/crypto/indicators?type=coin&symbol=BTCUSD,ETHUSD,LTCUSD&period=1d&exchange=crypto&access_key=API_KEY
```
--------------------------------
### Browser Installation
Source: https://fcsapi.com/document/socket-api
Include the library file in your browser-based project.
```html
```
--------------------------------
### Fetch Latest Stock Data (Python)
Source: https://fcsapi.com/document/stock-api
This Python example uses the requests library to fetch the latest stock data. Ensure you have the 'requests' library installed.
```python
import requests
# Local FCSAPI endpoint
url = "https://api-v4.fcsapi.com/stock/latest"
# Parameters
params = {
"symbol": "ONA:EURUSD,BINANCE:BTCUSD",
"access_key": "API_KEY"
}
# Send GET request
response = requests.get(url, params=params)
```
--------------------------------
### Search API Response Example
Source: https://fcsapi.com/document/crypto-api
Example of a successful search response returning a list of matching crypto assets.
```json
{
"status": true,
"code": 200,
"msg": "Successfully",
"response": [
{
"id": "169815",
"symbol": "1INCHUSD",
"name": "1inch / US Dollar",
"type": "crypto",
"sub_type": "spot",
"currency": "USD",
"exchange": "Coinbase",
"country": "US",
"base_id": "XTVC1INCH",
"bulk_support": "1"
},
{
"id": "151338",
"symbol": "AAVEUSD",
"name": "AAVE / US Dollar",
"type": "crypto",
"sub_type": "spot",
"currency": "USD",
"exchange": "Binance",
"country": "US",
"base_id": "XTVCAAVE",
"bulk_support": "1"
}
],
"info": {
"server_time": "2023-09-06 21:53:51 UTC",
"credit_count": 1
}
}
```
--------------------------------
### Crypto Performance Response Example
Source: https://fcsapi.com/document/crypto-api
Example of a successful response containing performance metrics for a cryptocurrency.
```json
{
"status": true,
"code": 200,
"msg": "Successfully",
"response": [
{
"ticker": "BTCUSD",
"perf": {
"H1M": 124501.31,
"L1M": 107265.32,
"H3M": 124501.31,
"L3M": 98242.47,
"H6M": 124501.31,
"L6M": 74458.42,
"H52": 124501.31,
"L52": 55567.46,
"HIGHEST": 124501.31,
"LOWEST": 0.0006134,
"PW": 1.5746,
"P1M": -4.73604,
"P3M": 0.588238,
"P6M": 32.6467,
"PYTD": 18.8004,
"PY": 102.263,
"P5Y": 995.724,
"PAll": 14525490789.1,
"voltD": 2.25839,
"voltW": 2.01587,
"voltM": 2.68002,
"max_supply": 21000000,
"total_supply": 19918487,
"circulating_supply": 19918487,
"rank": 1,
"market_cap": 2212087410759,
"market_cap_diluted": 2332197000000,
"addresses_active": 732824,
"txs_count": 566372,
"socialdominance": 16.6406
}
}
]
}
```
--------------------------------
### Browser and Node.js Connection Example
Source: https://fcsapi.com/document/socket-api
Connect to the FCS API using the client library. This example shows basic connection, joining a symbol, and handling incoming messages for both browser and Node.js environments.
```javascript
// Browser Example
```
```javascript
// Node.js Example
const FCSClient = require("./fcs-client-lib");
// Use demo key for testing
const client = new FCSClient("fcs_socket_demo");
client.connect();
client.onconnected = () => {
console.log("Connected!");
client.join("BINANCE:BTCUSDT", "60");
};
client.onmessage = (data) => {
console.log(data);
};
```
--------------------------------
### Node.js Client with Trading Logic Example
Source: https://fcsapi.com/document/socket-api
Example of using the FCS client in a Node.js environment with a specific WebSocket URL and implementing basic trading logic based on price changes.
```javascript
const FCSClient = require("./fcs-client-lib");
const client = new FCSClient(
process.env.FCS_API_KEY,
"wss://ws-v4.fcsapi.com/ws"
);
let lastPrice = 0;
client.connect();
client.onconnected = () => {
client.join("BINANCE:BTCUSDT", "60");
};
client.onmessage = (data) => {
if (data.type === "price") {
const currentPrice = data.prices.c;
// Simple trading logic
if (lastPrice > 0) {
const change =
((currentPrice - lastPrice) / lastPrice) * 100;
if (change > 2) {
console.log("ALERT: Price up 2%!");
// Execute buy/sell logic
}
```
--------------------------------
### API Response Example
Source: https://fcsapi.com/document/stock-api
This is an example of a successful response from the FCSAPI, showing status, code, message, and detailed response data.
```JSON
{
"status": true,
"code": 200,
"msg": "Successfully",
"response": {
"by_type": [
{
"type": "stock",
"total_symbols": "6125",
"socket_support_yes": "1385",
"socket_support_no": "4740",
"no_of_exchanges": "10"
}
],
"by_exchange": [
{
"type": "stock",
"exchange": "FX",
"total_symbols": "4293",
"socket_support_yes": "155",
"socket_support_no": "4138"
},
{
"type": "stock",
"exchange": "RUS",
"total_symbols": "299",
"socket_support_yes": "0",
"socket_support_no": "299"
},
{
"type": "stock",
"exchange": "SFO",
"total_symbols": "169",
"socket_support_yes": "169",
"socket_support_no": "0"
}
]
},
"info": {
"server_time": "2025-07-31 10:07:30 UTC",
"credit_count": 1,
"process_time": "0.045 seconds"
}
}
```
--------------------------------
### Mini Sample Response
Source: https://fcsapi.com/document/crypto-api
Example JSON response structure for a cross-currency request.
```json
{
"USDBTC": "0.00000915",
"USDADA": 1.23414,
"USDACE": 1.99617,
"USDEUR": 0.8545,
"USDACH": 51.6037,
"USDACX": 6.89235,
"USDACM": 1.08823,
"USDADX": 7.50811,
"USDACA": 34.367,
"more": "All tokens with base USD"
}
```
--------------------------------
### Advanced Query API - Example Request
Source: https://fcsapi.com/document
This is a POST request example for the Advanced Query API. It demonstrates how to specify columns, symbols, and merge additional API data. Ensure your plan supports these features.
```HTTP
POST /forex/advance
{
"access_key": "API_KEY",
"columns": "symbol,open,high,low,close,volume",
"symbol": "EURUSD,GBPUSD",
"merge": "latest,perf,tech"
}
```
--------------------------------
### Stock Index List Response Example
Source: https://fcsapi.com/document/stock-api
Example JSON response for a stock index list query, detailing ticker information, profile, and meta data.
```JSON
{
"status": true,
"code": 200,
"msg": "Successfully",
"response": [
{
"ticker": "NASDAQ:NDX",
"profile": {
"symbol": "NDX",
"exchange": "NASDAQ",
"currency": "USD",
"name": "NASDAQ 100 Index",
"type": "index",
"sub_type": "main",
"curr_logo": "country/US",
"exc_logo": "exchange/nasdaq"
},
"meta": {
"update_mode": "delayed_streaming_900",
"fractional": "false",
"curr_logo": "http://fcsapi.com/assets/logos/country/US.svg",
"market": "america",
"currency_desc": "U.S. dollar",
"minmov": 1,
"pricescale": 100,
"base_currency": null,
"base_id": "nasdaq-100",
"exc_logo": "http://fcsapi.com/assets/logos/exchange/nasdaq.svg",
"country": "US"
}
}
],
"info": {
"server_time": "2025-01-31 21:53:51 UTC",
"credit_count": 1
}
}
```
--------------------------------
### Currency Converter API Example
Source: https://fcsapi.com/document/forex-api
Example URL for the Currency Converter API. Use `type=commodity` when requesting commodities. This endpoint accepts only one currency pair per request.
```http
https://api-v4.fcsapi.com/forex/converter?pair1=EUR&pair2=USD&amount=10&access_key=API_KEY
```
--------------------------------
### Get All Forex Currency Pairs for JPY
Source: https://fcsapi.com/document/forex-api
Example API call to retrieve all forex currency pairs where JPY is the base currency. The API returns all currencies starting with the specified symbol.
```http
https://api-v4.fcsapi.com/forex/base_latest?symbol=JPY&type=forex&access_key=API_KEY
```
--------------------------------
### Configure API Key
Source: https://fcsapi.com/document/socket-api
Initialize the client using either a production API key or the demo key for testing.
```javascript
// Using your API key (requires active socket subscription)
const client = new FCSClient("YOUR_API_KEY");
// Using demo key for testing
const client = new FCSClient("fcs_socket_demo");
```
--------------------------------
### Pivot Points API Requests
Source: https://fcsapi.com/document
Examples of GET and POST requests for retrieving pivot point data.
```text
https://api-v4.fcsapi.com/forex/pivot_points?symbol=EURUSD&period=1D&access_key=API_KEY
```
```text
https://api-v4.fcsapi.com/forex/pivot_points?symbol=FX:GBPUSD&period=4h&access_key=API_KEY
```
```json
{
"type": "forex",
"symbols": "EURUSD,USDJPY",
"exchange": "FX",
"period": "1d",
"access_key": "API_KEY"
}
```
--------------------------------
### Connect to WebSocket
Source: https://fcsapi.com/document/socket-api
Initialize the client instance with your API key and the WebSocket URL.
```javascript
const client = new FCSClient("YOUR_API_KEY", "wss://ws-v4.fcsapi.com/ws");
client.connect();
```
--------------------------------
### Pivot Points API - Single Pair
Source: https://fcsapi.com/document/forex-api
Example GET request for daily pivot levels of a single currency pair (EURUSD).
```http
https://api-v4.fcsapi.com/forex/pivot_points?symbol=EURUSD&period=1D&access_key=API_KEY
```
--------------------------------
### Retrieve Moving Averages via GET
Source: https://fcsapi.com/document/stock-api
Examples of querying EMA and SMA data for single, specific exchange, and multiple stock symbols.
```text
https://api-v4.fcsapi.com/stock/ma_avg?symbol=AAPL&period=1h&access_key=API_KEY
```
```text
https://api-v4.fcsapi.com/stock/ma_avg?symbol=NASDAQ:MSFT&period=1D&access_key=API_KEY
```
```text
https://api-v4.fcsapi.com/stock/ma_avg?symbol=AAPL,GOOGL,AMZN&period=1D&access_key=API_KEY
```
--------------------------------
### POST /stock/advance - Raw Query (All Fields)
Source: https://fcsapi.com/document/stock-api
This example demonstrates a POST request to the /stock/advance endpoint using all available fields for a comprehensive query. Both raw POST and JSON are accepted.
```APIDOC
## POST /stock/advance - Raw Query (All Fields)
### Description
This endpoint allows for advanced stock data retrieval using a wide range of parameters. It accepts raw POST data or JSON payloads.
### Method
POST
### Endpoint
https://api-v4.fcsapi.com/stock/advance
### Parameters
#### Request Body
- **symbol** (string) - Required - The stock symbol(s) to query, format: EXCHANGE:SYMBOL (e.g., NASDAQ:AAPL,NYSE:TSLA).
- **exchange** (string) - Optional - Comma-separated list of exchanges to retrieve data from (e.g., NASDAQ,NYSE).
- **type** (string) - Optional - Type of financial instrument (e.g., stock, index).
- **sub_type** (string) - Optional - Sub-type of the instrument (e.g., spot, synthetic).
- **period** (string) - Optional - Time period for data (e.g., 1m, 5m, 1d, 1month).
- **columns** (string) - Optional - Specify columns to return. Leave empty for all.
- **keep_parent_colm** (integer) - Optional - (0|1) Controls parent column behavior.
- **similar** (integer) - Optional - (0|1) Enable similar stock lookup across exchanges.
- **filters** (object) - Optional - Range filters for data (e.g., `{"c_gt":1}`).
- **sort_by** (string) - Optional - Column to sort by, format: columnname_asc/desc (e.g., `c_desc`).
- **merge** (string) - Optional - Comma-separated list of data types to merge (e.g., `latest,perf,tech,profile,meta`).
- **page** (integer) - Optional - Page number for pagination.
- **per_page** (string) - Optional - Number of results per page.
- **search** (string) - Optional - Search term (cannot be used with `symbol`).
- **access_key** (string) - Required - Your API access key.
### Request Example
```json
{
"symbol":"NASDAQ:AAPL,NYSE:TSLA",
"exchange":"NASDAQ,NYSE",
"type":"stock",
"sub_type":"spot",
"period":"1d",
"columns":"",
"keep_parent_colm":0,
"similar":0,
"filters":{"c_gt":1},
"sort_by":"c_desc",
"merge" :"latest,perf,tech,profile,meta",
"page":1,
"per_page":"50",
"search":"",
"access_key":"API_KEY"
}
```
### Response
#### Success Response (200)
- **info** (object) - Contains various data points including `filters` and `sort_by` applied.
- **data** (array) - Array of stock data objects.
#### Response Example
```json
{
"info": {
"filters": {
"applied": {
"active.c_gt": "100"
},
"ignored": []
},
"sort_by": "active.v_desc"
},
"data": [
{
"o": 170.34,
"h": 173.08,
"l": 169.85,
"c": 172.5,
"v": 50000000,
"ch": 2.16,
"chp": 1.27,
"t": 1678886400,
"tm": "2023-03-15 13:20:00",
"vw": 171.5,
"name": "Apple Inc.",
"symbol": "AAPL",
"exchange": "NASDAQ"
}
]
}
```
```
--------------------------------
### Pivot Points API - Specific Exchange
Source: https://fcsapi.com/document/forex-api
Example GET request for 4-hour pivot levels of a specific symbol (GBPUSD) from a particular exchange (FX).
```http
https://api-v4.fcsapi.com/forex/pivot_points?symbol=FX:GBPUSD&period=4h&access_key=API_KEY
```
--------------------------------
### Filter Operators Guide
Source: https://fcsapi.com/document/forex-api
Examples of filter operators for range filtering in API queries. These operators allow for greater than, less than, equal to, and between value comparisons.
```json
{"c_gte": 1.15, "chp_between": "1,50", "volume_gt": 1000}
```
--------------------------------
### Full Stock Performance API Example
Source: https://fcsapi.com/document/stock-api
Retrieve comprehensive stock performance data, including highs, lows, returns, and volatility. Replace 'API_KEY' with your actual key.
```HTTP
https://api-v4.fcsapi.com/stock/performance?symbol=AAPL&access_key=API_KEY
```
--------------------------------
### Initialization Configuration
Source: https://fcsapi.com/document/chart-api
Required and core settings for initializing the chart container and default display properties.
```APIDOC
## Initialization Configuration
### Description
Defines the required container elements and core chart settings such as symbol, timeframe, and display mode.
### Parameters
#### Required Settings
- **container** (Element) - Required - Chart container DOM element
- **parentid** (String) - Required - Parent container ID for toolbar/sidebar positioning
- **accessKey** (String) - Required - Your FCS API access key
#### Core Chart Settings
- **symbol** (String) - Optional - Default symbol (e.g., BINANCE:BTCUSDT)
- **period** (String) - Optional - Default timeframe (e.g., 1H)
- **length** (Number) - Optional - Number of candles to load
- **enableCache** (Boolean) - Optional - Cache user settings in localStorage
- **changeURL** (Boolean) - Optional - Update browser URL with symbol/period
### Request Example
{
"container": document.getElementById("chart"),
"parentid": "chart-wrapper",
"accessKey": "YOUR_API_KEY",
"symbol": "BINANCE:BTCUSDT",
"period": "1H"
}
```
--------------------------------
### Get All Forex Currency Pairs for USD
Source: https://fcsapi.com/document/forex-api
Example API call to retrieve all forex currency pairs where USD is the base currency. Ensure `type` is set to `forex` for currency data.
```http
https://api-v4.fcsapi.com/forex/base_latest?symbol=USD&type=forex&access_key=API_KEY
```
--------------------------------
### Execute Multiple Different APIs in Parallel
Source: https://fcsapi.com/document/stock-api
This example demonstrates how to call multiple distinct API endpoints simultaneously using the multi_url endpoint. It requires an access key and an array of URLs.
```HTTP
https://api-v4.fcsapi.com/stock/multi_url
?url[1]=stock/latest?symbol=AAPL
&url[2]=stock/history?symbol=AAPL
&url[3]=stock/indicators?symbol=AAPL
&access_key=API_KEY
```
--------------------------------
### Connect to WebSocket
Source: https://fcsapi.com/document/socket-api
Initiate the connection to the server and handle the promise resolution or rejection.
```javascript
client.connect()
.then((client) => {
console.log("Connection established");
})
.catch((err) => {
console.error("Connection failed:", err);
});
```
--------------------------------
### Comprehensive WebSocket Client Usage
Source: https://fcsapi.com/document/socket-api
A detailed example demonstrating how to initialize the FCS client, connect, join multiple symbols, and handle various message types including prices and errors. Includes functions for disconnecting.
```javascript
// if NODEJS
//const FCSClient = require("./fcs-client-lib");
// if BROWSER
//
const API_KEY = "YOUR_API_KEY";
const client = new FCSClient(API_KEY);
client.connect(); // start connection
client.onconnected = () => {
// Join symbol after connection
client.join("BINANCE:BTCUSDT", "60");
client.join("NASDAQ:AAPL", "60");
};
client.onmessage = (data) => {
if (data.type === "price") {
// Received live price update
console.log(`Price update for ${data.symbol}`);
console.log(data);
}
};
client.onreconnect = () => {
console.log("Reconnected to WebSocket");
};
client.onclose = () => {
console.log("Connection closed");
};
client.onerror = (err) => {
console.error("Error:", err);
};
function disconnectWS() {
client.disconnect();
}
```
--------------------------------
### Order Visualization
Source: https://fcsapi.com/document/chart-api
Example implementation of a class to manage and display trading orders on the chart.
```javascript
// Trading order display example
class OrderDisplay {
constructor(chart) {
this.chart = chart;
this.orderLines = new Map();
}
// Display a new order on chart
async showOrder(order) {
// Entry line
const entryId = await this.chart.addHorizontalLine({
price: order.entryPrice,
color: '#2196f3',
label: `Entry ${order.id}`,
style: 'solid',
id: `entry-${order.id}`
});
// Take Profit line
```
--------------------------------
### Example JSON Response Structure
Source: https://fcsapi.com/document/forex-api
This is an example of a successful JSON response structure from the API, indicating a status of true and containing a list of currency data.
```json
{
"status": true,
"response": [
{
"short_name": "EUR",
"name": "Euro"
}
]
}
]
}
```
--------------------------------
### Get Latest Commodity Prices cURL
Source: https://fcsapi.com/document/forex-api
Use this cURL command to get the latest prices for commodities. Specify the symbol and type, and replace API_KEY.
```bash
curl "https://api-v4.fcsapi.com/forex/latest?symbol=XAUUSD&type=commodity&access_key=API_KEY"
```
--------------------------------
### Forex Indicators API Response Example
Source: https://fcsapi.com/document/forex-api
This is an example of a successful response from the Forex Indicators API, detailing various technical indicators and oscillator values for a given ticker.
```json
{
"status": true,
"code": 200,
"msg": "Successfully",
"response": [
{
"ticker": "FCM:EURUSD",
"signal": {
"summary": "BUY",
"score": 48.6,
"confidence": "LOW",
"trend": "WEAK",
"volatility": "LOW"
},
"indicators": {
"volatility": {
"atr_per": 0.663,
"true_range": 0.00739,
"level": "Low"
},
"bollinger": {
"width_per": 1.097,
"pos_per": 50.78,
"middle": 1.16502,
"squeeze": "Squeeze"
},
"price_action": {
"body_size": 0.00203,
"shadow_u": 0.00213,
"shadow_l": 0.00323,
"body_range_per": 27.47,
"c_type": "Bullish",
"pattern": "Normal"
}
},
"oscillators": {
"rsi": {
"v": 49.2919,
"s": "Neutral",
"n": "RSI",
"score": 0
},
"stoch": {
"v": 43.9802,
"s": "Sell",
"n": "STOCH K%",
"score": -25
},
"macd": {
"v": 0.0008076,
"s": "Sell",
"n": "MACD Level",
"score": -25
},
"atr": {
"v": 0.0077306,
"s": "Strong Buy",
"n": "ATR",
"score": 50
},
"adx": {
"v": 8.45379,
"s": "Buy",
"n": "ADX",
"score": 25
},
"uo": {
"v": 53.8225,
"s": "Neutral",
"n": "Ultimate Oscillator",
"score": 0
},
"psar": {
"v": 1.15836,
"s": "Strong Buy",
"n": "Parabolic SAR",
"score": 50
}
}
}
]
}
```
--------------------------------
### POST /stock/advance - Similar Stocks (Cross-Exchange Lookup)
Source: https://fcsapi.com/document/stock-api
This example shows how to find a stock listed on multiple exchanges worldwide by setting the `similar` parameter to 1. This requires exactly one symbol and the `profile` and `meta` merge options.
```APIDOC
## POST /stock/advance - Similar Stocks (Cross-Exchange Lookup)
### Description
This endpoint can be used to find where a specific company's stock is listed across different exchanges globally. This feature is activated by setting `similar` to 1 and requires specific conditions to be met.
### Method
POST
### Endpoint
https://api-v4.fcsapi.com/stock/advance
### Parameters
#### Request Body
- **symbol** (string) - Required - Exactly one stock symbol (e.g., `NASDAQ:AAPL`).
- **merge** (string) - Required - Must include `profile` and `meta` (e.g., `latest,profile,meta`).
- **period** (string) - Optional - Time period for data (e.g., `1d`).
- **similar** (integer) - Required - Set to `1` to enable cross-exchange lookup.
- **access_key** (string) - Required - Your API access key.
### Request Example
```json
{
"symbol": "NASDAQ:AAPL",
"merge": "latest,profile,meta",
"period": "1d",
"similar": 1,
"access_key": "API_KEY"
}
```
### Response
#### Success Response (200)
- **info** (object) - Contains information about the lookup.
- **similar_direct** (boolean) - `true` if all results share the same sub_type, `false` if nested by sub_type.
- **similar** (array or object) - An array or object containing cross-listed symbols. Each item may include:
- **ticker** (string) - Ticker symbol.
- **symbol** (string) - Symbol on the specific exchange.
- **name** (string) - Company name.
- **type** (string) - Instrument type.
- **sub_type** (string) - Instrument sub-type.
- **currency** (string) - Trading currency.
- **exchange** (string) - Exchange name.
- **country** (string) - Country of the exchange.
- **is_primary** (boolean) - Indicates if this is the primary listing.
- **info.similar_error** (string) - Returned if `profile` or `meta` are missing from `merge`.
#### Response Example
```json
{
"info": {
"similar_direct": true,
"similar": [
{
"ticker": "MIL:1AAPL",
"symbol": "1AAPL",
"name": "Apple Inc.",
"type": "stock",
"sub_type": "spot",
"currency": "EUR",
"exchange": "MIL",
"country": "IT",
"is_primary": false
},
{
"more": "..."
}
]
}
}
```
### Notes
- The `similar` parameter only activates if the query returns exactly one record.
- If `profile` or `meta` are missing from the `merge` parameter, the response will contain `info.similar_error: "required profile and meta in merge"`.
```
--------------------------------
### MA and EMA API Response Example
Source: https://fcsapi.com/document/forex-api
This is an example response for a request that includes Moving Average (MA) and Exponential Moving Average (EMA) data. It shows the ticker and calculated values for different averages.
```json
{
"status": true,
"code": 200,
"msg": "Successfully",
"response": [
{
"ticker": "FCM:EURUSD",
"signal": {
"summary": "BUY",
"score": 48.6,
"confidence": "LOW",
"trend": "WEAK",
"volatility": "LOW"
},
"ma_avg": {
"ema10": {
"v": 1.16597,
"s": "Neutral",
"n": "EMA 10",
"score": -5
},
"ema25": {
"v": 1.16516,
"s": "Neutral",
"n": "EMA 25",
"score": 0
},
"ema100": {
"v": 1.14767,
"s": "Strong Buy",
"n": "EMA 100",
"score": 70
},
"ema200": {
"v": 1.12551,
"s": "Strong Buy",
"n": "EMA 200",
"score": 100
},
"sma10": {
"v": 1.16644,
"s": "Neutral",
"n": "SMA 10",
"score": -10
},
"sma25": {
"v": 1.16502,
"s": "Neutral",
"n": "SMA 25",
"score": 0
},
"sma100": {
"v": 1.15246,
"s": "Strong Buy",
"n": "SMA 100",
"score": 50
},
"sma200": {
"v": 1.10586,
"s": "Strong Buy",
"n": "SMA 200",
"score": 100
}
}
}
]
}
```
--------------------------------
### Initialize FCS Client
Source: https://fcsapi.com/document/socket-api
Create a new instance of the FCSClient using your API key and optional server URL.
```javascript
const client = new FCSClient(apiKey, wsUrl);
// Parameters:
// apiKey (required): Your FCS API key
// wsUrl (optional): WebSocket server URL, defaults to "wss://ws-v4.fcsapi.com/ws/"
```
--------------------------------
### Retrieve Latest Stock Prices
Source: https://fcsapi.com/document/stock-api
Examples for fetching stock data using various query parameters.
```http
https://api-v4.fcsapi.com/stock/latest?symbol=BVC:AAPL,NASDAQ:AAPL,BVC:MSFT,TSLA&access_key=API_KEY
```
```http
https://api-v4.fcsapi.com/stock/latest?country=united-states§or=technology&access_key=API_KEY
```
```http
https://api-v4.fcsapi.com/stock/latest?indices=NASDAQ:NDX,SP:SPX&access_key=API_KEY
```
```http
https://api-v4.fcsapi.com/stock/latest?symbol=BVC:AAPL&get_profile=1&access_key=API_KEY
```
--------------------------------
### Base Currency Latest Price Requests
Source: https://fcsapi.com/document
Example URLs for retrieving all currency pairs for a specific base currency.
```http
https://api-v4.fcsapi.com/forex/base_latest?symbol=USD&type=forex&access_key=API_KEY
```
```http
https://api-v4.fcsapi.com/forex/base_latest?symbol=JPY&type=forex&access_key=API_KEY
```
--------------------------------
### POST/RAW Query Example (All Fields)
Source: https://fcsapi.com/document/forex-api
Use this JSON structure for POST/RAW queries to retrieve forex data. All fields are optional and can be customized to filter, sort, and merge data from specific exchanges or types.
```json
{
"symbol":"FX:EURUSD,SFO:JPYUSD", // EXCHANGE:SYMBOL
"exchange":"", // return data from specific exchange
"type":"forex", // forex
"sub_type":"spot", // spot,synthetic
"period":"1d", // 1m,5m, to 1month
"columns":"", // return specific columns/All
"keep_parent_colm":0, //(0|1) work with columns
"filters":{"active.c_gt":1}, // range filter
"sort_by":"active.chp_desc", // columnname_asc /desc
"merge" :"latest,perf,tech,profile,meta", // merge other api
"synthetic":0, // 1=try find reverse if not found
"page":1,
"per_page":"50", //
"search":"", // search and symbol will not work together
"access_key":"API_KEY"
}
```
--------------------------------
### GET /forex/list
Source: https://fcsapi.com/document
Retrieves a list of available forex symbols.
```APIDOC
## GET /forex/list
### Description
Retrieves a list of available forex symbols.
### Method
GET
### Endpoint
https://api-v4.fcsapi.com/forex/list
### Parameters
#### Query Parameters
- **type** (string) - Required - The type of market (e.g., forex)
- **access_key** (string) - Required - Your API access key
### Request Example
curl "https://api-v4.fcsapi.com//forex/list?type=forex&access_key=API_KEY"
### Response
#### Success Response (200)
- **ticker** (string) - The ticker symbol
- **profile** (object) - Profile details of the symbol
- **meta** (object) - Metadata including market and currency info
```
--------------------------------
### Sorting Parameter Example
Source: https://fcsapi.com/document/forex-api
Demonstrates how to use the 'sort_by' parameter to sort API results. Append '_asc' for ascending or '_desc' for descending order to a column name.
```text
sort_by=chp_desc
```
```text
sort_by=c_desc
```
--------------------------------
### GET /forex/search
Source: https://fcsapi.com/document/forex-api
Searches for forex symbols and related instruments.
```APIDOC
## GET /forex/search
### Description
Searches for symbols based on a query string.
### Method
GET
### Endpoint
https://api-v4.fcsapi.com/forex/search
### Parameters
#### Query Parameters
- **search** (string) - Required - The search term
- **access_key** (string) - Required - Your API access key
### Response
#### Success Response (200)
- **status** (boolean) - Request status
- **response** (array) - List of matching symbols
```
--------------------------------
### Multiple Ticker Comparison API Example
Source: https://fcsapi.com/document/stock-api
Compare performance and volatility metrics across multiple stock tickers. Replace 'API_KEY' with your actual key.
```HTTP
https://api-v4.fcsapi.com/stock/performance?symbol=AAPL,MSFT,TSLA&access_key=API_KEY
```
--------------------------------
### Query Stock Advance with All Fields
Source: https://fcsapi.com/document/stock-api
A comprehensive example of the JSON structure for a POST request to the stock/advance endpoint, including filtering, sorting, and merging options.
```json
{
"symbol":"NASDAQ:AAPL,NYSE:TSLA", // EXCHANGE:SYMBOL
"exchange":"NASDAQ,NYSE", // return data from specific exchanges
"type":"stock", // stock,index
"sub_type":"spot", // spot,synthetic
"period":"1d", // 1m,5m, to 1month
"columns":"", // return specific columns/All
"keep_parent_colm":0, //(0|1) work with columns
"similar":0, // (0|1) get related symbols from differnt exchange.
"filters":{"c_gt":1}, // range filter
"sort_by":"c_desc", // columnname_asc /desc
"merge" :"latest,perf,tech,profile,meta", // merge other api
"page":1,
"per_page":"50", //
"search":"", // search and symbol will not work together
"access_key":"API_KEY"
}
```
--------------------------------
### GET /forex/converter
Source: https://fcsapi.com/document/forex-api
Converts an amount from one currency to another.
```APIDOC
## GET /forex/converter
### Description
Converts a specified amount from one currency pair to another.
### Method
GET
### Endpoint
https://api-v4.fcsapi.com/forex/converter
### Parameters
#### Query Parameters
- **pair1** (string) - Required - The source currency code (e.g., EUR)
- **pair2** (string) - Required - The target currency code (e.g., USD)
- **amount** (number) - Required - The amount to convert
- **access_key** (string) - Required - Your API access key
### Response
#### Success Response (200)
- **total** (string) - The converted amount
- **price_1x_EUR** (string) - Exchange rate reference
- **price_1x_USD** (string) - Exchange rate reference
```