Historical

Markets historical is also provided by the API. Please consider that all market-related methods are beta and under heavy development.

By symbol

Get market historical data by a specific symbol

/markets/historical/{symbol}

import tradingeconomics as te
te.login('your_api_key')

te.getHistorical(symbol='aapl:us')
const te = require('tradingeconomics');
te.login('your_api_key');

data = te.getHistoricalMarkets(symbol = 'aapl:us').then(function(data){
  console.log(data)     
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us?c=guest:guest");
SymbolDateOpenHighLowClose
AAPL:US12/07/2023189.68000191.70000188.47000189.75000
AAPL:US11/07/2023189.16000189.30000186.60000188.08000
AAPL:US10/07/2023189.26000189.99000187.03500188.61000

/markets/historical/{symbols}

te.getHistorical(symbol=['aapl:us','gac:com'])
data = te.getHistoricalMarkets(symbol = ['aapl:us','gac:com']).then(function(data){
  console.log(data)     
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=guest:guest");
SymbolDateOpenHighLowClose
AAPL:US12/07/2023189.680000000000191.700000000000188.470000000000189.760000000000
GAC:COM11/07/20231675.0000000000001675.0000000000001675.0000000000001675.000000000000
AAPL:US11/07/2023189.160000000000189.300000000000186.600000000000188.080000000000

By symbol and date

Get market historical data by a specific symbol and date interval.

/markets/historical/{symbol}?d1=yyyy-mm-dd

te.fetchMarkets(symbol='aapl:us', initDate='2017-08-01')
data = te.getHistoricalMarkets(symbol = 'aapl:us', start_date = '2017-08-01').then(function(data){
  console.log(data)     
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us?c=guest:guest&d1=2017-08-01");
SymbolDateOpenHighLowClose
AAPL:US12/07/2023189.68000191.70000188.47000189.84000
AAPL:US11/07/2023189.16000189.30000186.60000188.08000
AAPL:US10/07/2023189.26000189.99000187.03500188.61000

/markets/historical/{symbol}?d1=yyyy-mm-dd&d2=yyyy-mm-dd

te.fetchMarkets(symbol='aapl:us', initDate='2017-08-01',
 endDate='2017-08-08')
data = te.getHistoricalMarkets(symbol = 'aapl:us', start_date = '2017-08-01',
 end_date = '2017-08-08').then(function(data){
  console.log(data)     
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us?c=guest:guest&d1=2017-08-01&d2=2017-08-08");
SymbolDateOpenHighLowClose
AAPL:US12/07/2023189.68000191.70000188.47000189.89000
AAPL:US11/07/2023189.16000189.30000186.60000188.08000
AAPL:US10/07/2023189.26000189.99000187.03500188.61000

/markets/historical/{symbols}?d1=yyyy-mm-dd&d2=yyyy-mm-dd

te.fetchMarkets(symbol= ['aapl:us','gac:com'], initDate='2017-08-01',
 endDate='2017-08-08')
data = te.getHistoricalMarkets(symbol = ['aapl:us','gac:com'],
 start_date = '2017-08-01', end_date = '2017-08-08').then(function(data){
  console.log(data)     
});
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/markets/historical/aapl:us,gac:com?c=guest:guest&d1=2017-08-01&d2=2017-08-08");
SymbolDateOpenHighLowClose
AAPL:US12/07/2023189.680000000000191.700000000000188.470000000000189.820000000000
GAC:COM11/07/20231675.0000000000001675.0000000000001675.0000000000001675.000000000000
AAPL:US11/07/2023189.160000000000189.300000000000186.600000000000188.080000000000

Response fields

FieldTypeDescriptionExample
SymbolstringUnique symbol used by Trading Economics“AAPL:US”
DatestringRelease time and date in UTC“13/04/2023”
OpennumberOpen value161.63000
HighnumberHigh value165.61860
LownumberLow value161.42000
ClosenumberClose value165.50999