investing-com-api-v2
Version:
Unofficial APIs for Investing.com website.
990 lines (988 loc) • 28 kB
JavaScript
class InvestingService {
static VALID_PERIOD = ['P1D', 'P1W', 'P1M', 'P3M', 'P6M', 'P1Y', 'P5Y', 'MAX'];
static VALID_INTERVAL = ['PT1M', 'PT5M', 'PT15M', 'PT30M', 'PT1H', 'PT5H', 'P1D', 'P1W', 'P1M'];
static VALID_POINTS_COUNT = [60, 70, 120];
static MAPPING = {
'currencies/eur-usd': {
pairId: '1',
title: 'EUR/USD - Euro US Dollar',
name: 'EUR/USD',
},
'currencies/gbp-usd': {
pairId: '2',
title: 'GBP/USD - British Pound US Dollar',
name: 'GBP/USD',
},
'currencies/usd-jpy': {
pairId: '3',
title: 'USD/JPY - US Dollar Japanese Yen',
name: 'USD/JPY',
},
'currencies/usd-chf': {
pairId: '4',
title: 'USD/CHF - US Dollar Swiss Franc',
name: 'USD/CHF',
},
'currencies/aud-usd': {
pairId: '5',
title: 'AUD/USD - Australian Dollar US Dollar',
name: 'AUD/USD',
},
'currencies/eur-gbp': {
pairId: '6',
title: 'EUR/GBP - Euro British Pound',
name: 'EUR/GBP',
},
'currencies/usd-cad': {
pairId: '7',
title: 'USD/CAD - US Dollar Canadian Dollar',
name: 'USD/CAD',
},
'currencies/nzd-usd': {
pairId: '8',
title: 'NZD/USD - New Zealand Dollar US Dollar',
name: 'USD/CAD',
},
'currencies/eur-jpy': {
pairId: '9',
title: 'EUR/JPY - Euro Japanese Yen',
name: 'EUR/JPY',
},
'currencies/eur-chf': {
pairId: '10',
title: 'EUR/CHF - Euro Swiss Franc',
name: 'EUR/CHF',
},
'currencies/gbp-jpy': {
pairId: '11',
title: 'GBP/JPY - British Pound Japanese Yen',
name: 'GBP/JPY',
},
'currencies/gbp-chf': {
pairId: '12',
title: 'GBP/CHF - British Pound Swiss Franc',
name: 'GBP/CHF',
},
'currencies/chf-jpy': {
pairId: '13',
title: 'CHF/JPY - Swiss Franc Japanese Yen',
name: 'CHF/JPY',
},
'currencies/cad-chf': {
pairId: '14',
title: 'CAD/CHF - Canadian Dollar Swiss Franc',
name: 'CAD/CHF',
},
'currencies/eur-aud': {
pairId: '15',
title: 'EUR/AUD - Euro Australian Dollar',
name: 'EUR/AUD',
},
'currencies/eur-cad': {
pairId: '16',
title: 'EUR/CAD - Euro Canadian Dollar',
name: 'EUR/CAD',
},
'currencies/usd-zar': {
pairId: '17',
title: 'USD/ZAR - US Dollar South African Rand',
name: 'USD/ZAR',
},
'currencies/usd-try': {
pairId: '18',
title: 'USD/TRY - US Dollar Turkish Lira',
name: 'USD/TRY',
},
'currencies/ars-brl': {
pairId: '1473',
title: 'ARS/BRL - Argentinian Peso Brazil Real',
name: 'ARS/BRL',
},
'currencies/aud-brl': {
pairId: '1485',
title: 'AUD/BRL - Australian Dollar Brazil Real',
name: 'AUD/BRL',
},
'currencies/brl-ars': {
pairId: '1505',
title: 'BRL/ARS - Brazil Real Argentinian Peso',
name: 'BRL/ARS',
},
'currencies/brl-aud': {
pairId: '1506',
title: 'BRL/AUD - Brazil Real Australian Dollar',
name: 'BRL/AUD',
},
'currencies/brl-cad': {
pairId: '1507',
title: 'BRL/CAD - Brazil Real Canadian Dollar',
name: 'BRL/CAD',
},
'currencies/brl-chf': {
pairId: '1508',
title: 'BRL/CHF - Brazil Real Swiss Franc',
name: 'BRL/CHF',
},
'currencies/brl-clp': {
pairId: '1509',
title: 'BRL/CLP - Brazil Real Chilean Peso',
name: 'BRL/CLP',
},
'currencies/brl-dkk': {
pairId: '1510',
title: 'BRL/DKK - Brazil Real Danish Krone',
name: 'BRL/DKK',
},
'currencies/brl-hkd': {
pairId: '1512',
title: 'BRL/HKD - Brazil Real Hong Kong Dollar',
name: 'BRL/HKD',
},
'currencies/brl-jpy': {
pairId: '1513',
title: 'BRL/JPY - Brazil Real Japanese Yen',
name: 'BRL/JPY',
},
'currencies/brl-mxn': {
pairId: '1514',
title: 'BRL/MXN - Brazil Real Mexican Peso',
name: 'BRL/MXN',
},
'currencies/brl-sgd': {
pairId: '1515',
title: 'BRL/SGD - Brazil Real Singapore Dollar',
name: 'BRL/SGD',
},
'currencies/brl-usd': {
pairId: '1516',
title: 'BRL/USD - Brazil Real US Dollar',
name: 'BRL/USD',
},
'currencies/cad-brl': {
pairId: '1523',
title: 'CAD/BRL - Canadian Dollar Brazil Real',
name: 'CAD/BRL',
},
'currencies/chf-brl': {
pairId: '1544',
title: 'CHF/BRL - Swiss Franc Brazil Real',
name: 'CHF/BRL',
},
'currencies/eur-brl': {
pairId: '1617',
title: 'EUR/BRL - Euro Brazil Real',
name: 'EUR/BRL',
},
'currencies/gbp-brl': {
pairId: '1736',
title: 'GBP/BRL - British Pound Brazil Real',
name: 'GBP/BRL',
},
'currencies/jpy-brl': {
pairId: '1890',
title: 'JPY/BRL - Japanese Yen Brazil Real',
name: 'JPY/BRL',
},
'currencies/sgd-brl': {
pairId: '2027',
title: 'SGD/BRL - Singapore Dollar Brazil Real',
name: 'SGD/BRL',
},
'currencies/usd-brl': {
pairId: '2103',
title: 'USD/BRL - US Dollar Brazil Real',
name: 'USD/BRL',
},
'currencies/us-dollar-index': {
pairId: '8827',
title: 'US Dollar Index Futures',
name: 'Dollar index',
},
'currencies/aed-brl': {
pairId: '9277',
title: 'AED/BRL - UAE Dirham Brazil Real',
name: 'AED/BRL',
},
'currencies/cny-brl': {
pairId: '9493',
title: 'CNY/BRL - Chinese Yuan Brazil Real',
name: 'CNY/BRL',
},
'currencies/dkk-brl': {
pairId: '9575',
title: 'DKK/BRL - Danish Krone Brazil Real',
name: 'DKK/BRL',
},
'currencies/hkd-brl': {
pairId: '9617',
title: 'HKD/BRL - Hong Kong Dollar Brazil Real',
name: 'HKD/BRL',
},
'currencies/nok-brl': {
pairId: '9841',
title: 'NOK/BRL - Norwegian Krone Brazil Real',
name: 'NOK/BRL',
},
'currencies/sek-brl': {
pairId: '10130',
title: 'SEK/BRL - Swedish Krona Brazil Real',
name: 'SEK/BRL',
},
'currencies/usd-krw': {
pairId: '650',
title: 'USD/KRW - US Dollar Korean Won',
name: 'USD/KRW',
},
'currencies/usd-inr': {
pairId: '160',
title: 'USD/INR - US Dollar Indian Rupee',
name: 'USD/INR',
},
'currencies/xau-usd': {
pairId: '68',
title: 'XAU/USD - Gold Spot US Dollar',
name: 'XAU/USD - Gold Spot US Dollar',
},
'currencies/xag-usd': {
pairId: '69',
title: 'XAG/USD - Silver Spot US Dollar',
name: 'XAG/USD - Gold Spot US Dollar',
},
'currencies/xpd-usd': {
pairId: '1043108',
title: 'XPD/USD - Palladium Spot US Dollar',
name: 'XPD/USD - Palladium Spot US Dollar',
},
'currencies/xpt-usd': {
pairId: '1043107',
title: 'XPT/USD - Platinum Spot US Dollar',
name: 'XPT/USD - Platinum Spot US Dollar',
},
'commodities/gold': {
pairId: '8830',
title: 'Gold Futures',
name: 'Gold',
},
'commodities/silver': {
pairId: '8836',
title: 'Silver Futures',
name: 'Silver',
},
'commodities/copper': {
pairId: '8831',
title: 'Copper Futures',
name: 'Copper',
},
'commodities/crude-oil': {
pairId: '8849',
title: 'Crude Oil WTI Futures',
name: 'Crude Oil WTI',
},
'commodities/brent-oil': {
pairId: '8833',
title: 'Brent Oil Futures',
name: 'Brent Oil',
},
'commodities/natural-gas': {
pairId: '8862',
title: 'Natural Gas Futures',
name: 'Natural Gas',
},
'commodities/us-coffee-c': {
pairId: '8832',
title: 'US Coffee C Futures',
name: 'US Coffee C',
},
'commodities/us-wheat': {
pairId: '8917',
title: 'US Wheat Contract',
name: 'US Wheat',
},
'commodities/london-coffee': {
pairId: '8911',
title: 'London Robusta Coffee Futures',
name: 'London Robusta Coffee',
},
'indices/us-30': {
pairId: '169',
title: 'Dow Jones Industrial Average (NYSE)',
name: 'Dow 30',
},
'indices/us-30-futures': {
pairId: '8873',
title: 'Dow Jones Futures',
name: 'Dow Jones',
},
'indices/us-30-futures?cid=1175152': {
pairId: '1175152',
title: 'US 30 Cash (US30)',
name: 'US 30',
},
'indices/nq-100': {
pairId: '20',
title: 'Nasdaq 100 (NASDAQ)',
name: 'Nasdaq 100',
},
'indices/nq-100-futures': {
pairId: '8874',
title: 'Nasdaq 100 Futures',
name: 'Nasdaq 100',
},
'indices/nq-100-futures?cid=1175151': {
pairId: '1175151',
title: 'US Tech 100 Cash (USTECH)',
name: 'US Tech 100',
},
'indices/us-spx-500': {
pairId: '166',
title: 'S&P 500 (NYSE)',
name: 'S&P 500',
},
'indices/us-spx-500-futures': {
pairId: '8839',
title: 'S&P 500 Futures',
name: 'S&P 500',
},
'indices/germany-30': {
pairId: '172',
title: 'DAX (Xetra)',
name: 'DAX',
},
'indices/germany-30-futures': {
pairId: '8826',
title: 'DAX Futures',
name: 'DAX',
},
'indices/uk-100': {
pairId: '27',
title: 'FTSE 100 (London)',
name: 'FTSE 100',
},
'indices/france-40': {
pairId: '167',
title: 'CAC 40 (Paris)',
name: 'CAC 40',
},
'indices/japan-ni225': {
pairId: '178',
title: 'Nikkei 225 (Tokyo)',
name: 'Nikkei 225',
},
'indices/it-mib-40': {
pairId: '177',
title: 'FTSE MIB',
name: 'FTSE MIB',
},
'indices/s-p-cnx-nifty': {
pairId: '17940',
title: 'Nifty 50 (NSEI)',
name: 'Nifty 50',
},
'indices/india-50-futures': {
pairId: '8985',
title: 'Nifty 50 Futures',
name: 'Nifty 50',
},
'indices/india-50-futures?cid=101810': {
pairId: '101810',
title: 'SGX Nifty 50 Futures',
name: 'SGX Nifty 50',
},
'indices/bank-nifty': {
pairId: '17950',
title: 'Nifty Bank (NSEBANK)',
name: 'Nifty Bank',
},
'indices/bank-nifty-futures': {
pairId: '104423',
title: 'Bank NIFTY Futures',
name: 'Bank NIFTY',
},
'crypto/bitcoin/btc-usd': {
pairId: '945629',
title: 'BTC/USD - Bitcoin US Dollar',
name: 'BTC/USD',
},
'crypto/ethereum/eth-usd?c997650': {
pairId: '997650',
title: 'ETH/USD - Ethereum US Dollar',
name: 'ETH/USD',
},
'crypto/bitcoin-cash/bch-usd': {
pairId: '1058255',
title: 'BCH/USD - Bitcoin Cash US Dollar',
name: 'BCH/USD',
},
'crypto/iota/iota-usd': {
pairId: '1031068',
title: 'IOTA/USD - IOTA US Dollar',
name: 'IOTA/USD',
},
'crypto/litecoin/ltc-usd?c1010798': {
pairId: '1010798',
title: 'LTC/USD - Litecoin US Dollar',
name: 'LTC/USD',
},
'crypto/xrp/xrp-usd?c1010782': {
pairId: '1010782',
title: 'XRP/USD - XRP US Dollar',
name: 'XRP/USD',
},
'crypto/bitcoin/btc-eur': {
pairId: '1010801',
title: 'BTC/EUR - Bitcoin Euro',
name: 'BTC/EUR',
},
'crypto/dash/dash-usd': {
pairId: '1010785',
title: 'DASH/USD - Dash US Dollar',
name: 'DASH/USD',
},
'equities/bank-of-america': {
pairId: '243',
title: 'Bank of America Corp (NYSE)',
name: 'Bank of America',
},
'equities/jp-morgan-chase': {
pairId: '267',
title: 'JPMorgan Chase & Co (NYSE)',
name: 'JPMorgan',
},
'equities/apple-computer-inc': {
pairId: '6408',
title: 'Apple Inc (NASDAQ)',
name: 'Apple',
},
'equities/google-inc': {
pairId: '6369',
title: 'Alphabet Inc Class A (NASDAQ)',
name: 'Alphabet A',
},
'equities/tesla-motors': {
pairId: '13994',
title: 'Tesla Inc (NASDAQ)',
name: 'Tesla',
},
'equities/amazon-com-inc': {
pairId: '6435',
title: 'Amazon.com Inc (NASDAQ)',
name: 'Amazon.com',
},
'equities/facebook-inc': {
pairId: '26490',
title: 'Facebook Inc (NASDAQ)',
name: 'Facebook',
},
'equities/adv-micro-device': {
pairId: '8274',
title: 'Advanced Micro Devices Inc (NASDAQ)',
name: 'AMD',
},
'equities/nvidia-corp': {
pairId: '6497',
title: 'NVIDIA Corporation (NASDAQ)',
name: 'NVIDIA',
},
'equities/alibaba': {
pairId: '941155',
title: 'Alibaba Group Holdings Ltd ADR (NYSE)',
name: 'Alibaba ADR',
},
'equities/netflix,-inc.': {
pairId: '13063',
title: 'Netflix Inc (NASDAQ)',
name: 'Netflix',
},
'rates-bonds/uk-1-month-bond-yield': {
pairId: '23661',
title: 'UK 1-Month Bond Yield',
name: 'UK 1M',
},
'rates-bonds/uk-3-month-bond-yield': {
pairId: '23662',
title: 'UK 3-Month Bond Yield',
name: 'UK 3M',
},
'rates-bonds/uk-6-month-bond-yield': {
pairId: '23663',
title: 'UK 6-Month Bond Yield',
name: 'UK 6M',
},
'rates-bonds/uk-1-year-bond-yield': {
pairId: '23664',
title: 'UK 1-Year Bond Yield',
name: 'UK 1Y',
},
'rates-bonds/uk-2-year-bond-yield': {
pairId: '23665',
title: 'UK 2-Year Bond Yield',
name: 'UK 2Y',
},
'rates-bonds/uk-3-year-bond-yield': {
pairId: '23666',
title: 'UK 3-Year Bond Yield',
name: 'UK 3Y',
},
'rates-bonds/uk-5-year-bond-yield': {
pairId: '23668',
title: 'UK 5-Year Bond Yield',
name: 'UK 5Y',
},
'rates-bonds/uk-7-year-bond-yield': {
pairId: '23670',
title: 'UK 7-Year Bond Yield',
name: 'UK 7Y',
},
'rates-bonds/uk-8-year-bond-yield': {
pairId: '23671',
title: 'UK 8-Year Bond Yield',
name: 'UK 8Y',
},
'rates-bonds/uk-9-year-bond-yield': {
pairId: '23672',
title: 'UK 9-Year Bond Yield',
name: 'UK 9Y',
},
'rates-bonds/uk-10-year-bond-yield': {
pairId: '23673',
title: 'UK 10-Year Bond Yield',
name: 'UK 10Y',
},
'rates-bonds/uk-15-year-bond-yield': {
pairId: '23674',
title: 'UK 15-Year Bond Yield',
name: 'UK 15Y',
},
'rates-bonds/uk-20-year-bond-yield': {
pairId: '23675',
title: 'UK 20-Year Bond Yield',
name: 'UK 20Y',
},
'rates-bonds/uk-25-year-bond-yield': {
pairId: '23676',
title: 'UK 25-Year Bond Yield',
name: 'UK 25Y',
},
'rates-bonds/uk-30-year-bond-yield': {
pairId: '23677',
title: 'UK 30-Year Bond Yield',
name: 'UK 30Y',
},
'rates-bonds/uk-40-year-bond-yield': {
pairId: '23678',
title: 'UK 40-Year Bond Yield',
name: 'UK 40Y',
},
'rates-bonds/uk-50-year-bond-yield': {
pairId: '23679',
title: 'UK 50-Year Bond Yield',
name: 'UK 50Y',
},
'rates-bonds/u.s.-1-month-bond-yield': {
pairId: '23697',
title: 'United States 1-Month Bond Yield (NYSE)',
name: 'U.S. 1M',
},
'rates-bonds/u.s.-3-month-bond-yield': {
pairId: '23698',
title: 'United States 3-Month Bond Yield (NYSE)',
name: 'U.S. 3M',
},
'rates-bonds/u.s.-6-month-bond-yield': {
pairId: '23699',
title: 'United States 6-Month Bond Yield (NYSE)',
name: 'U.S. 6M',
},
'rates-bonds/u.s.-1-year-bond-yield': {
pairId: '23700',
title: 'United States 1-year Bond Yield (NYSE)',
name: 'U.S. 1Y',
},
'rates-bonds/u.s.-2-year-bond-yield': {
pairId: '23701',
title: 'United States 2-Year (NYSE)',
name: 'U.S. 2Y',
},
'rates-bonds/u.s.-3-year-bond-yield': {
pairId: '23702',
title: 'United States 3-Year (NYSE)',
name: 'U.S. 3Y',
},
'rates-bonds/u.s.-5-year-bond-yield': {
pairId: '23703',
title: 'United States 5-Year (NYSE)',
name: 'U.S. 5Y',
},
'rates-bonds/u.s.-7-year-bond-yield': {
pairId: '23704',
title: 'United States 7-Year (NYSE)',
name: 'U.S. 7Y',
},
'rates-bonds/u.s.-10-year-bond-yield': {
pairId: '23705',
title: 'United States 10-Year (NYSE)',
name: 'U.S. 10Y',
},
'rates-bonds/u.s.-30-year-bond-yield': {
pairId: '23706',
title: 'United States 30-Year (NYSE)',
name: 'U.S. 30Y',
},
'rates-bonds/euro-bund': {
pairId: '8895',
title: 'Euro Bund Futures',
name: 'Euro Bund',
},
'rates-bonds/us-10-yr-t-note': {
pairId: '8880',
title: 'US 10 Year T-Note Futures',
name: 'US 10Y T-Note',
},
'rates-bonds/us-30-yr-t-bond': {
pairId: '8907',
title: 'US 30 Year T-Bond Contract',
name: 'US 30Y T-Bond',
},
'rates-bonds/japan-govt.-bond': {
pairId: '8986',
title: 'Japan Government Bond Futures',
name: 'Japan Govt. Bond',
},
'rates-bonds/uk-gilt': {
pairId: '8886',
title: 'UK Gilt Futures',
name: 'UK Gilt',
},
'rates-bonds/de-10y-vs-it-10y': {
pairId: '1079965',
title: 'Italy 10 Year vs Germany 10 Year Spread Bond Yield',
name: 'Spread BTP-Bund 10Y',
},
'rates-bonds/australia-30-year': {
pairId: '1052473',
title: 'Australia 30-Year Bond Yield',
name: 'Australia 30Y',
},
'rates-bonds/australia-20-year': {
pairId: '1052472',
title: 'Australia 20-Year Bond Yield',
name: 'Australia 20Y',
},
'rates-bonds/australia-15-year-bond-yield': {
pairId: '23880',
title: 'Australia 15-Year Bond Yield',
name: 'Australia 15Y',
},
'rates-bonds/australia-12-year-bond-yield': {
pairId: '23879',
title: 'Australia 12-Year Bond Yield',
name: 'Australia 12Y',
},
'rates-bonds/australia-10-year-bond-yield': {
pairId: '23878',
title: 'Australia 10-Year Bond Yield',
name: 'Australia 10Y',
},
'rates-bonds/australia-9-year-bond-yield': {
pairId: '23877',
title: 'Australia 9-Year Bond Yield',
name: 'Australia 9Y',
},
'rates-bonds/australia-8-year-bond-yield': {
pairId: '23876',
title: 'Australia 8-Year Bond Yield',
name: 'Australia 8Y',
},
'rates-bonds/australia-7-year-bond-yield': {
pairId: '23875',
title: 'Australia 7-Year Bond Yield',
name: 'Australia 7Y',
},
'rates-bonds/australia-6-year-bond-yield': {
pairId: '23874',
title: 'Australia 6-Year Bond Yield',
name: 'Australia 6Y',
},
'rates-bonds/australia-5-year-bond-yield': {
pairId: '23873',
title: 'Australia 5-Year Bond Yield',
name: 'Australia 5Y',
},
'rates-bonds/australia-4-year-bond-yield': {
pairId: '23872',
title: 'Australia 4-Year Bond Yield',
name: 'Australia 4Y',
},
'rates-bonds/australia-3-year-bond-yield': {
pairId: '23871',
title: 'Australia 3-Year Bond Yield',
name: 'Australia 3Y',
},
'rates-bonds/australia-2-year-bond-yield': {
pairId: '23870',
title: 'Australia 2-Year Bond Yield',
name: 'Australia 2Y',
},
'rates-bonds/australia-1-year-bond-yield': {
pairId: '23869',
title: 'Australia 1-Year Bond Yield',
name: 'Australia 1Y',
},
'rates-bonds/india-3-month-bond-yield': {
pairId: '24003',
title: 'India 3-Month Bond Yield',
name: 'India 3M',
},
'rates-bonds/india-6-month-bond-yield': {
pairId: '24004',
title: 'India 6-Month Bond Yield',
name: 'India 6M',
},
'rates-bonds/india-1-year-bond-yield': {
pairId: '24005',
title: 'India 1-Year Bond Yield',
name: 'India 1Y',
},
'rates-bonds/india-2-year-bond-yield': {
pairId: '24006',
title: 'India 2-Year Bond Yield',
name: 'India 2Y',
},
'rates-bonds/india-3-year-bond-yield': {
pairId: '24007',
title: 'India 3-Year Bond Yield',
name: 'India 3Y',
},
'rates-bonds/india-4-year-bond-yield': {
pairId: '24008',
title: 'India 4-Year Bond Yield',
name: 'India 4Y',
},
'rates-bonds/india-5-year-bond-yield': {
pairId: '24009',
title: 'India 5-Year Bond Yield',
name: 'India 5Y',
},
'rates-bonds/india-6-year-bond-yield': {
pairId: '24010',
title: 'India 6-Year Bond Yield',
name: 'India 6Y',
},
'rates-bonds/india-7-year-bond-yield': {
pairId: '24011',
title: 'India 7-Year Bond Yield',
name: 'India 7Y',
},
'rates-bonds/india-8-year-bond-yield': {
pairId: '24012',
title: 'India 8-Year Bond Yield',
name: 'India 8Y',
},
'rates-bonds/india-9-year-bond-yield': {
pairId: '24013',
title: 'India 9-Year Bond Yield',
name: 'India 9Y',
},
'rates-bonds/india-10-year-bond-yield': {
pairId: '24014',
title: 'India 10-Year Bond Yield',
name: 'India 10Y',
},
'rates-bonds/india-11-year-bond-yield': {
pairId: '24015',
title: 'India 11-Year Bond Yield',
name: 'India 11Y',
},
'rates-bonds/india-12-year-bond-yield': {
pairId: '24016',
title: 'India 12-Year Bond Yield',
name: 'India 12Y',
},
'rates-bonds/india-13-year-bond-yield': {
pairId: '24017',
title: 'India 13-Year Bond Yield',
name: 'India 13Y',
},
'rates-bonds/india-14-year-bond-yield': {
pairId: '24018',
title: 'India 14-Year Bond Yield',
name: 'India 14Y',
},
'rates-bonds/india-15-year-bond-yield': {
pairId: '24019',
title: 'India 15-Year Bond Yield',
name: 'India 15Y',
},
'rates-bonds/india-19-year-bond-yield': {
pairId: '24020',
title: 'India 19-Year Bond Yield',
name: 'India 19Y',
},
'rates-bonds/india-24-year-bond-yield': {
pairId: '24021',
title: 'India 24-Year Bond Yield',
name: 'India 24Y',
},
'rates-bonds/india-30-year-bond-yield': {
pairId: '24022',
title: 'India 30-Year Bond Yield',
name: 'India 30Y',
},
'rates-bonds/aus-5-year-cds': {
pairId: '1116310',
title: 'Australia 5Y Credit Default Swap',
name: 'Australia 5Y CDS',
},
'rates-bonds/bra-5-year-cds': {
pairId: '1116031',
title: 'Brasil 5Y Credit Default Swap',
name: 'Brasil 5Y CDS',
},
'rates-bonds/can-5-year-cds': {
pairId: '1158920',
title: 'Canada 5Y Credit Default Swap',
name: 'Canada 5Y CDS',
},
'rates-bonds/esp-5-year-cds': {
pairId: '1115764',
title: 'Spain 5Y Credit Default Swap',
name: 'Spain 5Y CDS',
},
'rates-bonds/fra-5-year-cds': {
pairId: '1158922',
title: 'France 5Y Credit Default Swap',
name: 'France 5Y CDS',
},
'rates-bonds/gbr-5-year-cds': {
pairId: '1115185',
title: 'United Kingdom 5Y Credit Default Swap',
name: 'United Kingdom 5Y CDS',
},
'rates-bonds/ita-5-year-cds': {
pairId: '1115161',
title: 'Italy 5Y Credit Default Swap',
name: 'Italy 5Y CDS',
},
'rates-bonds/mex-5-year-cds': {
pairId: '1158921',
title: 'Mexico 5Y Credit Default Swap',
name: 'Mexico 5Y CDS',
},
'rates-bonds/rus-5-year-cds': {
pairId: '1115195',
title: 'Russia 5Y Credit Default Swap',
name: 'Russia 5Y CDS',
},
'rates-bonds/tur-5-year-cds': {
pairId: '1096486',
title: 'Turkey 5Y Credit Default Swap',
name: 'Turkey 5Y CDS',
},
'rates-bonds/usa-5-year-cds': {
pairId: '1115808',
title: 'United States 5Y Credit Default Swap',
name: 'United States 5Y CDS',
},
'etfs/diamonds-trust': {
pairId: '504',
title: 'SPDR® Dow Jones Industrial Average ETF Trust (NYSE)',
name: 'SPDR DJIA',
},
'etfs/ishares-russell-1000-growth': {
pairId: '44554',
title: 'iShares Russell 1000 Growth ETF (NYSE)',
name: 'iShares Russell 1000 Growth',
},
'etfs/ishares-russell-2000-index-etf': {
pairId: '14202',
title: 'iShares Russell 2000 ETF (NYSE)',
name: 'iShares Russell 2000',
},
'etfs/powershares-qqqq': {
pairId: '651',
title: 'Invesco QQQ Trust (NASDAQ)',
name: 'Invesco QQQ Trust Series 1',
},
'etfs/spdr-s-p-500': {
pairId: '525',
title: 'SPDR S&P 500 (NYSE)',
name: 'SPDR S&P 500',
},
'etfs/proshares-ultrashort-s-p500': {
pairId: '14210',
title: 'ProShares UltraShort S&P500 (NYSE)',
name: 'ProShares UltraShort S&P500',
},
'etfs/proshares-ultrashort-qqq-etf': {
pairId: '14206',
title: 'ProShares UltraShort QQQ (NYSE)',
name: 'ProShares UltraShort QQQ',
},
'etfs/market-vectors-gold-miners': {
pairId: '40681',
title: 'VanEck Vectors Gold Miners ETF (NYSE)',
name: 'VanEck Vectors Gold Miners',
},
'etfs/united-states-oil-fund': {
pairId: '44794',
title: 'United States Oil Fund, LP (NYSE)',
name: 'United States Oil',
},
'funds/vanguard-500-index-admiral': {
pairId: '997364',
title: 'Vanguard 500 Index Fund Admiral Shares',
name: 'Vanguard 500 Index Admiral',
},
'funds/vanguard-total-bond-market-ii-idx-i': {
pairId: '997994',
title: 'Vanguard Total Bond Market Ii Index Fund Investor Shares',
name: 'Vanguard Total Bond Market II Index Fund Investor',
},
'funds/american-funds-capital-income-bldr': {
pairId: '997995',
title: 'American Funds Capital Income Builder® Class A',
name: 'American Funds Capital Income Builder A',
},
'funds/pimco-commodity-real-ret-strat-inst': {
pairId: '1005582',
title: 'Pimco Commodity Real Return Strategy Fund Institutional Class',
name: 'PIMCO Commodity Real Return Strategy Institutional',
},
"commodities/nickel": {
pairId: "959208",
title: "Nickel",
name: "Nickel",
},
"commodities/tin": {
pairId: "1206787",
title: "Tin",
name: "Tin",
},
"equities/century-aluminum-co": {
pairId: "948436",
title: "Alumium",
name: "Alumium",
},
"etfs/etfs-zinc": {
pairId: "956470",
title: "Zinc",
name: "Zinc",
},
};
/**
* Map the Investing array response
* @param {Array} array Array of data returned from Investing website
* @return {Array} An array of objects with date and value properties
*/
static mapResponse(array = []) {
return array.map((item) => ({
date: item[0], // date
value: item[1], // open
price_open: item[1],
price_high: item[2],
price_low: item[3],
price_close: item[4],
}));
}
}
module.exports = InvestingService;