Active symbols
DataNo AuthGet the list of active symbols, the underlying markets you can trade contracts on. Response fields are renamed, spot and display fields are removed, filtering parameters are removed and contract_type values changed.
7 Breaking Changes
symbol is renamed to underlying_symbol and other fields are renamed, display, spot and metadata fields are removed, filtering parameters are removed, and the contract_type filter accepts different values.Quick comparison
Breaking changes
1. Response fields renamed
Four fields of each symbol are renamed:
symbol→underlying_symbolsymbol_type→underlying_symbol_typedisplay_name→underlying_symbol_namepip→pip_size
Required change: Read the new field names. The symbol's display name is still returned, as underlying_symbol_name.
2. Translated display name fields removed
market_display_name, subgroup_display_name and submarket_display_name are no longer returned.
Required change: Build display names from market, subgroup and submarket instead.
3. Spot fields removed
spot, spot_age, spot_percentage_change and spot_time are no longer returned.
Required change: Use the ticks call to get real-time spot prices.
4. Landing company, product type and loginid parameters removed
The request no longer accepts landing_company, landing_company_short, product_type or loginid.
Required change: Remove these parameters from your active_symbols requests.
5. barrier_category removed
The request no longer accepts barrier_category, so you can no longer filter symbols by barrier category.
Required change: Remove barrier_category and filter the symbol list in your code, or filter by contract_type.
6. Metadata fields removed
allow_forward_starting, close_only, delay_amount, display_order, exchange_name, intraday_interval_minutes and quoted_currency_symbol are no longer returned.
Required change: Stop reading these fields.
7. contract_type values changed
The contract_type filter no longer accepts CALLSPREAD, PUTSPREAD, LBFLOATCALL, LBFLOATPUT or LBHIGHLOW, and adds HIGHER and LOWER.
Required change: Remove the values the New API no longer accepts from contract_type.
Request structure
{
"active_symbols": "brief",
"contract_type": [
"CALL",
"CALLSPREAD"
],
"landing_company": "svg",
"req_id": 1
}{
"active_symbols": "brief",
"contract_type": [
"CALL",
"HIGHER"
],
"req_id": 1
}Response structure
{
"active_symbols": [
{
"display_name": "Volatility 100 Index",
"display_order": 1,
"exchange_is_open": 1,
"is_trading_suspended": 0,
"market": "synthetic_index",
"market_display_name": "Derived",
"pip": 0.01,
"subgroup": "synthetics",
"subgroup_display_name": "Synthetics",
"submarket": "random_index",
"submarket_display_name": "Continuous Indices",
"symbol": "R_100",
"symbol_type": "stockindex"
}
],
"echo_req": {
"active_symbols": "brief",
"contract_type": [
"CALL",
"CALLSPREAD"
],
"landing_company": "svg",
"req_id": 1
},
"msg_type": "active_symbols",
"req_id": 1
}{
"active_symbols": [
{
"exchange_is_open": 1,
"is_trading_suspended": 0,
"market": "synthetic_index",
"pip_size": 0.01,
"subgroup": "synthetics",
"submarket": "random_index",
"trade_count": 1250,
"underlying_symbol": "R_100",
"underlying_symbol_name": "Volatility 100 Index",
"underlying_symbol_type": "stockindex"
}
],
"echo_req": {
"active_symbols": "brief",
"contract_type": [
"CALL",
"HIGHER"
],
"req_id": 1
},
"msg_type": "active_symbols",
"req_id": 1
}Code examples
function getActiveSymbols() {
ws.send(JSON.stringify({ active_symbols: "brief", landing_company: "svg" }));
ws.onmessage = (event) => {
const response = JSON.parse(event.data);
if (response.msg_type !== "active_symbols" || !response.active_symbols) return;
response.active_symbols.forEach((symbol) => {
console.log(symbol.symbol, symbol.display_name, symbol.market_display_name, symbol.pip);
});
};
}Any other questions? Get in touch